Merge pull request #1 from IIIspaceIII/development

Development
pull/762/head^2
IIIspaceIII 5 years ago committed by GitHub
commit 6e1ceec829
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -84,7 +84,7 @@ def update_series():
# Add shows in Sonarr to current shows list # Add shows in Sonarr to current shows list
current_shows_sonarr.append(show['id']) current_shows_sonarr.append(show['id'])
if show['tvdbId'] in current_shows_db_list: if show['id'] in current_shows_db_list:
series_to_update.append({'title': six.text_type(show["title"]), series_to_update.append({'title': six.text_type(show["title"]),
'path': six.text_type(show["path"]), 'path': six.text_type(show["path"]),
'tvdbId': int(show["tvdbId"]), 'tvdbId': int(show["tvdbId"]),

@ -249,6 +249,11 @@ def download_subtitle(path, language, hi, forced, providers, providers_auth, sce
if os.name == 'nt': if os.name == 'nt':
out = out.decode(encoding) out = out.decode(encoding)
try:
out = out.decode(sys.stdout.encoding)
except (UnicodeDecodeError, AttributeError):
pass
except: except:
if out == "": if out == "":
@ -474,6 +479,11 @@ def manual_download_subtitle(path, language, hi, forced, subtitle, provider, pro
if os.name == 'nt': if os.name == 'nt':
out = out.decode(encoding) out = out.decode(encoding)
try:
out = out.decode(sys.stdout.encoding)
except (UnicodeDecodeError, AttributeError):
pass
except: except:
if out == "": if out == "":

@ -1,6 +1,6 @@
# coding=utf-8 # coding=utf-8
bazarr_version = '0.8.4' bazarr_version = '0.8.4.1'
import os import os
os.environ["SZ_USER_AGENT"] = "Bazarr/1" os.environ["SZ_USER_AGENT"] = "Bazarr/1"
@ -1749,9 +1749,9 @@ def execute_task(taskid):
@custom_auth_basic(check_credentials) @custom_auth_basic(check_credentials)
def remove_subtitles(): def remove_subtitles():
authorize() authorize()
episodePath = request.forms.get('episodePath') episodePath = request.forms.episodePath
language = request.forms.get('language') language = request.forms.get('language')
subtitlesPath = request.forms.get('subtitlesPath') subtitlesPath = request.forms.subtitlesPath
sonarrSeriesId = request.forms.get('sonarrSeriesId') sonarrSeriesId = request.forms.get('sonarrSeriesId')
sonarrEpisodeId = request.forms.get('sonarrEpisodeId') sonarrEpisodeId = request.forms.get('sonarrEpisodeId')
@ -1768,9 +1768,9 @@ def remove_subtitles():
@custom_auth_basic(check_credentials) @custom_auth_basic(check_credentials)
def remove_subtitles_movie(): def remove_subtitles_movie():
authorize() authorize()
moviePath = request.forms.get('moviePath') moviePath = request.forms.moviePath
language = request.forms.get('language') language = request.forms.get('language')
subtitlesPath = request.forms.get('subtitlesPath') subtitlesPath = request.forms.subtitlesPath
radarrId = request.forms.get('radarrId') radarrId = request.forms.get('radarrId')
try: try:
@ -1788,14 +1788,14 @@ def get_subtitle():
authorize() authorize()
ref = request.environ['HTTP_REFERER'] ref = request.environ['HTTP_REFERER']
episodePath = request.forms.get('episodePath') episodePath = request.forms.episodePath
sceneName = request.forms.get('sceneName') sceneName = request.forms.sceneName
language = request.forms.get('language') language = request.forms.get('language')
hi = request.forms.get('hi') hi = request.forms.get('hi')
forced = request.forms.get('forced') forced = request.forms.get('forced')
sonarrSeriesId = request.forms.get('sonarrSeriesId') sonarrSeriesId = request.forms.get('sonarrSeriesId')
sonarrEpisodeId = request.forms.get('sonarrEpisodeId') sonarrEpisodeId = request.forms.get('sonarrEpisodeId')
title = request.forms.get('title') title = request.forms.title
providers_list = get_providers() providers_list = get_providers()
providers_auth = get_providers_auth() providers_auth = get_providers_auth()
@ -1823,12 +1823,12 @@ def get_subtitle():
def manual_search_json(): def manual_search_json():
authorize() authorize()
episodePath = request.forms.get('episodePath') episodePath = request.forms.episodePath
sceneName = request.forms.get('sceneName') sceneName = request.forms.sceneName
language = request.forms.get('language') language = request.forms.get('language')
hi = request.forms.get('hi') hi = request.forms.get('hi')
forced = request.forms.get('forced') forced = request.forms.get('forced')
title = request.forms.get('title') title = request.forms.title
providers_list = get_providers() providers_list = get_providers()
providers_auth = get_providers_auth() providers_auth = get_providers_auth()
@ -1843,16 +1843,16 @@ def manual_get_subtitle():
authorize() authorize()
ref = request.environ['HTTP_REFERER'] ref = request.environ['HTTP_REFERER']
episodePath = request.forms.get('episodePath') episodePath = request.forms.episodePath
sceneName = request.forms.get('sceneName') sceneName = request.forms.sceneName
language = request.forms.get('language') language = request.forms.get('language')
hi = request.forms.get('hi') hi = request.forms.get('hi')
forced = request.forms.get('forced') forced = request.forms.get('forced')
selected_provider = request.forms.get('provider') selected_provider = request.forms.get('provider')
subtitle = request.forms.get('subtitle') subtitle = request.forms.subtitle
sonarrSeriesId = request.forms.get('sonarrSeriesId') sonarrSeriesId = request.forms.get('sonarrSeriesId')
sonarrEpisodeId = request.forms.get('sonarrEpisodeId') sonarrEpisodeId = request.forms.get('sonarrEpisodeId')
title = request.forms.get('title') title = request.forms.title
providers_auth = get_providers_auth() providers_auth = get_providers_auth()
@ -1881,14 +1881,14 @@ def perform_manual_upload_subtitle():
authorize() authorize()
ref = request.environ['HTTP_REFERER'] ref = request.environ['HTTP_REFERER']
episodePath = request.forms.get('episodePath') episodePath = request.forms.episodePath
sceneName = request.forms.get('sceneName') sceneName = request.forms.sceneName
language = request.forms.get('language') language = request.forms.get('language')
forced = True if request.forms.get('forced') == '1' else False forced = True if request.forms.get('forced') == '1' else False
upload = request.files.get('upload') upload = request.files.get('upload')
sonarrSeriesId = request.forms.get('sonarrSeriesId') sonarrSeriesId = request.forms.get('sonarrSeriesId')
sonarrEpisodeId = request.forms.get('sonarrEpisodeId') sonarrEpisodeId = request.forms.get('sonarrEpisodeId')
title = request.forms.get('title') title = request.forms.title
_, ext = os.path.splitext(upload.filename) _, ext = os.path.splitext(upload.filename)
@ -1925,13 +1925,13 @@ def get_subtitle_movie():
authorize() authorize()
ref = request.environ['HTTP_REFERER'] ref = request.environ['HTTP_REFERER']
moviePath = request.forms.get('moviePath') moviePath = request.forms.moviePath
sceneName = request.forms.get('sceneName') sceneName = request.forms.sceneName
language = request.forms.get('language') language = request.forms.get('language')
hi = request.forms.get('hi') hi = request.forms.get('hi')
forced = request.forms.get('forced') forced = request.forms.get('forced')
radarrId = request.forms.get('radarrId') radarrId = request.forms.get('radarrId')
title = request.forms.get('title') title = request.forms.title
providers_list = get_providers() providers_list = get_providers()
providers_auth = get_providers_auth() providers_auth = get_providers_auth()
@ -1959,12 +1959,12 @@ def get_subtitle_movie():
def manual_search_movie_json(): def manual_search_movie_json():
authorize() authorize()
moviePath = request.forms.get('moviePath') moviePath = request.forms.moviePath
sceneName = request.forms.get('sceneName') sceneName = request.forms.sceneName
language = request.forms.get('language') language = request.forms.get('language')
hi = request.forms.get('hi') hi = request.forms.get('hi')
forced = request.forms.get('forced') forced = request.forms.get('forced')
title = request.forms.get('title') title = request.forms.title
providers_list = get_providers() providers_list = get_providers()
providers_auth = get_providers_auth() providers_auth = get_providers_auth()
@ -1979,15 +1979,15 @@ def manual_get_subtitle_movie():
authorize() authorize()
ref = request.environ['HTTP_REFERER'] ref = request.environ['HTTP_REFERER']
moviePath = request.forms.get('moviePath') moviePath = request.forms.moviePath
sceneName = request.forms.get('sceneName') sceneName = request.forms.sceneName
language = request.forms.get('language') language = request.forms.get('language')
hi = request.forms.get('hi') hi = request.forms.get('hi')
forced = request.forms.get('forced') forced = request.forms.get('forced')
selected_provider = request.forms.get('provider') selected_provider = request.forms.provider
subtitle = request.forms.get('subtitle') subtitle = request.forms.subtitle
radarrId = request.forms.get('radarrId') radarrId = request.forms.get('radarrId')
title = request.forms.get('title') title = request.forms.title
providers_auth = get_providers_auth() providers_auth = get_providers_auth()
@ -2015,13 +2015,13 @@ def perform_manual_upload_subtitle_movie():
authorize() authorize()
ref = request.environ['HTTP_REFERER'] ref = request.environ['HTTP_REFERER']
moviePath = request.forms.get('moviePath') moviePath = request.forms.moviePath
sceneName = request.forms.get('sceneName') sceneName = request.forms.sceneName
language = request.forms.get('language') language = request.forms.get('language')
forced = True if request.forms.get('forced') == '1' else False forced = True if request.forms.get('forced') == '1' else False
upload = request.files.get('upload') upload = request.files.get('upload')
radarrId = request.forms.get('radarrId') radarrId = request.forms.get('radarrId')
title = request.forms.get('title') title = request.forms.title
_, ext = os.path.splitext(upload.filename) _, ext = os.path.splitext(upload.filename)

@ -138,7 +138,7 @@ def _get_localzone(_root='/'):
if os.path.exists(tzpath) and os.path.islink(tzpath): if os.path.exists(tzpath) and os.path.islink(tzpath):
tzpath = os.path.realpath(tzpath) tzpath = os.path.realpath(tzpath)
start = tzpath.find("/")+1 start = tzpath.find("/")+1
while start is not 0: while start != 0:
tzpath = tzpath[start:] tzpath = tzpath[start:]
try: try:
return pytz.timezone(tzpath) return pytz.timezone(tzpath)

Loading…
Cancel
Save