OS X + HandBrakeCLI + Python = convert, iTunes and e-mail
-
- Newbie
- Posts: 6
- Joined: September 9th, 2010, 9:59 am
Re: OS X + HandBrakeCLI + Python = convert, iTunes and e-mail
One suggestion: a processing directory to improve performance with systems that have multiple disks. The output file is saved there, then moved to final directory upon successful completion.
-
- Newbie
- Posts: 30
- Joined: February 28th, 2010, 8:37 pm
- Contact:
Re: OS X + HandBrakeCLI + Python = convert, iTunes and e-mail
All of my files are downloaded to a general temp drive. Sabnzbd then moves the files to my 4TB raid 0 media center. That's where all the processing is done.macfloripa wrote: One suggestion: a processing directory to improve performance with systems that have multiple disks. The output file is saved there, then moved to final directory upon successful completion.
I do all of this with the sabnzbd catergory folder setting.
That's all I've needed.
Last edited by johnnytk36 on September 10th, 2010, 7:57 pm, edited 1 time in total.
-
- Newbie
- Posts: 6
- Joined: September 9th, 2010, 9:59 am
Re: OS X + HandBrakeCLI + Python = convert, iTunes and e-mail
We have 2 types of processing going on here:
1) sabnzbd - download and unpack
and
2) handbrake
Based on the sabnzdb documentation it looks like user scripts are run after completed jobs are moved to the final directory. So a temp file would only help with downloading and unpacking.
To improve I/O performance I would like have handbrake use a temp directory for the output file (on a separate files system).
handbake -i filesystem_1/input_flle -o filesystem_2/outputfile
then move the outputfile to the sabnzbd final dir
1) sabnzbd - download and unpack
and
2) handbrake
Based on the sabnzdb documentation it looks like user scripts are run after completed jobs are moved to the final directory. So a temp file would only help with downloading and unpacking.
To improve I/O performance I would like have handbrake use a temp directory for the output file (on a separate files system).
handbake -i filesystem_1/input_flle -o filesystem_2/outputfile
then move the outputfile to the sabnzbd final dir
-
- Newbie
- Posts: 30
- Joined: February 28th, 2010, 8:37 pm
- Contact:
Re: OS X + HandBrakeCLI + Python = convert, iTunes and e-mail
ah, i see. I dont need that as my 4 drive raid zero is more than a beast to handle it all.
Its defiantly possible. I won't be doing it anytime soon.
This link will help you with the paths that are passed to the script.
http://wiki.sabnzbd.org/user-scripts
Its defiantly possible. I won't be doing it anytime soon.
This link will help you with the paths that are passed to the script.
http://wiki.sabnzbd.org/user-scripts
Re: OS X + HandBrakeCLI + Python = convert, iTunes and e-mail
Hi, I have a failure return under OSX:
/usr/bin/python: can't find '__main__.py' in ''
ant idea?
thanks
/usr/bin/python: can't find '__main__.py' in ''
ant idea?
thanks
-
- Newbie
- Posts: 1
- Joined: February 21st, 2011, 2:21 pm
Re: OS X + HandBrakeCLI + Python = convert, iTunes and e-mail
I've been trying to get this to work for several hours and have made it through most of the errors on my own so far. Now I'm down to a Errno 13 issue I can't seem to figure out. here's the error I'm receiving:
I've set the permissions for subprocess.py and the nachos_to_handbrake.py files to chmod 777 and +X... completely stuck fellas, anyone please help me out?
--SKY
Code: Select all
[ 2011-02-21 @ 13:19:27 ] Final Directory : /Users/Brooks/NZB/complete/TV/Two.And.A.Half.Men.S01E15.WS.DVDRip.XviD-SAiNTS.3
[ 2011-02-21 @ 13:19:27 ] NZB Filename : Two.And.A.Half.Men.S01E15.WS.DVDRip.XviD-SAiNTS.nzb
[ 2011-02-21 @ 13:19:27 ] Job Name : Two.And.A.Half.Men.S01E15.WS.DVDRip.XviD-SAiNTS
[ 2011-02-21 @ 13:19:27 ] NewzBin NZB ID :
[ 2011-02-21 @ 13:19:27 ] NewzBin Category : tv
[ 2011-02-21 @ 13:19:27 ] Usenet Category : alt.binaries.multimedia
[ 2011-02-21 @ 13:19:27 ] File Types : ['*.avi', '*.mkv']
[ 2011-02-21 @ 13:19:27 ] TV Format : ^(?P<show>.*) - (?P<season_number>\d+)x(?P<episode_number>\d+) - (?P<episode_ID>.*)$
[ 2011-02-21 @ 13:19:27 ] Output Directory : /Users/Brooks/NZB/complete/TV/Two.And.A.Half.Men.S01E15.WS.DVDRip.XviD-SAiNTS.3
[ 2011-02-21 @ 13:19:27 ] Output Prefix :
[ 2011-02-21 @ 13:19:27 ] Output Postfix :
[ 2011-02-21 @ 13:19:27 ] Output Extension : mp4
[ 2011-02-21 @ 13:19:27 ] Handbrake Path : /Users/Brooks/Terminal/HandBrake
[ 2011-02-21 @ 13:19:27 ] Handbrake Preset : AppleTV 2
[ 2011-02-21 @ 13:19:27 ] Handbrake Verbose : False
[ 2011-02-21 @ 13:19:27 ] Processsing file type *.avi
[ 2011-02-21 @ 13:19:27 ] /Users/Brooks/NZB/complete/TV/Two.And.A.Half.Men.S01E15.WS.DVDRip.XviD-SAiNTS.3/Two.And.A.Half.Men.S01E15.WS.DVDRip.XviD-SAiNTS.avi
[ 2011-02-21 @ 13:19:27 ] encoding : /Users/Brooks/NZB/complete/TV/Two.And.A.Half.Men.S01E15.WS.DVDRip.XviD-SAiNTS.3/Two.And.A.Half.Men.S01E15.WS.DVDRip.XviD-SAiNTS_processing.mp4
Traceback (most recent call last):
File "/Users/Brooks/terminal/sick-beard/autoprocesstv/nachos_to_handbrake.py", line 131, in <module>
p = subprocess.Popen( [ HANDBRAKE_PATH, '-i', input_file, '-o', output_file_processing, '--preset=' + HANDBRAKE_PRESET ], stdout = ( None if HANDBRAKE_COMMAND_OUTPUT else subprocess.PIPE ), stderr = ( None if HANDBRAKE_COMMAND_OUTPUT else subprocess.STDOUT ) )
File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/subprocess.py", line 595, in __init__
errread, errwrite)
File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/subprocess.py", line 1106, in _execute_child
raise child_exception
OSError: [Errno 13] Permission denied
--SKY
-
- Jr. Member
- Posts: 59
- Joined: March 2nd, 2009, 10:58 am
- Contact:
Re: OS X + HandBrakeCLI + Python = convert, iTunes and e-mai
I have not really had time to work on this in the last year and I'm finally getting back into it. I made this site to store stuff, details and the file.
https://sites.google.com/site/imthenach ... ing-script
If y'all could post your comments/problems there I can try to get them fixed.
https://sites.google.com/site/imthenach ... ing-script
If y'all could post your comments/problems there I can try to get them fixed.
-
- Jr. Member
- Posts: 59
- Joined: March 2nd, 2009, 10:58 am
- Contact:
Re: OS X + HandBrakeCLI + Python = convert, iTunes and e-mai
Are you still having problem skyhawk326?
skyhawk326 wrote:I've been trying to get this to work for several hours and have made it through most of the errors on my own so far. Now I'm down to a Errno 13 issue I can't seem to figure out. here's the error I'm receiving:
I've set the permissions for subprocess.py and the nachos_to_handbrake.py files to chmod 777 and +X... completely stuck fellas, anyone please help me out?Code: Select all
[ 2011-02-21 @ 13:19:27 ] Final Directory : /Users/Brooks/NZB/complete/TV/Two.And.A.Half.Men.S01E15.WS.DVDRip.XviD-SAiNTS.3 [ 2011-02-21 @ 13:19:27 ] NZB Filename : Two.And.A.Half.Men.S01E15.WS.DVDRip.XviD-SAiNTS.nzb [ 2011-02-21 @ 13:19:27 ] Job Name : Two.And.A.Half.Men.S01E15.WS.DVDRip.XviD-SAiNTS [ 2011-02-21 @ 13:19:27 ] NewzBin NZB ID : [ 2011-02-21 @ 13:19:27 ] NewzBin Category : tv [ 2011-02-21 @ 13:19:27 ] Usenet Category : alt.binaries.multimedia [ 2011-02-21 @ 13:19:27 ] File Types : ['*.avi', '*.mkv'] [ 2011-02-21 @ 13:19:27 ] TV Format : ^(?P<show>.*) - (?P<season_number>\d+)x(?P<episode_number>\d+) - (?P<episode_ID>.*)$ [ 2011-02-21 @ 13:19:27 ] Output Directory : /Users/Brooks/NZB/complete/TV/Two.And.A.Half.Men.S01E15.WS.DVDRip.XviD-SAiNTS.3 [ 2011-02-21 @ 13:19:27 ] Output Prefix : [ 2011-02-21 @ 13:19:27 ] Output Postfix : [ 2011-02-21 @ 13:19:27 ] Output Extension : mp4 [ 2011-02-21 @ 13:19:27 ] Handbrake Path : /Users/Brooks/Terminal/HandBrake [ 2011-02-21 @ 13:19:27 ] Handbrake Preset : AppleTV 2 [ 2011-02-21 @ 13:19:27 ] Handbrake Verbose : False [ 2011-02-21 @ 13:19:27 ] Processsing file type *.avi [ 2011-02-21 @ 13:19:27 ] /Users/Brooks/NZB/complete/TV/Two.And.A.Half.Men.S01E15.WS.DVDRip.XviD-SAiNTS.3/Two.And.A.Half.Men.S01E15.WS.DVDRip.XviD-SAiNTS.avi [ 2011-02-21 @ 13:19:27 ] encoding : /Users/Brooks/NZB/complete/TV/Two.And.A.Half.Men.S01E15.WS.DVDRip.XviD-SAiNTS.3/Two.And.A.Half.Men.S01E15.WS.DVDRip.XviD-SAiNTS_processing.mp4 Traceback (most recent call last): File "/Users/Brooks/terminal/sick-beard/autoprocesstv/nachos_to_handbrake.py", line 131, in <module> p = subprocess.Popen( [ HANDBRAKE_PATH, '-i', input_file, '-o', output_file_processing, '--preset=' + HANDBRAKE_PRESET ], stdout = ( None if HANDBRAKE_COMMAND_OUTPUT else subprocess.PIPE ), stderr = ( None if HANDBRAKE_COMMAND_OUTPUT else subprocess.STDOUT ) ) File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/subprocess.py", line 595, in __init__ errread, errwrite) File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/subprocess.py", line 1106, in _execute_child raise child_exception OSError: [Errno 13] Permission denied
--SKY
Re: OS X + HandBrakeCLI + Python = convert, iTunes and e-mai
Hey, not sure if you're still developing this code. A lot of the osx Apple TV2 scripts seem to have died out. I'm having the same problem as the guy above
Code: Select all
[ 2012-01-02 @ 09:09:03 ] NZB ID :
[ 2012-01-02 @ 09:09:03 ] Category : sickbeard
[ 2012-01-02 @ 09:09:03 ] Final directory : /Usenet Downloads/Sickbeard/Cheers - 1x01 - Give Me a Ring Sometime
[ 2012-01-02 @ 09:09:03 ] Output directory : /Usenet Downloads/Sickbeard/Cheers - 1x01 - Give Me a Ring Sometime
[ 2012-01-02 @ 09:09:03 ] OS X Lion? : True
[ 2012-01-02 @ 09:09:03 ] Date/Time Format : [ %Y-%m-%d @ %H:%M:%S ]
[ 2012-01-02 @ 09:09:03 ] Separator : :
[ 2012-01-02 @ 09:09:03 ] Print Config : True
[ 2012-01-02 @ 09:09:03 ] File types : ['*.avi', '*.mkv']
[ 2012-01-02 @ 09:09:03 ] Output File prefix :
[ 2012-01-02 @ 09:09:03 ] Output File postfix :
[ 2012-01-02 @ 09:09:03 ] Output File extension : m4v
[ 2012-01-02 @ 09:09:03 ] Delete original : False
[ 2012-01-02 @ 09:09:03 ] Handbrake path : /Users/iveoles/Documents/Scripts
[ 2012-01-02 @ 09:09:03 ] Handbrake Pre-Preset Paramaters : False
[ 2012-01-02 @ 09:09:03 ] Handbrake Post-Preset Paramaters : False
[ 2012-01-02 @ 09:09:03 ] Handbrake preset : AppleTV 2
[ 2012-01-02 @ 09:09:03 ] Handbrake use all audio tracks : True
[ 2012-01-02 @ 09:09:03 ] Print handbrake output : False
[ 2012-01-02 @ 09:09:03 ] Post processing : False
[ 2012-01-02 @ 09:09:03 ] Import to iTunes : True
[ 2012-01-02 @ 09:09:03 ] Delete after import to iTunes : True
[ 2012-01-02 @ 09:09:03 ] Append output : False
[ 2012-01-02 @ 09:09:03 ] Processing file type : *.avi
Traceback (most recent call last):
File "/Users/iveoles/Documents/Scripts/handbrake.py", line 239, in <module>
handbrake_command.append( "--audio=" + get_audio_track_list( input_file ) )
File "/Users/iveoles/Documents/Scripts/handbrake.py", line 89, in get_audio_track_list
p = subprocess.Popen( handbrake_command, stdout = stdout, stderr = stderr )
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 672, in __init__
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 1202, in _execute_child
OSError: [Errno 13] Permission denied
-
- Jr. Member
- Posts: 59
- Joined: March 2nd, 2009, 10:58 am
- Contact:
Re: OS X + HandBrakeCLI + Python = convert, iTunes and e-mai
Humm. Got a hectic week this week but I'll look into it this weekend.
Does it work if you use the iPhone 4 preset?
HANDBRAKE_PRESET = "iPhone 4"
OUTPUT_EXTENSION = "mp4"
Does it work if you use the iPhone 4 preset?
HANDBRAKE_PRESET = "iPhone 4"
OUTPUT_EXTENSION = "mp4"
-
- Jr. Member
- Posts: 59
- Joined: March 2nd, 2009, 10:58 am
- Contact:
Re: OS X + HandBrakeCLI + Python = convert, iTunes and e-mai
You guys still having problems? Contact me at the e-mail link at the bottom of this site: https://sites.google.com/site/imthenach ... ing-script.
Re: OS X + HandBrakeCLI + Python = convert, iTunes and e-mai
I'm currently facing the same problem -- below are Sabnzbd log entries (replaced private directories by ***):
HANDBRAKE_COMMAND_OUTPUT = True
IMPORT_TO_ITUNES = False
HANDBRAKE_COMMAND_OUTPUT = False
IMPORT_TO_ITUNES = True
I've set file and directory permissions to 775 on the Python directory. The handbrake.py script has executable permissions.
Any ideas on this issue? Thnx in advance
HANDBRAKE_COMMAND_OUTPUT = True
IMPORT_TO_ITUNES = False
Code: Select all
[ 2012-04-29 @ 17:14:28 ] NZB ID :
[ 2012-04-29 @ 17:14:28 ] Category : movies
[ 2012-04-29 @ 17:14:28 ] Final directory : ***
[ 2012-04-29 @ 17:14:28 ] Output directory : ***
[ 2012-04-29 @ 17:14:28 ] Processing file type : *.avi
[ 2012-04-29 @ 17:14:28 ] Processing file type : *.mkv
Traceback (most recent call last):
File "***/handbrake.py", line 239, in <module>
handbrake_command.append( "--audio=" + get_audio_track_list( input_file ) )
File "***/handbrake.py", line 89, in get_audio_track_list
p = subprocess.Popen( handbrake_command, stdout = stdout, stderr = stderr )
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 672, in __init__
errread, errwrite)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 1202, in _execute_child
raise child_exception
OSError: [Errno 13] Permission denied
IMPORT_TO_ITUNES = True
Code: Select all
[ 2012-04-29 @ 17:12:30 ] NZB ID :
[ 2012-04-29 @ 17:12:30 ] Category : movies
[ 2012-04-29 @ 17:12:30 ] Final directory : ***
[ 2012-04-29 @ 17:12:30 ] Output directory : ***
[ 2012-04-29 @ 17:12:30 ] Processing file type : *.avi
[ 2012-04-29 @ 17:12:30 ] Processing file type : *.mkv
[ 2012-04-29 @ 17:12:31 ] error : checking iTunes : ERROR 1: 32:140: execution error: iTunes got an error: Can’t get every track of playlist "Library" whose description = "***". (-1728)
Traceback (most recent call last):
File "***/handbrake.py", line 239, in <module>
handbrake_command.append( "--audio=" + get_audio_track_list( input_file ) )
File ***/handbrake.py", line 89, in get_audio_track_list
p = subprocess.Popen( handbrake_command, stdout = stdout, stderr = stderr )
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 672, in __init__
errread, errwrite)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 1202, in _execute_child
raise child_exception
OSError: [Errno 13] Permission denied
Any ideas on this issue? Thnx in advance
-
- Jr. Member
- Posts: 59
- Joined: March 2nd, 2009, 10:58 am
- Contact:
Re: OS X + HandBrakeCLI + Python = convert, iTunes and e-mai
@agr85: For the import to itunes one, can you open AppleScript Editor, select "Event Log" in the bottom, select "Events" and "Replies", paste in the below code, replace FILENAME with what you removed from below (the three stars in the line that goes "error : checking iTunes : ERROR 1: 32:140: execution error: iTunes got an error: Can’t get every " and then click run and tell me what the "Event Log" window shows.agr85 wrote:I'm currently facing the same problem -- below are Sabnzbd log entries (replaced private directories by ***):
Code: Select all
tell application "iTunes"
get (count of (tracks of playlist "Library" whose description is "FILENAME"))
end tell
Code: Select all
tell application "iTunes"
get (count of (tracks of playlist "Library" whose description is "Grey's Anatomy - 08x21 - Moment of Truth"))
end tell
Re: OS X + HandBrakeCLI + Python = convert, iTunes and e-mai
This is what shows up in the Event Log: (result is partially in Dutch, meaning 'iTunes got an error, <filename> could not be retrieved')@agr85: For the import to itunes one, can you open AppleScript Editor, select "Event Log" in the bottom, select "Events" and "Replies", paste in the below code, replace FILENAME with what you removed from below (the three stars in the line that goes "error : checking iTunes : ERROR 1: 32:140: execution error: iTunes got an error: Can’t get every " and then click run and tell me what the "Event Log" window shows.
Code: Select all
tell application "iTunes"
count every track of playlist "Library" whose description = "rihanna_ft_drake-whats_my_name-x264-2010-fray"
--> error number -1728
Resultaat:
error "iTunes kreeg een fout: every track of playlist \"Library\" whose description = \"rihanna_ft_drake-whats_my_name-x264-2010-fray\" kan niet worden opgevraagd. " number -1728 from every track of playlist "Library" whose description = "rihanna_ft_drake-whats_my_name-x264-2010-fray"
Re: OS X + HandBrakeCLI + Python = convert, iTunes and e-mai
I had this problem too... The issue is that when you edit the file with TextEdit, the file gets extended attributes added, one of which is com.apple.quarantine. You can tell if it has extended attributes with the ls command if it has the @ symbol:agr85 wrote:I'm currently facing the same problem -- below are Sabnzbd log entries (replaced private directories by ***):
HANDBRAKE_COMMAND_OUTPUT = True
IMPORT_TO_ITUNES = FalseHANDBRAKE_COMMAND_OUTPUT = FalseCode: Select all
[ 2012-04-29 @ 17:14:28 ] NZB ID : [ 2012-04-29 @ 17:14:28 ] Category : movies [ 2012-04-29 @ 17:14:28 ] Final directory : *** [ 2012-04-29 @ 17:14:28 ] Output directory : *** [ 2012-04-29 @ 17:14:28 ] Processing file type : *.avi [ 2012-04-29 @ 17:14:28 ] Processing file type : *.mkv Traceback (most recent call last): File "***/handbrake.py", line 239, in <module> handbrake_command.append( "--audio=" + get_audio_track_list( input_file ) ) File "***/handbrake.py", line 89, in get_audio_track_list p = subprocess.Popen( handbrake_command, stdout = stdout, stderr = stderr ) File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 672, in __init__ errread, errwrite) File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 1202, in _execute_child raise child_exception OSError: [Errno 13] Permission denied
IMPORT_TO_ITUNES = TrueI've set file and directory permissions to 775 on the Python directory. The handbrake.py script has executable permissions.Code: Select all
[ 2012-04-29 @ 17:12:30 ] NZB ID : [ 2012-04-29 @ 17:12:30 ] Category : movies [ 2012-04-29 @ 17:12:30 ] Final directory : *** [ 2012-04-29 @ 17:12:30 ] Output directory : *** [ 2012-04-29 @ 17:12:30 ] Processing file type : *.avi [ 2012-04-29 @ 17:12:30 ] Processing file type : *.mkv [ 2012-04-29 @ 17:12:31 ] error : checking iTunes : ERROR 1: 32:140: execution error: iTunes got an error: Can’t get every track of playlist "Library" whose description = "***". (-1728) Traceback (most recent call last): File "***/handbrake.py", line 239, in <module> handbrake_command.append( "--audio=" + get_audio_track_list( input_file ) ) File ***/handbrake.py", line 89, in get_audio_track_list p = subprocess.Popen( handbrake_command, stdout = stdout, stderr = stderr ) File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 672, in __init__ errread, errwrite) File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 1202, in _execute_child raise child_exception OSError: [Errno 13] Permission denied
Any ideas on this issue? Thnx in advance
Code: Select all
macpro-ec5f6d:autoProcessTV mekoniak$ ls -al
total 88
drwxr-xr-x 10 mekoniak staff 340 May 14 15:51 .
drwxr-xr-x 25 mekoniak staff 850 May 14 15:36 ..
-rw-r--r--@ 1 mekoniak staff 74 Sep 25 2010 autoProcessTV.cfg
-rw-rw-r-- 1 mekoniak staff 78 Apr 27 00:28 autoProcessTV.cfg.sample
-rw-rw-r-- 1 mekoniak staff 2964 Apr 27 00:28 autoProcessTV.py
-rw-r--r-- 1 mekoniak staff 2790 May 4 12:55 autoProcessTV.pyc
-rwxrwxr-x@ 1 mekoniak staff 14676 May 14 15:51 handbrake.py
-rwxrwxr-x 1 mekoniak staff 979 Apr 27 00:28 hellaToSickBeard.py
-rwxrwxr-x 1 mekoniak staff 1048 Apr 27 00:28 sabToSickBeard.py
-rwxrwxr-x 1 mekoniak staff 142 May 14 15:39 test.py
macpro-ec5f6d:autoProcessTV mekoniak$ xattr handbrake.py
com.apple.TextEncoding
com.apple.quarantine
Code: Select all
xattr -c handbrake.py