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

Share your scripts or request scripts with specific features.
Forum rules
Please keep the forum clean - one topic per script. Questions not related to a specific script should be posted in Support forum.
Post Reply
SunMar
Posts: 3
Joined: 02 Jan 2016, 14:21

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

Post by SunMar » 02 Jan 2016, 19:42

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 :).
Attachments
Move.py
(4.68 KiB) Downloaded 1250 times
Last edited by SunMar on 02 Jan 2016, 20:39, edited 2 times in total.

hugbug
Developer & Admin
Posts: 7645
Joined: 09 Sep 2008, 11:58
Location: Germany

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

Post by hugbug » 02 Jan 2016, 19:50

Nice script and thanks for sharing it.

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

SunMar
Posts: 3
Joined: 02 Jan 2016, 14:21

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

Post by SunMar » 02 Jan 2016, 19:58

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".

hugbug
Developer & Admin
Posts: 7645
Joined: 09 Sep 2008, 11:58
Location: Germany

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

Post by hugbug » 02 Jan 2016, 20:04

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?

SunMar
Posts: 3
Joined: 02 Jan 2016, 14:21

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

Post by SunMar » 02 Jan 2016, 20:18

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.

ceramic
Posts: 2
Joined: 14 Apr 2016, 14:57

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

Post by ceramic » 14 Apr 2016, 18:12

Oooooh, I just posted a new thread requesting something to do this - thanks.

Lozew1
Posts: 2
Joined: 19 Jan 2017, 19:56

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

Post by Lozew1 » 19 Jan 2017, 19:59

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!

hugbug
Developer & Admin
Posts: 7645
Joined: 09 Sep 2008, 11:58
Location: Germany

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

Post by hugbug » 19 Jan 2017, 20:06

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.

Lozew1
Posts: 2
Joined: 19 Jan 2017, 19:56

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

Post by Lozew1 » 19 Jan 2017, 20:20

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!

sean0
Posts: 2
Joined: 18 Aug 2018, 09:35

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

Post by sean0 » 08 Jan 2019, 08:02

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.

Post Reply

Who is online

Users browsing this forum: No registered users and 48 guests