[Queue/PP-Script] PPDir.py - Use a dedicated post-processing directory

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
Tensai
Posts: 6
Joined: 31 Jan 2017, 08:42

[Queue/PP-Script] PPDir.py - Use a dedicated post-processing directory

Post by Tensai » 12 Jun 2018, 09:43

I would like to share my queue/post-processing script I wrote in order to have NZBGet post-processing the downloaded files within a dedicated post-processing directory instead of directly processing them into the final destination directory.

PPDir.py

Post-Processing Directory - An Extension Script for NZBGet

Allows to set a dedicated post-processing directory.

Instead of post-processing the files directly into the final destination directory and extracting the files into an "_unpack" directory within this final destination directory, the whole NZBGet post-processing step will take place within a (temporary) directory in the defined post-processing directory. The files are then moved by this extension script to the final destination directory only after NZBGet has finished the post-processing (e.g. unpack and cleanup).

This prevents issues with partially unpacked files already beeing processed by subsequent scripts/programs watching the final destination directory.

NOTE: If you have other post-processing scripts running, this extension script should be the first post-processing script to run in order to make sure your post-processing scripts will find the files in the final destination directory.

NOTE: This script requires Python to be installed on the system running NZBGet.

Get the script here: https://github.com/Tensai75/PPDir.py

Regards, Tensai

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

Re: [Queue/PP-Script] PPDir.py - Use a dedicated post-processing directory

Post by hugbug » 14 Jun 2018, 18:15

Thanks for sharing.
Interesting approach but isn't it more complex than necessary? Wouldn't moving of files at the end of post-processing achieve the same? A typical solution is to set DestDir into a temporary location and use VideoSort to move files to final destination.

Tensai
Posts: 6
Joined: 31 Jan 2017, 08:42

Re: [Queue/PP-Script] PPDir.py - Use a dedicated post-processing directory

Post by Tensai » 15 Jun 2018, 06:32

hugbug wrote:
14 Jun 2018, 18:15
Thanks for sharing.
Interesting approach but isn't it more complex than necessary? Wouldn't moving of files at the end of post-processing achieve the same? A typical solution is to set DestDir into a temporary location and use VideoSort to move files to final destination.
Thanks for your remark.
I don't think it is more complex than necessary but I needed it because I probably use a different philosophy for post-processing. I am downloading very different types of media: tv-series, movies, ebooks, music files, programs, games... And I want each type to be downloaded in a distinct subfolder within my download folder because I have different external programs which will further process the different types of media. But it is very difficult to automatically distinguish between all these different media types (VideoSort works for tv shows and movies only anyway). This is why I am using categories which I will assign to every NZB file I pass over to NZBGet. To download NZB files I use the NZBDonkey plug-in for Chrome/FF. This plug-in can already set the category for tv-series and movies automatically based on the NZB file name. If the plugin cannot determine the category, the user is prompted to set the category manually. This is very convenient.

So for every media type I have set a category with a distinct destination folder, e.g.:
Movies: /download/movies
TV-Series: /download/tv-series
Music: /download/music

Some of these folders are then watched by other programs to further process the downloaded files. E.g. /download/tv-series is watched by Sickrage (which basically does the same as VideoSort). Music and Ebooks are watched by other programs which move the files to their final place based on meta-tags, etc.

That is why I needed a possibility to avoid NZBGet to directly unpack the files into the categories final destination folder, because some of the external post-processing programs already processed the partially unpacked files in the _unpack folder.

Regards, Tensai

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests