Page 1 of 1

[PP-Script] Move download directory to a new destination

Posted: 02 Jan 2016, 19:42
by SunMar
Today when setting up NZBGet I ran into the issue that NZBGet unpacks a download in a temporary _unpack directory inside the destination folder. My destination directory was monitored however by Plex, which would open the file before it was unpacked, locking it and subsequently causing a failure in NZBGet when it tried to move the file after unpacking to its final destination. Since I couldn't find an option in NZBGet to have it unpack in the intermediate directory I took the Flatten files PP script as an example and wrote a new script that can move a download to a new location after unpacking. Attached it here for anyone who has the same issue and feedback is also appreciated :).

Re: [PP-Script] Move download directory to a new destination

Posted: 02 Jan 2016, 19:50
by hugbug
Nice script and thanks for sharing it.

In your particular case you could add "_unpack" to .plexignore.

Re: [PP-Script] Move download directory to a new destination

Posted: 02 Jan 2016, 19:58
by SunMar
Unfortunately .plexignore doesn't function properly, it's very buggy, especially when it comes to ignoring directories. I've tried adding _unpack and some variations of it like */_unpack/* to a .plexignore file in my root directory but none of those worked, Plex still locked up the files in _unpack. If you know the proper .plexignore configuration to make it work I'd love to hear it :).

Note that I just noticed a bug already and fixed it :oops:. [NZB] DIRECTORY= was the destination root instead of "destination/dirname".

Re: [PP-Script] Move download directory to a new destination

Posted: 02 Jan 2016, 20:04
by hugbug
Then you know better than me. I don't use plex; just read somewhere about plexignore, didn't knew it doesn't work properly.
May be you should report the bug to them BTW?

Re: [PP-Script] Move download directory to a new destination

Posted: 02 Jan 2016, 20:18
by SunMar
There are already bug reports for the .plexignore issues, some of them a couple of years old. Lately they have been starting to fix them though so hopefully it'll soon be fixed but I didn't want to wait for that :). It's really nice that NZBGet is so extensible.

Re: [PP-Script] Move download directory to a new destination

Posted: 14 Apr 2016, 18:12
by ceramic
Oooooh, I just posted a new thread requesting something to do this - thanks.

Re: [PP-Script] Move download directory to a new destination

Posted: 19 Jan 2017, 19:59
by Lozew1
hi
im gettin this error after server reinstall :( , was working fine..

info Thu Jan 19 2017 21:41:36 Collection TXXXX-DRONES added to history
error Thu Jan 19 2017 21:41:36 Post-process-script Move.py for TXXXX-DRONES failed (terminated with unknown status)
info Thu Jan 19 2017 21:41:36 Move: SyntaxError: invalid syntax
info Thu Jan 19 2017 21:41:36 Move: ^
info Thu Jan 19 2017 21:41:36 Move: print "This script can only be called from NZBGet (11.0 or later)."
info Thu Jan 19 2017 21:41:36 Move: File "C:\Users\Zaewr\Desktop\nzb\scripts\Move.py", line 40

and i have py3.4 and 2.7 installed , tried with one of them.. ,
thanks!

Re: [PP-Script] Move download directory to a new destination

Posted: 19 Jan 2017, 20:06
by hugbug
This script (like most others) doesn't work with Python3. Either remove Python3 and install Python2 only and make sure file association in registry for .py-files is correct. Or use option ShellOverride in NZBGet to specify that .py-files must be executed by your python2.

Re: [PP-Script] Move download directory to a new destination

Posted: 19 Jan 2017, 20:20
by Lozew1
hugbug wrote:This script (like most others) doesn't work with Python3. Either remove Python3 and install Python2 only and make sure file association in registry for .py-files is correct. Or use option ShellOverride in NZBGet to specify that .py-files must be executed by your python2.
ok thanks!

Re: [PP-Script] Move download directory to a new destination

Posted: 08 Jan 2019, 08:02
by sean0
Thanks for the script. So I can set a separate completed folder and So if append category is set to yes, will it use the paths I set in each category ? The category paths should be where I want the final copy to go to.