1
0
mirror of https://github.com/spaam/svtplay-dl.git synced 2024-11-30 15:14:14 +01:00

tv4play: override thumbnail download

in some videos they dont have og:image
This commit is contained in:
Johan Andersson 2021-10-18 16:21:39 +02:00
parent adcaa73210
commit 7a01f041b3

View File

@ -11,6 +11,7 @@ from svtplay_dl.fetcher.dash import dashparse
from svtplay_dl.fetcher.hls import hlsparse from svtplay_dl.fetcher.hls import hlsparse
from svtplay_dl.service import OpenGraphThumbMixin from svtplay_dl.service import OpenGraphThumbMixin
from svtplay_dl.service import Service from svtplay_dl.service import Service
from svtplay_dl.utils.http import download_thumbnails
class Tv4play(Service, OpenGraphThumbMixin): class Tv4play(Service, OpenGraphThumbMixin):
@ -61,6 +62,7 @@ class Tv4play(Service, OpenGraphThumbMixin):
self.output["title"] = item["program_nid"] self.output["title"] = item["program_nid"]
self.output["episodename"] = item["title"] self.output["episodename"] = item["title"]
self.output["id"] = str(vid) self.output["id"] = str(vid)
self.output["episodethumbnailurl"] = item["image"]
if vid is None: if vid is None:
yield ServiceError("Cant find video id for the video") yield ServiceError("Cant find video id for the video")
@ -192,6 +194,9 @@ class Tv4play(Service, OpenGraphThumbMixin):
moreData = False moreData = False
return items return items
def get_thumbnail(self, options):
download_thumbnails(self.output, options, [(False, self.output["episodethumbnailurl"])])
class Tv4(Service, OpenGraphThumbMixin): class Tv4(Service, OpenGraphThumbMixin):
supported_domains = ["tv4.se"] supported_domains = ["tv4.se"]