diff --git a/lib/svtplay_dl/service/svtplay.py b/lib/svtplay_dl/service/svtplay.py index fc1690d..6525ed4 100644 --- a/lib/svtplay_dl/service/svtplay.py +++ b/lib/svtplay_dl/service/svtplay.py @@ -9,7 +9,7 @@ from urllib.parse import urljoin, urlparse, parse_qs from operator import itemgetter from svtplay_dl.log import log -from svtplay_dl.service import Service, OpenGraphThumbMixin +from svtplay_dl.service import Service from svtplay_dl.utils.text import filenamify from svtplay_dl.fetcher.hds import hdsparse from svtplay_dl.fetcher.hls import hlsparse @@ -271,33 +271,33 @@ class Svtplay(Service): def extrametadata(self, data): self.output["tvshow"] = (self.output["season"] is not None and - self.output["episode"] is not None) + self.output["episode"] is not None) try: title = data["video"]["programTitle"] self.output["title_nice"] = title - except: + except KeyError: title = data["video"]["titleSlug"] self.output["title_nice"] = title try: # Get the image if size/format is not specified in the URL set it to large url = data['state']["titleModel"]["thumbnail"].format(format="large") self.output["showthumbnailurl"] = url - except: + except KeyError: pass try: url = data["video"]["thumbnailXL"].format(format="large") self.output["episodethumbnailurl"] = url - except: + except KeyError: # Get the image if size/format is not specified in the URL set it to large url = data["video"]["thumbnail"].format(format="large") self.output["episodethumbnailurl"] = url try: self.output["showdescription"] = data['state']["titleModel"]["description"] - except: + except KeyError: pass try: self.output["episodedescription"] = data["video"]["description"] - except: + except KeyError: pass def get_thumbnail(self, options): @@ -307,4 +307,4 @@ class Svtplay(Service): if self.output["episodethumbnailurl"] is not None: urls.append((False, self.output["episodethumbnailurl"])) if urls: - download_thumbnails(self.output, options, urls) \ No newline at end of file + download_thumbnails(self.output, options, urls) diff --git a/lib/svtplay_dl/utils/nfo.py b/lib/svtplay_dl/utils/nfo.py index 5f38db7..6dfbb63 100644 --- a/lib/svtplay_dl/utils/nfo.py +++ b/lib/svtplay_dl/utils/nfo.py @@ -44,4 +44,4 @@ def write_nfo_tvshow(output, config): logging.info("NFO show: %s", filename) tree = ET.ElementTree(root) - tree.write(filename, encoding="UTF-8", xml_declaration=True) \ No newline at end of file + tree.write(filename, encoding="UTF-8", xml_declaration=True) diff --git a/lib/svtplay_dl/utils/output.py b/lib/svtplay_dl/utils/output.py index 7178b8c..505bf65 100644 --- a/lib/svtplay_dl/utils/output.py +++ b/lib/svtplay_dl/utils/output.py @@ -134,7 +134,7 @@ def formatname(output, config, extension="mp4"): # If tvshow have not been derived by service do it by if season and episode is set if output.get("tvshow", None) is None: tvshow = (output.get("season", None) is not None and - output.get("episode", None) is not None) + output.get("episode", None) is not None) else: tvshow = output.get("tvshow", False) if config.get("subfolder") and "title" in output and tvshow: