Unrar and post-processing script (New! - March 13')

Discussion of Transmission that doesn't fit in the other categories
OmerBA
Posts: 1
Joined: Sun Mar 03, 2013 7:25 pm

Unrar and post-processing script (New! - March 13')

Postby OmerBA » Sat Mar 09, 2013 4:14 pm

Hi!

I've written a script for post-processing transmission torrents based on their type (Movies, TV Shows, Music, Apps.)
I use it together with couchpotato/sickbeard/headphones to fully automate content downloads.

The script will extract files and sort/move them to the pre-configured folders accordigly!

link - https://github.com/omerbenamram/py-expander

To use - just set it in transmission's settings.json as post-processing script.

make sure the python path in the shebang line is correct!
and also that the file is formatted as UNIX/Win accordingly - otherwise Unix might not be able to process the shebang line.

all environmental variables - such as destination folders, are at the config.py file.

pull requests are always welcome :D

Cheers!

Hisma
Posts: 2
Joined: Sun Mar 24, 2013 9:37 am

Re: Unrar and post-processing script (New! - March 13')

Postby Hisma » Sun Mar 24, 2013 9:40 am

Hey!

Just signed up on this site so I can say thank you for this script.

I can confirm it works on freenas 8.3.1.

Great work, keep it up!

Hisma
Posts: 2
Joined: Sun Mar 24, 2013 9:37 am

Re: Unrar and post-processing script (New! - March 13')

Postby Hisma » Mon Apr 01, 2013 8:14 am

Hi again...

One thing I would like to add to this script is the ability to change permissions of the directory the script creates after it unrars the files.

The directory gets created with local permissions, but if I want to modify the directory as an outside guest (such as my windows machine), I have to chmod it.

How much work would it be to add a "chmod 777" for the directory that gets created at the end of the script?

Liquid80
Posts: 4
Joined: Sun Apr 07, 2013 5:09 pm

Re: Unrar and post-processing script (New! - March 13')

Postby Liquid80 » Tue Apr 09, 2013 4:53 pm

Hey guys, I'm brand new to this stuff and I would love to have this function with my setup. Could you give me a little help?
Thanks in advance!!!!
BTW I'm on a mac

I changed the destination folders but I'm not sure what else needs to be done to get this script to work. I ran it through Terminal and got:

Traceback (most recent call last):
File "/Users/User1/Apps/py-expander-master/src/torrent_handler.py", line 18, in <module>
import config
File "/Users/User1/Apps/py-expander-master/src/config.py", line 49, in <module>
EXECUTABLE = _find_executable('7z') # Currently only 7z is supported.
File "/Users/User1/Apps/py-expander-master/src/config.py", line 46, in _find_executable
raise Exception(filename + 'not found or is not in system PATH')
Exception: 7znot found or is not in system PATH

x190
Posts: 4926
Joined: Sun Nov 30, 2008 4:59 am

Re: Unrar and post-processing script (New! - March 13')

Postby x190 » Wed Apr 10, 2013 3:40 am

Maybe you need the following application.

http://osxdaily.com/2010/12/13/open-7z-files-on-a-mac/
-------------------------------------------------

Liquid80
Posts: 4
Joined: Sun Apr 07, 2013 5:09 pm

Re: Unrar and post-processing script (New! - March 13')

Postby Liquid80 » Wed Apr 10, 2013 4:47 am

x190 wrote:Maybe you need the following application.

http://osxdaily.com/2010/12/13/open-7z-files-on-a-mac/


I downloaded it but not sure if I need to change any python code. Ran through terminal just to check but no luck. Same result as before. Any other ideas?

x190
Posts: 4926
Joined: Sun Nov 30, 2008 4:59 am

Re: Unrar and post-processing script (New! - March 13')

Postby x190 » Wed Apr 10, 2013 7:33 am

# Currently only 7z is supported.


Other scripts are available. Search the forum or startpage. 7-zip would need to be self-compiled on a Mac. There is 7zX.dmg for Mac but it likely won't work as the script seems to need to find an exec file in one of the '/bin' $PATH locations plus it's not exactly 7-zip anyway. It'd be a long 'long shot' but you could copy (and rename [-X]) the exec file from 7zX.app/Contents/MacOS into /bin and see if that would work.

http://www.macupdate.com/app/mac/20526/7zx

Also, the shebang line is wrong for a Mac. You would need something like:

#!/System/Library/Frameworks/Python.framework/Versions/2.6/Python [10.6]

More to the point, you likely need to find/write a Mac-specific shell/Applescript/Automator script.

viewtopic.php?f=3&t=1328#p57259
viewtopic.php?t=10364 (needs transmission-remote which X-code can build)
-------------------------------------------------

Liquid80
Posts: 4
Joined: Sun Apr 07, 2013 5:09 pm

Re: Unrar and post-processing script (New! - March 13')

Postby Liquid80 » Wed Apr 10, 2013 9:00 am

well, i'm simply not knowledgable enough to get this to work on mac. thanks for trying to help x190.

wasykes
Posts: 1
Joined: Tue Apr 01, 2014 9:14 pm

Re: Unrar and post-processing script (New! - March 13')

Postby wasykes » Tue Apr 01, 2014 9:18 pm

I too would love to have this running on my synology nas, but really am confused by the first hurdle of trying to install...

If somebody could provide some notes for Dummys on how to install, would be much appreciated.


Return to “General”