mirror of
https://github.com/clinton-hall/nzbToMedia.git
synced 2025-08-21 22:03:13 -07:00
More code testing
This commit is contained in:
parent
6607775753
commit
e9c8589395
1 changed files with 11 additions and 12 deletions
|
@ -264,26 +264,25 @@ def initialize(section=None):
|
||||||
if platform.system() == 'Windows':
|
if platform.system() == 'Windows':
|
||||||
FFMPEG = os.path.join(FFMPEG_PATH, 'ffmpeg.exe')
|
FFMPEG = os.path.join(FFMPEG_PATH, 'ffmpeg.exe')
|
||||||
FFPROBE = os.path.join(FFMPEG_PATH, 'ffprobe.exe')
|
FFPROBE = os.path.join(FFMPEG_PATH, 'ffprobe.exe')
|
||||||
if TRANSCODE and not os.path.isfile(FFMPEG): # problem
|
|
||||||
FFMPEG = None
|
|
||||||
|
|
||||||
if not os.path.isfile(FFPROBE): # problem
|
if not (os.path.isfile(FFMPEG) or os.path.isfile(FFMPEG)): # problem
|
||||||
|
FFMPEG = None
|
||||||
FFPROBE = None
|
FFPROBE = None
|
||||||
else:
|
else:
|
||||||
bitbucket = open('/dev/null')
|
bitbucket = open('/dev/null')
|
||||||
|
|
||||||
FFMPEG = 'ffmpeg'
|
FFMPEG = subprocess.call(['which', 'ffmpeg'], stdout=bitbucket, stderr=bitbucket)
|
||||||
FFPROBE = 'ffprobe'
|
FFPROBE = subprocess.call(['which', 'ffprobe'], stdout=bitbucket, stderr=bitbucket)
|
||||||
if TRANSCODE and subprocess.call(['which', 'ffmpeg'], stdout=bitbucket, stderr=bitbucket) != 0 \
|
|
||||||
or subprocess.call(['which', 'ffprobe'], stdout=bitbucket, stderr=bitbucket) != 0:
|
if not (FFMPEG or FFPROBE):
|
||||||
|
# Auto-install FFMPEG and FFPROBE
|
||||||
res = subprocess.call([os.path.join(PROGRAM_DIR, 'getffmpeg.sh')], stdout=bitbucket, stderr=bitbucket)
|
res = subprocess.call([os.path.join(PROGRAM_DIR, 'getffmpeg.sh')], stdout=bitbucket, stderr=bitbucket)
|
||||||
if res: # did not install or ffmpeg still not found.
|
if res == 0: # did not install or ffmpeg still not found.
|
||||||
|
FFMPEG = subprocess.call(['which', 'ffmpeg'], stdout=bitbucket, stderr=bitbucket)
|
||||||
|
FFPROBE = subprocess.call(['which', 'ffprobe'], stdout=bitbucket, stderr=bitbucket)
|
||||||
|
else:
|
||||||
logger.error("Failed to install ffmpeg. Please install manually")
|
logger.error("Failed to install ffmpeg. Please install manually")
|
||||||
|
|
||||||
if subprocess.call(['which', 'ffmpeg'], stdout=bitbucket, stderr=bitbucket) != 0:
|
|
||||||
FFMPEG = None
|
FFMPEG = None
|
||||||
|
|
||||||
if subprocess.call(['which', 'ffprobe'], stdout=bitbucket, stderr=bitbucket) != 0:
|
|
||||||
FFPROBE = None
|
FFPROBE = None
|
||||||
|
|
||||||
USER_SCRIPT_CATEGORIES = CFG["UserScript"]["user_script_categories"]
|
USER_SCRIPT_CATEGORIES = CFG["UserScript"]["user_script_categories"]
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue