Closed Ravencentric closed 1 year ago
Are the double quotes around {filename} important?
It is the suggested subject format in the yEnc spec. The double quotes helps with filenames containing spaces (like in your example).
Passing '[{0filenum}/{files}] - "{filename}" yEnc ({part}/{parts}) {filesize}' gets me [1/7] - helck - Copy.mkv yEnc (1/483) 346054287
I am not reproducing this. Are you sure that, however you're checking this, the viewer isn't stripping the quotes out?
If so, if you could provide a full command that can reproduce your issue, I can try to do so myself.
Test 1: http://al.howardknight.net/?STYPE=msgid&MSGI=%3CFdFtLlEvQzSbVzEpQiBpCcSb-1691582951579@nyuu%3E
CLI: nyuu -C account.json --subject "[{0filenum}/{files}] - "{filename}" yEnc ({part}/{parts}) {filesize}" --nzb-subject "[{0filenum}/{files}] - "{filename}" yEnc ({part}/{parts}) {filesize}" --yenc-name "[{0filenum}/{files}] - "{filename}" yEnc ({part}/{parts}) {filesize}" -o "helck - Copy.nzb" "helck - Copy"
Inside the NZB file itself: <file poster="zonYWuNFs2@jahhk.ZXv" date="1691582951" subject="[1/7] - helck - Copy.mkv yEnc (1/483) 346054287">
Test 2: http://al.howardknight.net/?STYPE=msgid&MSGI=%3CPpIuSiLsJmRlUsQbKuViHyBp-1691583252239@nyuu%3E
CLI: nyuu -C account.json --subject "[{0filenum}/{files}] - {filename} yEnc ({part}/{parts}) {filesize}" --nzb-subject "[{0filenum}/{files}] - {file name} yEnc ({part}/{parts}) {filesize}" --yenc-name "[{0filenum}/{files}] - {filename} yEnc ({part}/{parts}) {filesize}" -o "helck - Copy2.nzb" "helck - Copy"
Inside the NZB file itself: <file poster="BWrLgg1b37@jtTpr.I7H" date="1691583252" subject="[1/7] - helck - Copy.mkv yEnc (1/483) 346054287">
If you're running that verbatim from a bash shell or similar, you may need to escape the double quotes (or enclose the subject in single quotes).
$ echo "abc "def" ghi"
abc def ghi
$ echo 'abc "def" ghi'
abc "def" ghi
$ echo "abc \"def\" ghi"
abc "def" ghi
I'm using the commands stated in my post verbatim in Windows Terminal. Echo behaves differently on Windows so I can't test it via echo
> echo '[{0filenum}/{files}] - "{filename}" yEnc ({part}/{parts}) {filesize}'
'[{0filenum}/{files}] - "{filename}" yEnc ({part}/{parts}) {filesize}'
> echo [{0filenum}/{files}] - "{filename}" yEnc ({part}/{parts}) {filesize}
[{0filenum}/{files}] - "{filename}" yEnc ({part}/{parts}) {filesize}
> echo "[{0filenum}/{files}] - "{filename}" yEnc ({part}/{parts}) {filesize}"
"[{0filenum}/{files}] - "{filename}" yEnc ({part}/{parts}) {filesize}"
> echo "[{0filenum}/{files}] - \"{filename}\" yEnc ({part}/{parts}) {filesize}"
"[{0filenum}/{files}] - \"{filename}\" yEnc ({part}/{parts}) {filesize}"
Test 3: Using \
to escape
http://al.howardknight.net/?STYPE=msgid&MSGI=%3CKcXwMzCrNiCyGdAwKyHpMbLy-1691584952793@nyuu%3E
CLI: nyuu -C account.json --subject "[{0filenum}/{files}] - \"{filename}\" yEnc ({part}/{parts}) {filesize}" --nzb-subject "[{0filenum}/{files}] - \"{filename}\" yEnc ({part}/{parts}) {filesize}" --yenc-name "[{0filenum}/{files}] - \"{filename}\" yEnc ({part}/{parts}) {filesize}" -o "helck - Copy3.nzb" "helck - Copy"
Inside the NZB file itself: <file poster="phB31AKX5k@WYjhO.Ubh" date="1691584952" subject="[1/7] - "helck - Copy.mkv" yEnc (1/483) 346054287">
Test 4: Using surrounding the parameter in single quotes with {filename}
in double quotes
nyuu -C account.json --subject '[{0filenum}/{files}] - "{filename}" yEnc ({part}/{parts}) {filesize}' --nzb-subject '[{0filenum}/{files}] - "{filename}" yEnc ({part}/{parts}) {filesize}' --yenc-name '[{0filenum}/{files}] - "{filename}" yEnc ({part}/{parts}) {filesize}' -o "helck - Copy4.nzb" "helck - Copy"
[2023-08-09 18:19:17.355][ERR ] Error: ENOENT: no such file or directory, stat 'C:\Users\user\Downloads\nyuu-master-win32.7z\{filename}'
Your test 3 looks correct.
On Windows, quotes can be escaped with \ or doubling the quotes (""
or \"
-> ").
Hmm I see, but what about the --nzb-subject
?
Since that's resulting in <file poster="phB31AKX5k@WYjhO.Ubh" date="1691584952" subject="[1/7] - "helck - Copy.mkv" yEnc (1/483) 346054287">
Is this correct and how it's supposed to be?
Yes.
Read this if you're confused: https://stackoverflow.com/questions/1091945/what-characters-do-i-need-to-escape-in-xml-documents
Okay, I understand now. Thank you for being patient with me!
This isn't really an issue, just a question since I'm trying to understand it
The default subject is
{comment} [{0filenum}/{files}] - "{filename}" yEnc ({part}/{parts}) {filesize} {comment2}
according tohelp-full.txt
Are the double quotes around
{filename}
important? From what I've tested it's making no difference. My filename washelck - Copy.mkv
.Passing
'[{0filenum}/{files}] - "{filename}" yEnc ({part}/{parts}) {filesize}'
gets me[1/7] - helck - Copy.mkv yEnc (1/483) 346054287
Passing"[{0filenum}/{files}] - {filename} yEnc ({part}/{parts}) {filesize}"
also gets me[1/7] - helck - Copy.mkv yEnc (1/483) 346054287
Am I missing something? or not understanding it?