catch trakt bad response
from trakt_list_util import TraktListUtil
from config import CONFIG
-import requests
import requests_cache
requests_cache.install_cache('trakt_cache')
@@ -127,11 +126,14 @@ def process_movie_section(s, watched_set, ratings_dict, listutil, collection):
# add to plex lists
listutil.addPlexMovieToLists(m.slug, movie)
- logging.info("Movie [{} ({})]: sync complete".format(
+ logging.info("Movie [{} ({})]: Finished sync".format(
movie.title, movie.year))
except trakt.errors.NotFoundException:
logging.error(
- "Movie [{} ({})]: NOT FOUND on trakt - GUID: {}".format(movie.title, movie.year, guid))
+ "Movie [{} ({})]: GUID {} not found on trakt".format(movie.title, movie.year, guid))
+ except:
+ logging.error(
+ "Movie [{} ({})]: bad response from trakt (GUID: {})".format(movie.title, movie.year, guid))
def process_show_section(s, watched_set):
@@ -178,7 +180,6 @@ def process_show_section(s, watched_set):
logging.error("Show [{} ({})]: Did not find on Trakt. Aborting. GUID: {}".format(show.title, show.year, guid))
continue
with requests_cache.disabled():
- #trakt_watched = pytrakt_extensions.watched(trakt_show.trakt)
trakt_collected = pytrakt_extensions.collected(trakt_show.slug)
start_time = time()
# this lookup-table is accessible via lookup[season][episode]
@@ -245,6 +246,9 @@ def process_show_section(s, watched_set):
except trakt.errors.NotFoundException:
logging.error("Show [{} ({})]: GUID {} not found on trakt".format(
show.title, show.year, guid))
+ except:
+ logging.error("Show [{} ({})]: bad response from trakt (GUID {})".format(
+ show.title, show.year, guid))
def main():
