Skip to content

Commit

Permalink
Update common.py (#244)
Browse files Browse the repository at this point in the history
Local file support for 'tvg-logo' attribute in '.m3u8' files. Example: `tvg-logo="file:https:///home/username/Video/Movies/Movie Name (1986)-landscape.jpg"`
  • Loading branch information
fire-hawk-86 committed Oct 4, 2022
1 parent d080f27 commit 8f5e38c
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions usr/lib/hypnotix/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,14 +107,17 @@ def __init__(self, provider, info):
if self.name == None and "," in info:
self.name = info.split(",")[-1].strip()
if self.logo != None:
ext = None
for known_ext in [".png", ".jpg", ".gif", ".jpeg"]:
if self.logo.lower().endswith(known_ext):
ext = known_ext
break
if ext == ".jpeg":
ext = ".jpg"
self.logo_path = os.path.join(PROVIDERS_PATH, "%s-%s%s" % (slugify(provider.name), slugify(self.name), ext))
if self.logo.startswith("file:https://"):
self.logo_path = self.logo[7:]
else:
ext = None
for known_ext in [".png", ".jpg", ".gif", ".jpeg"]:
if self.logo.lower().endswith(known_ext):
ext = known_ext
break
if ext == ".jpeg":
ext = ".jpg"
self.logo_path = os.path.join(PROVIDERS_PATH, "%s-%s%s" % (slugify(provider.name), slugify(self.name), ext))

class Manager():

Expand Down

0 comments on commit 8f5e38c

Please sign in to comment.