animetosho / Nyuu

Flexible usenet binary posting tool
221 stars 32 forks source link

Can't output valid NZB files #37

Closed shillshocked closed 6 years ago

shillshocked commented 6 years ago

Am I doing this wrong? Or do I need to run it a second time?

nyuu -C ~/bin/Nyuu-master/config.json -H Organization="Organization" -t "Title" --out "Title.nzb" -r keep .

The files posted are in a subdirectory.

animetosho commented 6 years ago

What's wrong with it?

fetzerms commented 6 years ago

I often get wrong nzb files, when uploading a single binary file along with a set of par2 files. The result are files that do not contain all the parts (only Subject "[1/9]" is in the nzb, the other stuff isnt) - and/or that do not contain segments at all.

Example:

<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE nzb PUBLIC "-//newzBin//DTD NZB 1.1//EN" "http://www.newzbin.com/DTD/nzb/nzb-1.1.dtd">
<nzb xmlns="http://www.newzbin.com/DTD/2003/nzb">
        <file poster="User &lt;username@somehost&gt;" date="12345" subject="[1/9] - test; yEnc (1/23) 12345">
                <groups>
                        <group>alt.binaries.boneless</group>
                </groups>
                <segments>
                </segments>
        </file>
        <file poster="User &lt;username@somehost&gt;" date="12345" subject="[2/9] - test; yEnc (1/23) 12345">
                <groups>
                        <group>alt.binaries.boneless</group>
                </groups>
                <segments>
                </segments>
        </file>
</nzb>
animetosho commented 6 years ago

\^ I presume this is unrelated to the OP's issue? (if so, please create a separate topic in future otherwise it gets confusing which issue is being referred to, thanks)

Do you get any errors during the upload process? If Nyuu is unable to post anything, it won't write any segments to the NZB.

fetzerms commented 6 years ago

The OP did not state anything about his broken nzb file - hence i dont know if this is related or not. Nyuu did not output any errors for these files. Also I sometimes saw a nzb with segments, but only part [1/x] and the other parts missing. This happens quite often, but I cannot predict when it will.

All my file sets are mostly the same: One big binary file and a set of par2 files.

Just to make sure: If the upload of some given files fail, nyuu should not produce a nzb file at all, right? Or did I get this wrong there?

animetosho commented 6 years ago

Are you able to post the command/settings used and the output Nyuu gives?

Just to make sure: If the upload of some given files fail, nyuu should not produce a nzb file at all, right? Or did I get this wrong there?

Nyuu will list what it's managed to upload in the NZB, so it can definitely spit out an incomplete NZB if the upload process stops for whatever reason.

fetzerms commented 6 years ago

I am using this commad line:

find . \( -name '*.par2' -o -name '*.bin.gpg' \) -print | nyuu -h <server> -u <user> -p <pass> -n 50 -f 'User <test@host.name>' -g alt.binaries.boneless -o backup_"$(date +%Y-%M-%d)"_progress.nzb -i -

After the upload is done, I check, if the .nzb file contains as many file-elements as there are local files. My script runs unattended via a cronjob - unfortunately I cannot see whats wrong with the uploading process, as it works when checking manually.

It seems like ~3/4 of my backups do not get posted properly.

animetosho commented 6 years ago

Consider dumping the output to a log file so you can actually see what's going on. Perhaps append something like -T 2>backup_"$(date +%Y-%M-%d)"_progress.log to your command, and check a log file of a failed NZB.

nonspin commented 6 years ago

Setting in config -> "subject": "{filename}" which is valid i suppose, would post fine, but the created nzb is invalid. the 'subject' needs 2 sets of quotes -> " and &quot; The &quot; never makes it if --subject is read from cli

animetosho commented 6 years ago

Sorry, I don't really understand what you're trying to say. Are you saying that if you put "subject": "{filename}" in the config file, or specify --subject "{filename" from the CLI, no &quot; is placed in the NZB? If so, that's expected, because the quotes have special meaning in JSON/shell; to put in quotes, you need to escape them (i.e. use \").

nonspin commented 6 years ago

.. Let me open a ticket - i've already tracked it down

animetosho commented 6 years ago

I'm closing this as I haven't received any further clarifications on the remaining issues. If it is still a problem, please feel free to re-open this issue.