Download
Requires NZBGet 0.4.0 (r149 or newer).
nzbgetpp.pl (03-Jun-2008)
See also: Change Log
Comments [ new ]
- file.$SaveExt not saved in $SaveDir/nzb
- Posted by ReadWrite on Saturday, 22-Mar-2008
hello Dave,
[ reply | link ] to this. Go to [ topic | top ]
#done
Saved $SaveExt: file.$SaveExt to $SaveDir
#expected
Saved $SaveExt: file.$SaveExt to $SaveDir/" dir" before .nzb
I did not check the code to try to understand why.
below, the details of the configuration and log files.
(look at the ##### part in the nzbet.log file)- Re: file.$SaveExt not saved in $SaveDir/nzb
- Posted by Dave on Saturday, 22-Mar-2008
What actually happened is: Saved $SaveExt: file.$SaveExt to $MiscDir
[ reply | link ] to this. Go to [ parent | topic | top ]
Your $SaveDir and $MiscDir point to the same directory and exceptions (e.g. MiscDir) are processed first. There wouldn't have been a problem if there were any extensions in $MiscExt or if $MiscDir were empty. I've added a check that will bypass MiscDir when $MiscExt is empty/undef (there's already a check for an empty MiscDir) and, hopefully, added some clarification to the variable descriptions.
That .gif is nice and detailed, thanks.
...did you run into the 'too much repetion' (too many $'s) message too?- Re: file.$SaveExt not saved in $SaveDir/nzb
- Posted by ReadWrite on Sunday, 23-Mar-2008
.
[ reply | link ] to this. Go to [ parent | OP | topic | top ]
with the version of 22-Mar-2008 (Added $MiscExt check) and the same settings as above, the script runs as expected.
thanks again for the fix and the explanations about $MiscDir !
i'll make a try with $MiscDir='';
i've ran into the 'too much repetition spam alert' yesterday, that's the reason why i made this .gif to be able to post my message.
.- Re: file.$SaveExt not saved in $SaveDir/nzb
- Posted by Dave on Monday, 24-Mar-2008
Sorry about the hassle caused by the "$" repetition, I've disabled it. Allowing an empty first and last line is a bit trickier (a bad design choice, there should be more spacing than there is), you can override it with three spaces (instead of periods). Anyway, thanks again for the feedback.
[ reply | link ] to this. Go to [ parent | OP | topic | top ]
- SaveSub=1 - line #113 modified
- Posted by ReadWrite on Friday, 21-Mar-2008
hello and thank you for your postprocessing script.
[ reply | link ] to this. Go to [ topic | top ]
i could not get it working well when $SaveSub = 1;
(no sub-directory were created)
file : nzbgetpp.pl
#113 original
if ($DownloadDir =~ m!/([^/]+ \d+\-\d+)( dir)?$!i){
#113 modification
if ($NzbFile=~m!/([^/]+) \d+\-\d+( dir)?\.nzb$! or $NzbFile=~m!/([^/]+)( dir)?\.nzb$!){
ReadWrite.- Re: SaveSub=1 - line #113 modified
- Posted by Dave on Friday, 21-Mar-2008
Thanks for the heads up. I had never tested with $SaveSub = 1 and $Rename = 0. The problem was up at line 91 where fetching $NewName had required that $Rename =1.
[ reply | link ] to this. Go to [ parent | topic | top ]
An empty $NewName busted the else statement (line 115), which is a shorthand version of your modified line 113. Line 113 is used to include any 'n-n' in the sub-directory name (its unwanted when renaming files so its excluded from $NewName).- Re: SaveSub=1 - line #113 modified
- Posted by ReadWrite on Saturday, 22-Mar-2008
hello Dave,
[ reply | link ] to this. Go to [ parent | OP | topic | top ]
the last time, i actually copied the line 91 to change the line 113
i installed today the version of 21-Mar-2008
(Untested fix for no sub-directory when $SaveSub = 1 and $Rename = 0.)
the fix works very well,
thank you !
- Re: Download
- Posted by jajaja on Wednesday, 05-Mar-2008
I just tried to download a MUSIC album....
[ reply | link ] to this. Go to [ topic | top ]
There, the renaming strategie doesn't make any sense... The script just saved the first song (renamed) and removed all other songs in that folder...- Re: Download
- Posted by Dave on Thursday, 06-Mar-2008
It would help if you posted enough of a name so that I can find and try downloading it myself. Posting the block of messages for that nzb (nzbgetpp.log) could be even more useful. Do any lines start with [date] (file system messages)? A group of files with the same extension do not get renamed, any renaming of the first file is temporary. Was it a rared album or just a bunch of files?... Looks OK here (note the use of the " dir" flag).
[ reply | link ] to this. Go to [ parent | topic | top ]
Collection passed par check, there were no par check failures.
Processing /home/dave/Download/nzbget/nzb/Artist - Album dir.nzb.
Nzb has directory flag, using: /home/dave/Video/Artist - Album
No rar files to extract
Renamed and saved mp3: 09.mp3, Artist - Album.mp3
Rename would overwrite, disabling and undoing rename.
Restored : 09.mp3
Saved mp3: 02.mp3
[snip]
Saved mp3: 04.mp3
Collection(s) successfully extracted, OK to delete nzb and download directory
Deleted nzb: /home/dave/Download/nzbget/nzb/Artist - Album dir.nzb.queued
Deleted directory: /home/dave/Download/nzbget/dst/Artist - Album dir
Proccessing complete
... Rared albums also OK- Re: Download
- Posted by jajaja on Thursday, 06-Mar-2008
Logfile: (an album, no rars, just mp3s)
[ reply | link ] to this. Go to [ parent | OP | topic | top ]
you see, i don't think it makes sense to but the individual mp3's in the general download folder... why not leave them in the nicely named folder that nzbget created?
Collection passed par check, there were no par check failures.
Processing /home/username/Desktop/Junkie Xl - Booming Back At You (2008).nzb.
Files will be extracted and/or moved to /home/username/Downloads/NZB/usenet
No rar files to extract
Found and added label: 2008
Renamed and saved m3u: 00-junkie_xl-booming_back_at_you-2008.m3u, Junkie Xl - Booming Back At You (2008) 2008.m3u
[snip]
Renamed and saved mp3: 02-junkie_xl-cities_in_dust.mp3, Junkie Xl - Booming Back At You (2008).mp3
Deleted nzb: /home/username/Desktop/Junkie Xl - Booming Back At You (2008).nzb.queued
Deleted directory: /home/username/Downloads/NZB/usenet/Junkie Xl - Booming Back At You (2008)
Proccessing complete- Re: Download
- Posted by jajaja on Thursday, 06-Mar-2008
BTW - the use of the dir flag complicates things. case scenario: firefox automatically downloads nzbs to the desktop (without any interaction), nzbget is set to watch the desktop directory for new nzbs - why would you want to add an extra step where i have to rename the nzb-file?
[ reply | link ] to this. Go to [ parent | OP | topic | top ]- Re: Download
- Posted by Dave on Thursday, 06-Mar-2008
Without the dir flag, sub-directories are all or nothing.* Your rename options are pretty limited if you don't have nzb downloading set for 'save as' ("ask" in Firefox).
[ reply | link ] to this. Go to [ parent | OP | topic | top ]
For the 06-Mar-2008 version I've fixed your single saved file bug, added automatic sub-directories for things like mp3 collections and added an untested all option - always save/extract to a sub-directory.
The single saved file was caused by the parenthesis in the nzb file-name. Until I come up with something better, the script will delete all characters that have special meanings in regular expressions. Thanks for reporting it.
edit
...*Not quit true. Sub-directories will automatically be created when there is more than one file with the same extension and when no rename matches are found, e.g. mp3 albums. It would be nice to add regular expressions so that mp3's could be renamed to a standard format (e.g. nnn - Foo Bar.mp3), but that would be quite a bit more involved than episode/CD renaming.- Re: Download
- Posted by jajaja on Friday, 07-Mar-2008
no thank YOU for all the hard work!
[ reply | link ] to this. Go to [ parent | OP | topic | top ]
however, there's stll quirks i think.
first, what i don't get - why not use the nzbget dir? even if it's temporary - it's nicely named, so why delete it? a subdir in the nzbget dir isn't the most elegant solution...
anyway, downloaded an album as a test, i get this:
A directory "Burial - Untrue 2007" in my download directory (the one nzbget created), inside 12 of the 13 songs, and another directory "Burial - Untrue 2007" containing 1 song...
the log:
Collection passed par check, there were no par check failures.
Processing /home/username/Desktop/Burial - Untrue (2007).nzb.
Special character(s) found and removed
Configuration has sub-directory flag, using: /home/username/Downloads/NZB/usenet/Burial - Untrue 2007
Extracted mp3: 09 Burial - Shell Of Light.mp3
Renamed 09 Burial - Shell Of Light.mp3, Burial - Untrue 2007.mp3
Extracted mp3: 10 Burial - Dog Shelter.mp3
Rename would overwrite, disabling and undoing rename.
Enabling sub-directory, files will be saved to: /home/username/Downloads/NZB/usenet/Burial - Untrue 2007/Burial - Untrue 2007
Restored : 09 Burial - Shell Of Light.mp3
Extracted mp3: 11 Burial - Homeless.mp3
[snip]
Extracted mp3: 08 Burial - Untrue.mp3
Collection(s) successfully extracted and saved.
Deleted nzb: /home/username/Desktop/Burial - Untrue (2007).nzb.queued
Deleted directory: /home/username/Downloads/NZB/usenet/Burial - Untrue (2007)
Proccessing complete- Re: Download
- Posted by Dave on Friday, 07-Mar-2008
Fixed.
[ reply | link ] to this. Go to [ parent | OP | topic | top ]
It looks like your SaveDir is the same as your NZBGet DestDir. In most cases that won't work because the source and destination directories have the same name.
I don't use the NZBGet directories for extracted/saved files because I don't want those files in the NZBGet directory tree and I want to choose weather or not to put them in sub-directories.*
I've made numerous changes in the last couple of days and I wouldn't be surprised if I broke something else in the process.
edit
* More reasons. The " dir" and other flags in the NZBGet directory name are removed from the SaveDir names. NZBGet replaces some nzb file-name characters with underscores in the directory name (e.g. ' > _), nzbgettpp doesn't. SaveDir can be on another machine and makes remote processing possible.
- Re: Download
- Posted by jajaja on Wednesday, 05-Mar-2008
maybe "m3u" as a playlist file should also be added to the save extension list...
[ reply | link ] to this. Go to [ topic | top ]
could you include an option to leave files in the directory created by nzbget, even with renaming? if you have a 2 part movie with an idx and a sub file each + sample + nfo, i think its "neater" to keep them in one directory....
thanks!- Re: Download
- Posted by Dave on Thursday, 06-Mar-2008
That's why the list is in the configuration section, put all extensions you want to save there (I toss m3u).
[ reply | link ] to this. Go to [ parent | topic | top ]
Add " dir" to the nzb file-name to save files to a sub-directory. Foo dir.nzb puts all extracted and saved files in SaveDir/Foo.
The nzbget created directories are considered temporary directories, they are meant to be deleted after you have saved everything you want to keep.