diff --git a/core/__init__.py b/core/__init__.py index fbd471f7..4d935def 100644 --- a/core/__init__.py +++ b/core/__init__.py @@ -1017,17 +1017,17 @@ def configure_utility_locations(): else: try: - SEVENZIP = subprocess.Popen(['which', '7z'], stdout=subprocess.PIPE).communicate()[0].strip() + SEVENZIP = subprocess.Popen(['which', '7z'], stdout=subprocess.PIPE).communicate()[0].strip().decode() except Exception: pass if not SEVENZIP: try: - SEVENZIP = subprocess.Popen(['which', '7zr'], stdout=subprocess.PIPE).communicate()[0].strip() + SEVENZIP = subprocess.Popen(['which', '7zr'], stdout=subprocess.PIPE).communicate()[0].strip().decode() except Exception: pass if not SEVENZIP: try: - SEVENZIP = subprocess.Popen(['which', '7za'], stdout=subprocess.PIPE).communicate()[0].strip() + SEVENZIP = subprocess.Popen(['which', '7za'], stdout=subprocess.PIPE).communicate()[0].strip().decode() except Exception: pass if not SEVENZIP: @@ -1035,7 +1035,7 @@ def configure_utility_locations(): logger.warning( 'Failed to locate 7zip. Transcoding of disk images and extraction of .7z files will not be possible!') try: - PAR2CMD = subprocess.Popen(['which', 'par2'], stdout=subprocess.PIPE).communicate()[0].strip() + PAR2CMD = subprocess.Popen(['which', 'par2'], stdout=subprocess.PIPE).communicate()[0].strip().decode() except Exception: pass if not PAR2CMD: @@ -1050,12 +1050,12 @@ def configure_utility_locations(): FFMPEG = os.path.join(FFMPEG_PATH, 'avconv') else: try: - FFMPEG = subprocess.Popen(['which', 'ffmpeg'], stdout=subprocess.PIPE).communicate()[0].strip() + FFMPEG = subprocess.Popen(['which', 'ffmpeg'], stdout=subprocess.PIPE).communicate()[0].strip().decode() except Exception: pass if not FFMPEG: try: - FFMPEG = subprocess.Popen(['which', 'avconv'], stdout=subprocess.PIPE).communicate()[0].strip() + FFMPEG = subprocess.Popen(['which', 'avconv'], stdout=subprocess.PIPE).communicate()[0].strip().decode() except Exception: pass if not FFMPEG: @@ -1071,12 +1071,12 @@ def configure_utility_locations(): FFPROBE = os.path.join(FFMPEG_PATH, 'avprobe') else: try: - FFPROBE = subprocess.Popen(['which', 'ffprobe'], stdout=subprocess.PIPE).communicate()[0].strip() + FFPROBE = subprocess.Popen(['which', 'ffprobe'], stdout=subprocess.PIPE).communicate()[0].strip().decode() except Exception: pass if not FFPROBE: try: - FFPROBE = subprocess.Popen(['which', 'avprobe'], stdout=subprocess.PIPE).communicate()[0].strip() + FFPROBE = subprocess.Popen(['which', 'avprobe'], stdout=subprocess.PIPE).communicate()[0].strip().decode() except Exception: pass if not FFPROBE: diff --git a/core/auto_process/tv.py b/core/auto_process/tv.py index cc31f94e..8d082aec 100644 --- a/core/auto_process/tv.py +++ b/core/auto_process/tv.py @@ -168,13 +168,15 @@ def process(section, dir_name, input_name=None, failed=False, client_agent='manu for param in copy.copy(fork_params): if param == 'failed': fork_params[param] = failed - del fork_params['proc_type'] + if 'proc_type' in fork_params: + del fork_params['proc_type'] if 'type' in fork_params: del fork_params['type'] if param == 'return_data': fork_params[param] = 0 - del fork_params['quiet'] + if 'quiet' in fork_params: + del fork_params['quiet'] if param == 'type': fork_params[param] = 'manual' diff --git a/core/transcoder.py b/core/transcoder.py index 52a35292..375d9d3a 100644 --- a/core/transcoder.py +++ b/core/transcoder.py @@ -95,7 +95,7 @@ def get_video_details(videofile, img=None, bitbucket=None): proc = subprocess.Popen(command, stdout=subprocess.PIPE) out, err = proc.communicate() result = proc.returncode - video_details = json.loads(out) + video_details = json.loads(out.decode()) except Exception: pass if not video_details: @@ -109,7 +109,7 @@ def get_video_details(videofile, img=None, bitbucket=None): proc = subprocess.Popen(command, stdout=subprocess.PIPE) out, err = proc.communicate() result = proc.returncode - video_details = json.loads(out) + video_details = json.loads(out.decode()) except Exception: logger.error('Checking [{0}] has failed'.format(file), 'TRANSCODER') return video_details, result diff --git a/tests/general.py b/tests/general.py index ed0ef06c..ddcc7aa0 100755 --- a/tests/general.py +++ b/tests/general.py @@ -1,15 +1,18 @@ #! /usr/bin/env python2 from __future__ import print_function -from babelfish import Language -import guessit -import requests -import subliminal +import datetime +import os +import sys import core -from core import transcoder +from core import logger, main_db, transcoder +from core.auto_process import comics, games, movies, music, tv +from core.auto_process.common import ProcessResult +from core.user_scripts import external_script from core.forks import auto_fork -from core.utils import server_responding +from core.utils import char_replace, clean_dir, convert_to_ascii, extract_files, get_dirs, get_download_info, get_nzoid, plex_update, update_download_info_status, server_responding + # Initialize the config core.initialize()