animetosho / Nyuu

Flexible usenet binary posting tool
215 stars 30 forks source link

Pass "Password" and "Category" to Nyuu #117

Closed df-a closed 11 months ago

df-a commented 11 months ago

Hi there,

I used to be able to pass password and category using the config.json file, but I also had the config.js in which I had multiple servers configured for posting and some more custom stuff. All of a sudden, my custom config stopped working, and I was forced to reinstall Nyuu. Now, it seems to force me to choose to use either config.json OR config.js.

Needless to say, I will be using config.js. But with that, how do I pass the proper "password" and "category" variables to the NZB? I have them read in from files, I need to know where to put them

I tried to add it sed with the metaData part

 metaData: {
                // eg:
                // password: 'mysecret',
                // tag: ['SD', 'H.264'],
        },

and change it per upload to

 metaData: {
                // eg:
                password: 'The correct password',
                tag: "aaa > bbb",
        },

But I haven't found out a way to make this work reliably yet. I feel it's something very simple I'm completely overlooking.

animetosho commented 11 months ago

You'll need to remove the comment mark (//), otherwise those lines get ignored.

df-a commented 11 months ago

Hahaha my bad I was to hasty to make the example, I now fixed it

Upon reading help-full, I now do the pushes as such

nyuu -i $i -o "$i".nzb --progress stderr  -M password="${PASSWORD}" -M category="${NZB_CATEGORY}"

WHich was what I was looking for. I used to use config.json for pass and cat, and config.js for servers. It somehow worked this whole time but I'm under the impression it wasn't supposed to. I now fixed it to only use config.js

df-a commented 11 months ago

Issue can be closed, it works wonderfully and as intended.