Skip to content

Commit

Permalink
Fixed: Thumbs for TV4 Play.
Browse files Browse the repository at this point in the history
  • Loading branch information
basrieter committed Oct 12, 2023
1 parent 025af0f commit 5a839b2
Showing 1 changed file with 13 additions and 16 deletions.
29 changes: 13 additions & 16 deletions channels/channel.se/tv4se/chn_tv4se.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
from resources.lib.addonsettings import AddonSettings
from resources.lib.helpers.jsonhelper import JsonHelper

from resources.lib.regexer import Regexer
from resources.lib.helpers.htmlentityhelper import HtmlEntityHelper
from resources.lib.helpers.languagehelper import LanguageHelper
from resources.lib.logger import Logger
Expand Down Expand Up @@ -276,16 +275,16 @@ def create_api_program_type(self, result_set):
item.description = result_set.get("description", None)

item.thumb = result_set.get("image")
if item.thumb is not None:
item.thumb = "https://imageproxy.b17g.services/?format=jpg&shape=cut" \
"&quality=70&resize=520x293&source={}" \
.format(HtmlEntityHelper.url_encode(item.thumb))
# if item.thumb is not None and "://img.b17g.net/" in item.thumb:
# item.thumb = "https://imageproxy.b17g.services/?format=jpg&shape=cut" \
# "&quality=70&resize=520x293&source={}" \
# .format(HtmlEntityHelper.url_encode(item.thumb))

item.fanart = result_set.get("image")
if item.fanart is not None:
item.fanart = "https://imageproxy.b17g.services/?format=jpg&shape=cut" \
"&quality=70&resize=1280x720&source={}" \
.format(HtmlEntityHelper.url_encode(item.fanart))
# if item.fanart is not None and "://img.b17g.net/" in item.fanart:
# item.fanart = "https://imageproxy.b17g.services/?format=jpg&shape=cut" \
# "&quality=70&resize=1280x720&source={}" \
# .format(HtmlEntityHelper.url_encode(item.fanart))

item.isPaid = result_set.get("is_premium", False)

Expand Down Expand Up @@ -424,14 +423,12 @@ def create_api_video_asset_type(self, result_set):
0)

item.fanart = result_set.get("program_image", self.parentItem.fanart)
thumb_url = result_set.get("image", result_set.get("program_image"))
item.thumb = result_set.get("image", result_set.get("program_image"))
# some images need to come via a proxy:
if thumb_url and "://img.b17g.net/" in thumb_url:
item.thumb = "https://imageproxy.b17g.services/?format=jpg&shape=cut" \
"&quality=70&resize=520x293&source={}" \
.format(HtmlEntityHelper.url_encode(thumb_url))
else:
item.thumb = thumb_url
# if item.thumb and "://img.b17g.net/" in item.thumb:
# item.thumb = "https://imageproxy.b17g.services/?format=jpg&shape=cut" \
# "&quality=70&resize=520x293&source={}" \
# .format(HtmlEntityHelper.url_encode(item.thumb))

item.media_type = mediatype.EPISODE
item.complete = False
Expand Down

0 comments on commit 5a839b2

Please sign in to comment.