animetosho / Nyuu

Flexible usenet binary posting tool
215 stars 30 forks source link

`token-eval` can't be used in config.json #110

Closed Ravencentric closed 11 months ago

Ravencentric commented 11 months ago

this is what i tried "token-eval": true,

{
" This is a sample config file which can be given to Nyuu using the -C flag ":0,
" See help.txt for an explanation for what each item does ":0,
" Be aware that this file needs to be formatted as JSON. Basically, values you give need to be surrounded by double-quotes with a comma at the end (see below for examples). The only values which don't use quotes are integers and the special values 'true', 'false' and 'null' ":0,

" *** Server Options *** ":0,
"host":               "",
"port":               563,
"ssl":                true,
"ignore-cert":        false,
"user":               "",
"password":           "",
"connections":        20,

" *** Article Options *** ":0,
"article-size":       "700K",
"subject":            "${rand(Math.floor(Math.random()*(30-10)+10))}",
"comment":            "",
"from":               "test@abc.test",
"groups":             "alt.binaries.boneless",
"yenc-name":          "${rand(Math.floor(Math.random()*(20-10)+10))}",

" *** Check Options *** ":0,
"check-connections":  5,
"check-tries":        2,
"check-delay":        "5s",
"check-retry-delay":  "30s",
"check-post-tries":   2,

" *** NZB Options *** ":0,
"out":                "{filename}.nzb",
"overwrite":          false,
"nzb-subject":        "[${filenum}/${files}] - ${filename} yEnc (${part}/${parts}) ${filesize}",

" *** Other Options *** ":0,
"skip-errors":        "all",
"quiet":              false,
"token-eval":         true,

" *** UI Options *** ":0,
"log-time":           true,

" *** Input Files *** ":0,
"subdirs":            "keep",

" More options can be specified; see help.txt for a list with explanations ":0,

" End of config file ":0
}
animetosho commented 11 months ago

It's generally best if you can provide as much info as possible when posting issues, as it minimises what one what one has to guess when trying to identify the issue.

In this case though, you probably need to fix your "out" parameter.

Ravencentric commented 11 months ago

Apologies, here's some test results using the above config after fixing out parameter:

First Test CLI: nyuu -C config-sample.json -o "helck13.nzb" "helck" The tokens did not get evaluated as it should using the config above where I've specified "token-eval": true,

Second Test CLI: nyuu -C config-sample.json --token-eval -o "helck14.nzb" "helck" The tokens in this case got evaluated correctly.

animetosho commented 11 months ago

Thanks for the clarification!