autoProcessMovie.py calling Ember Media Manager problem
Posted: July 12th, 2013, 11:02 am
Hi,
I'm running an Windows 7 htpc (refer to my sig)
I've been trying to integrate clinton.hall's autoProcessMovie.py with Ember Media Manager, so that after CPS renames my movies, I than get extra scrapping data from it.
my autoProcessMovie.py looks like this for Ember calling:
my nzbToCouchpotato.py looks like this:
When I run this script from Git bash, everything works as expected, but when it gets invoked by nzbToCouchpotato.py it just hangs on Ember Media Manager.exe. This process starts, cpu increases for about 3 seconds and then gets to 0% and the script gets halted. I have to kill this process so that parent subprocess ends.
Can anyone help me with this?
Thanks
I'm running an Windows 7 htpc (refer to my sig)
I've been trying to integrate clinton.hall's autoProcessMovie.py with Ember Media Manager, so that after CPS renames my movies, I than get extra scrapping data from it.
my autoProcessMovie.py looks like this for Ember calling:
Code: Select all
def run_ember():
###########################################
#### Ember Media Manager Auto Scraping ####
###########################################
### Command lines
### -------------
### -fullask
### -fullauto
### -missask
### -missauto
### -newask
### -newauto
### -markask
### -markauto
### -file
### -folder
### -export
### -template
### -resize
### -all
### -nfo
### -posters
### -fanart
### -extra
### -nowindow
### -run
###########################################
# Lauch Ember Media Manager and store PID for future kill
startTime = datetime.datetime.now()
returnCode, stdOut, stdErr, sp = runCmd('"D:\EmberMM\Ember Media Manager.exe" -newauto -all -nowindow')
Logger.info('- Ember Media Manager: running on PID: (' + str(sp.pid) + ')' + ' started at: ' + str(startTime))
endTime = datetime.datetime.now()
# Kill Lauch Media Manager's PID
subprocess.call("taskkill /F /T /PID %i"%sp.pid)
Logger.info('- Ember Media Manager ran for ' + str((endTime - startTime)))
Logger.info('- Killed Ember Media Manager on PID: (' + str(sp.pid) + ')' )
def runCmd(cmd):
proc = subprocess.Popen(shlex.split(cmd), stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=False)
out, err = proc.communicate()
ret = proc.returncode
proc.wait()
return (ret, out, err, proc)
Code: Select all
#!/usr/bin/env python
#
##############################################################################
### NZBGET POST-PROCESSING SCRIPT ###
# Post-Process to CouchPotato.
#
# This script sends the download to your automated media management servers.
#
# NOTE: This script requires Python to be installed on your system.
##############################################################################
### OPTIONS ###
## CouchPotato
# CouchPotato script category.
#
# category that gets called for post-processing with CouchPotatoServer.
#cpsCategory=movie
# CouchPotato api key.
#cpsapikey=
# CouchPotato host.
#cpshost=localhost
# CouchPotato port.
#cpsport=5050
# CouchPotato username.
#cpsusername=
# CouchPotato password.
#cpspassword=
# CouchPotato uses ssl (0, 1).
#
# Set to 1 if using ssl, else set to 0.
#cpsssl=0
# CouchPotato URL_Base
#
# set this if using a reverse proxy.
#cpsweb_root=
# CouchPotato Postprocess Delay.
#
# must be at least 60 seconds.
#cpsdelay=65
# CouchPotato Postprocess Method (renamer, manage).
#
# use "renamer" for CPS renamer (default) or "manage" to call a manage update.
#cpsmethod=renamer
# CouchPotato Delete Failed Downloads (0, 1).
#
# set to 1 to delete failed, or 0 to leave files in place.
#cpsdelete_failed=0
## Extensions
# Media Extensions
#
# This is a list of media extensions that may be transcoded if transcoder is enabled below.
#mediaExtensions=.mkv,.avi,.divx,.xvid,.mov,.wmv,.mp4,.mpg,.mpeg,.vob,.iso
## Transcoder
# Transcode (0, 1).
#
# set to 1 to transcode, otherwise set to 0.
#transcode=0
# create a duplicate, or replace the original (0, 1).
#
# set to 1 to cretae a new file or 0 to replace the original
#duplicate=1
# ignore extensions
#
# list of extensions that won't be transcoded.
#ignoreExtensions=.avi,.mkv
# ffmpeg output settings.
#outputVideoExtension=.mp4
#outputVideoCodec=libx264
#outputVideoPreset=medium
#outputVideoFramerate=24
#outputVideoBitrate=800k
#outputAudioCodec=libmp3lame
#outputAudioBitrate=128k
#outputSubtitleCodec=
## WakeOnLan
# use WOL (0, 1).
#
# set to 1 to send WOL broadcast to the mac and test the server (e.g. xbmc) on the host and port specified.
#wolwake=0
# WOL MAC
#
# enter the mac address of the system to be woken.
#wolmac=00:01:2e:2D:64:e1
# Set the Host and Port of a server to verify system has woken.
#wolhost=192.168.1.37
#wolport=80
### NZBGET POST-PROCESSING SCRIPT ###
##############################################################################
import os
import sys
import logging
import autoProcess.migratecfg as migratecfg
import autoProcess.autoProcessMovie as autoProcessMovie
from autoProcess.nzbToMediaEnv import *
from autoProcess.nzbToMediaUtil import *
#check to migrate old cfg before trying to load.
if os.path.isfile(os.path.join(os.path.dirname(sys.argv[0]), "autoProcessMedia.cfg.sample")):
migratecfg.migrate()
nzbtomedia_configure_logging(os.path.dirname(sys.argv[0]))
Logger = logging.getLogger(__name__)
Logger.info("====================") # Seperate old from new log
Logger.info("nzbToCouchPotato %s", VERSION)
WakeUp()
# SABnzbd
if len(sys.argv) == SABNZB_NO_OF_ARGUMENTS:
# SABnzbd argv:
# 1 The final directory of the job (full path)
# 2 The original name of the NZB file
# 3 Clean version of the job name (no path info and ".nzb" removed)
# 4 Indexer's report number (if supported)
# 5 User-defined category
# 6 Group that the NZB was posted in e.g. alt.binaries.x
# 7 Status of post processing. 0 = OK, 1=failed verification, 2=failed unpack, 3=1+2
Logger.info("Script triggered from SABnzbd, starting autoProcessMovie...")
clientAgent = "sabnzbd"
Logger.info('Command-line: ' + str(command))
Logger.info('SABnzbd command-line arguments ( ' + str(len(sys.argv)) + ' ): ' + str(sys.argv))
result = autoProcessMovie.process(sys.argv[1], sys.argv[2], sys.argv[7], clientAgent)
else:
Logger.warn("Invalid number of arguments received from client.")
Logger.info("Running autoProcessMovie as a manual run...")
clientAgent = "manual"
result = autoProcessMovie.process('Manual Run', 'Manual Run', 0, clientAgent)
if result == 0:
# Logger.info("Checking SABnzbd status...")
# autoProcessMovie.check_sabnzbd()
# Run Ember Media Manager to scrapre additional data
Logger.info("Launching Ember Media Manager to scrape additional data...")
autoProcessMovie.run_ember()
# Update XBMC Video Library
Logger.info("Update XBMC Video Library...")
autoProcessMovie.update_library()
# SUCCESS: autoProcessMovie script ran successfully!
Logger.info("The autoProcessMovie script completed successfully.")
else:
Logger.info("A problem was reported in the autoProcessMovie script.")
Can anyone help me with this?
Thanks