animetosho / Nyuu

Flexible usenet binary posting tool
221 stars 32 forks source link

Upload NZB file #5

Open Ronnnny opened 8 years ago

Ronnnny commented 8 years ago

I see in uploadmgr.js that uploading the NZB file is on your TODO list, any chance of this happening in the near future? it's nice to have a copy of the original nzb file stored with the rest of the upload. Cheers.

animetosho commented 8 years ago

It's under consideration, as it isn't the most trivial thing to implement.

Ultimately, it can be done without Nyuu explicitly supporting it - just run Nyuu a second time with the NZB output from the first run as input. Of course, there's some benefits with integrating support for it, but it's not particularly high on the priority list at the moment unfortunately.

I'll update this Issue when it gets implemented. Thanks for the suggestion!

Ronnnny commented 8 years ago

I thought about running the upload a second time so I'll do that for now and thanks for the great piece of software :+1:

sirjaymz commented 6 years ago

So, are we going to be implementing NZB upload support?

jrehmer commented 2 years ago

This can be harder to automate because you have to know the number of files that will be in the upload when generating the first nyuu command, but you can do what I do and manipulate the subject line, run nyuu twice, once for the files, and a second for posting the NZB. I'm not sure why this is hard to implement in nyuu, nyuu just needs to increment the file counter by 1 and add the NZB at the end.

In this example I am uploading 11 files:

nyuu -s '[{0filenum}/12] - "{filename}" yEnc ({part}/{parts}) {filesize}' -o some.nzb files* nyuu -s '[12/12] - "{filename}" yEnc ({part}/{parts}) {filesize}' some.nzb

Jolly-Pirate commented 2 years ago

I already do that approach mentioned by @jrehmer. From a bash script, I count the files, post them starting at 01/xx, then upload the nzb aftewards and tag it as 00/xx.

nyuu "$dirname" -r -O -o "$nzbfile" --subject "$dirname - \"{filename}\" [{0filenum}/{files}] ({part}/{parts})" --comment "$dirname" -C ~/nyuu-$provider.conf -g $groups
nyuu "$nzbfile" -O -o "$nzbfile2" --subject "$dirname - \"{filename}\" [$filenum/$files] ({part}/{parts})" --comment "$dirname" -C ~/nyuu-$provider.conf -g $groups

Where $filenum is a padded zeroes variable depending on how many files/rars are uploaded, to keep the file numbering in the posted header consistent, e.g. 0/9, 00/45, 000/125, etc...

animetosho commented 2 years ago

I'm not sure why this is hard to implement in nyuu, nyuu just needs to increment the file counter by 1 and add the NZB at the end.

It's somewhat more complicated than that unfortunately, for example the current architecture requires knowing all files upfront (including their size) so that the progress can be calculated, or that NZB's output are streamed. Nyuu also supports outputting multiple NZBs per run (so it's not always just one file), and I might've forgotten some other place that could cause conflicts.

But yeah, I get your point.

jrehmer commented 2 years ago

Will admit, I didn't look too closely at all the NZB options, but yes, I see where the complexity comes in especially in that case.