animetosho / Nyuu

Flexible usenet binary posting tool
221 stars 32 forks source link

creating what appears to be nzbs that are rejected by some apps #112

Closed sjpotter closed 1 year ago

sjpotter commented 1 year ago

I downloaded the latest release off of github and it appears to be creating invalid nzbs

version:

nyuu  --version
0.4.1

I run it as

nyuu --connect-retries 100 --reconnect-delay 30s  -h <snip> -u <snip> -p <snip> -n 40 --filename "{basename}" -f <snip> -g <snip> -k 10 -o <snip> --minify --nzb-password <snip> -r keep <dir snipped>

what I end up with is an nzb that looks like

<ns0:nzb xmlns:ns0="http://www.newzbin.com/DTD/2003/nzb">
        <head>
                <meta type="password">snip/meta>
        </head>
        <ns0:head>
                <ns0:meta type="password">snip</ns0:meta>
        </ns0:head>
        <ns0:file poster="snip" date="snip" subject="snip">
                <ns0:groups>
                        <ns0:group>snip</ns0:group>
                </ns0:groups>
                <ns0:segments>
                        <ns0:segment bytes="739527" number="1">snip@nyuu</ns0:segment>
                </ns0:segments>
        </ns0:file>
</ns0:nzb>

now the ns0: prefix isn't invalid xml, but it does seem to cause it to fail in apps (say nzbget) that don't expect it and expect just a plain tag. if I run it through with a simple sed/vi search and replace (%s/ns0://g) its usable.

sabnzbd also doesn't specify using a namespace tag: https://sabnzbd.org/wiki/extra/nzb-spec

also note that the head tag was output twice, once with ns0: once without)

Is it possible to at least have a cmd line option to control this?

animetosho commented 1 year ago

That's awfully weird. The text that gets inserted into the NZB is largely hardcoded and there's no namespaces in sight.

Are you using some tool that could be inserting the namespace? I note that --minify is specified, and you don't get pretty printed output like you show above.

sjpotter commented 1 year ago

argh. you're right. I had a python tool I wrote to insert passwords and compress. that's what's doing it. sorry. looked at original source and its right.

animetosho commented 1 year ago

If it helps, --nzb-compress can be used for compression (password insertion already done via --nzb-password), which might remove the need for an external script.