diff --git a/bazarr/init.py b/bazarr/init.py index d5c2f9e7e..5ca34e341 100644 --- a/bazarr/init.py +++ b/bazarr/init.py @@ -1,6 +1,6 @@ # coding=utf-8 -from __future__ import absolute_import +from __future__ import absolute_import, print_function import os import time import rarfile @@ -35,7 +35,7 @@ if not os.path.exists(args.config_dir): try: os.mkdir(os.path.join(args.config_dir)) except OSError: - print "BAZARR The configuration directory doesn't exist and Bazarr cannot create it (permission issue?)." + print("BAZARR The configuration directory doesn't exist and Bazarr cannot create it (permission issue?).") exit(2) if not os.path.exists(os.path.join(args.config_dir, 'config')): diff --git a/bazarr/list_subtitles.py b/bazarr/list_subtitles.py index 32ef11a73..3dedf2f03 100644 --- a/bazarr/list_subtitles.py +++ b/bazarr/list_subtitles.py @@ -15,6 +15,7 @@ from subliminal_patch import search_external_subtitles from subzero.language import Language from bs4 import UnicodeDammit from itertools import islice +import six from get_args import args from database import database @@ -65,7 +66,7 @@ def store_subtitles(original_path, reversed_path): subliminal_patch.core.CUSTOM_PATHS = [dest_folder] if dest_folder else [] subtitles = search_external_subtitles(reversed_path, languages=get_language_set(), only_one=settings.general.getboolean('single_language')) - subtitles = guess_external_subtitles(get_subtitle_destination_folder() or os.path.dirname(file), subtitles) + subtitles = guess_external_subtitles(get_subtitle_destination_folder() or os.path.dirname(reversed_path), subtitles) except Exception as e: logging.exception("BAZARR unable to index external subtitles.") pass @@ -395,7 +396,7 @@ def get_external_subtitles_path(file, subtitle): def guess_external_subtitles(dest_folder, subtitles): - for subtitle, language in subtitles.iteritems(): + for subtitle, language in six.iteritems(subtitles): if not language: subtitle_path = os.path.join(dest_folder, subtitle) if os.path.exists(subtitle_path) and os.path.splitext(subtitle_path)[1] in core.SUBTITLE_EXTENSIONS: diff --git a/bazarr/utils.py b/bazarr/utils.py index d80bd2c78..aee63a298 100644 --- a/bazarr/utils.py +++ b/bazarr/utils.py @@ -98,7 +98,7 @@ def get_sonarr_version(): def get_sonarr_platform(): use_sonarr = settings.general.getboolean('use_sonarr') apikey_sonarr = settings.sonarr.apikey - sv = url_sonarr + "/api/system/status?apikey=" + apikey_sonarr + sv = url_sonarr() + "/api/system/status?apikey=" + apikey_sonarr sonarr_platform = '' if use_sonarr: try: @@ -129,7 +129,7 @@ def get_radarr_version(): def get_radarr_platform(): use_radarr = settings.general.getboolean('use_radarr') apikey_radarr = settings.radarr.apikey - rv = url_radarr + "/api/system/status?apikey=" + apikey_radarr + rv = url_radarr() + "/api/system/status?apikey=" + apikey_radarr radarr_platform = '' if use_radarr: try: