mirror of
https://github.com/spaam/svtplay-dl.git
synced 2024-11-24 04:05:39 +01:00
flake8 fixes.
This commit is contained in:
parent
c15d7607eb
commit
fc71a8d8e4
@ -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)
|
||||
download_thumbnails(self.output, options, urls)
|
||||
|
@ -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)
|
||||
tree.write(filename, encoding="UTF-8", xml_declaration=True)
|
||||
|
@ -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:
|
||||
|
Loading…
Reference in New Issue
Block a user