mirror of
https://github.com/clinton-hall/nzbToMedia.git
synced 2025-08-22 06:13:19 -07:00
Remove six.string_types
This commit is contained in:
parent
28166e035d
commit
ec8c059b0a
2 changed files with 7 additions and 14 deletions
|
@ -13,8 +13,6 @@ import requests
|
||||||
|
|
||||||
from requests_oauthlib import OAuth2Session
|
from requests_oauthlib import OAuth2Session
|
||||||
|
|
||||||
import six
|
|
||||||
|
|
||||||
|
|
||||||
class InitSickBeard:
|
class InitSickBeard:
|
||||||
"""Sickbeard init class.
|
"""Sickbeard init class.
|
||||||
|
@ -182,11 +180,7 @@ class InitSickBeard:
|
||||||
logger.debug('Response received: {}'.format(json_data))
|
logger.debug('Response received: {}'.format(json_data))
|
||||||
raise
|
raise
|
||||||
else:
|
else:
|
||||||
if six.PY3:
|
if isinstance(json_data, str):
|
||||||
str_type = (str)
|
|
||||||
else:
|
|
||||||
str_type = (str, unicode)
|
|
||||||
if isinstance(json_data, str_type):
|
|
||||||
return rem_params, False
|
return rem_params, False
|
||||||
json_data = json_data.get('data', json_data)
|
json_data = json_data.get('data', json_data)
|
||||||
|
|
||||||
|
|
|
@ -9,7 +9,6 @@ import shutil
|
||||||
import subprocess
|
import subprocess
|
||||||
|
|
||||||
from babelfish import Language
|
from babelfish import Language
|
||||||
from six import string_types
|
|
||||||
|
|
||||||
import core
|
import core
|
||||||
from core import logger
|
from core import logger
|
||||||
|
@ -137,7 +136,7 @@ def check_vid_file(video_details, result):
|
||||||
|
|
||||||
|
|
||||||
def build_commands(file, new_dir, movie_name, bitbucket):
|
def build_commands(file, new_dir, movie_name, bitbucket):
|
||||||
if isinstance(file, string_types):
|
if isinstance(file, str):
|
||||||
input_file = file
|
input_file = file
|
||||||
if 'concat:' in file:
|
if 'concat:' in file:
|
||||||
file = file.split('|')[0].replace('concat:', '')
|
file = file.split('|')[0].replace('concat:', '')
|
||||||
|
@ -659,7 +658,7 @@ def process_list(it, new_dir, bitbucket):
|
||||||
if combine:
|
if combine:
|
||||||
new_list.extend(combine_cd(combine))
|
new_list.extend(combine_cd(combine))
|
||||||
for file in new_list:
|
for file in new_list:
|
||||||
if isinstance(file, string_types) and 'concat:' not in file and not os.path.isfile(file):
|
if isinstance(file, str) and 'concat:' not in file and not os.path.isfile(file):
|
||||||
success = False
|
success = False
|
||||||
break
|
break
|
||||||
if success and new_list:
|
if success and new_list:
|
||||||
|
@ -902,13 +901,13 @@ def transcode_directory(dir_name):
|
||||||
return 1, dir_name
|
return 1, dir_name
|
||||||
|
|
||||||
for file in file_list:
|
for file in file_list:
|
||||||
if isinstance(file, string_types) and os.path.splitext(file)[1] in core.IGNOREEXTENSIONS:
|
if isinstance(file, str) and os.path.splitext(file)[1] in core.IGNOREEXTENSIONS:
|
||||||
continue
|
continue
|
||||||
command, file = build_commands(file, new_dir, movie_name, bitbucket)
|
command, file = build_commands(file, new_dir, movie_name, bitbucket)
|
||||||
newfile_path = command[-1]
|
newfile_path = command[-1]
|
||||||
|
|
||||||
# transcoding files may remove the original file, so make sure to extract subtitles first
|
# transcoding files may remove the original file, so make sure to extract subtitles first
|
||||||
if core.SEXTRACT and isinstance(file, string_types):
|
if core.SEXTRACT and isinstance(file, str):
|
||||||
extract_subs(file, newfile_path, bitbucket)
|
extract_subs(file, newfile_path, bitbucket)
|
||||||
|
|
||||||
try: # Try to remove the file that we're transcoding to just in case. (ffmpeg will return an error if it already exists for some reason)
|
try: # Try to remove the file that we're transcoding to just in case. (ffmpeg will return an error if it already exists for some reason)
|
||||||
|
@ -923,7 +922,7 @@ def transcode_directory(dir_name):
|
||||||
print_cmd(command)
|
print_cmd(command)
|
||||||
result = 1 # set result to failed in case call fails.
|
result = 1 # set result to failed in case call fails.
|
||||||
try:
|
try:
|
||||||
if isinstance(file, string_types):
|
if isinstance(file, str):
|
||||||
proc = subprocess.Popen(command, stdout=bitbucket, stderr=subprocess.PIPE)
|
proc = subprocess.Popen(command, stdout=bitbucket, stderr=subprocess.PIPE)
|
||||||
else:
|
else:
|
||||||
img, data = next(file.items())
|
img, data = next(file.items())
|
||||||
|
@ -941,7 +940,7 @@ def transcode_directory(dir_name):
|
||||||
except Exception:
|
except Exception:
|
||||||
logger.error('Transcoding of video {0} has failed'.format(newfile_path))
|
logger.error('Transcoding of video {0} has failed'.format(newfile_path))
|
||||||
|
|
||||||
if core.SUBSDIR and result == 0 and isinstance(file, string_types):
|
if core.SUBSDIR and result == 0 and isinstance(file, str):
|
||||||
for sub in get_subs(file):
|
for sub in get_subs(file):
|
||||||
name = os.path.splitext(os.path.split(file)[1])[0]
|
name = os.path.splitext(os.path.split(file)[1])[0]
|
||||||
subname = os.path.split(sub)[1]
|
subname = os.path.split(sub)[1]
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue