animetosho / Nyuu

Flexible usenet binary posting tool
216 stars 30 forks source link

Overwrite filename - keep original filename in nzb? #73

Open scriptzteam opened 4 years ago

scriptzteam commented 4 years ago

So for example, i have file test.rar, nyuu will upload it to usenet as blabla.someext without renaming on local server, and after upload it will add into nzb the original test.rar filename.

do i need to rewrite filename function? or is there simpler way? thx!

--filename blabla.someext will always write into nzb file blabla.someext and not test.rar

animetosho commented 4 years ago

Assuming you're only uploading a single file:

If you don't mind the filename being inside the yEnc headers, overwrite the subject via --subject. Otherwise, you can use a combination of --filename (change filename) and --nzb-subject (revert back).

scriptzteam commented 4 years ago

Thx much for helping me :)

but now i tried this:

into cmd i added --filename test.test --nzb-subject {value} and uploaded file is changed on usenet so it differs from local server file name, but in nzb there is <file poster="someposter" date="somedate" subject="undefined"> so subject is undefined? why?

edit: forgive me, no sleep :D i put as this now --nzb-subject {filename} and in the nzb is subject test.test but it should be the name of file as on my local server, not that one changed, why is that?

animetosho commented 4 years ago

so subject is undefined? why?

Don't know why you get undefined. Have you overridden any functions or similar?

but it should be the name of file as on my local server, not that one changed, why is that?

--filename overwrites the filename, so yes, that's expected.
You need to specify the original filename in --nzb-subject, e.g. --filename renamed.file --nzb-subject '[{0filenum}/{files}] - "original.name" yEnc ({part}/{parts}) {filesize}'

nonspin commented 4 years ago

Handing this task to nyuu isn't the ideal solution i think.. Because in between original_filename and obfuscated_filename (taskwise) are the par2-creation and the rar-creation .. right ? So (at least that's what i'm doing) dump the filename-pairs somewhere and afterwards edit the .nzb .. find<->replace