Skip to content
This repository has been archived by the owner on Dec 27, 2024. It is now read-only.

Commit

Permalink
1.0.7
Browse files Browse the repository at this point in the history
  • Loading branch information
axelmierczuk committed Jan 14, 2022
1 parent db98f72 commit 00b22dd
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 11 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ FROM python:3.8-slim-buster

WORKDIR /sportyfin

RUN pip install sportyfin==1.0.6 --no-binary=sportyfin
RUN pip install sportyfin==1.0.7 --no-binary=sportyfin

CMD [ "python3", "-m" , "sportyfin", "run", "-a", "-o", "/sportyfin/output"]
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# https://github.com/axelmierczuk/sportyfin
[metadata]
name = sportyfin
version = 1.0.6
version = 1.0.7
author = Axel Mierczuk
author_email = [email protected]
url = https://github.com/axelmierczuk/sportyfin
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

setup(
name='sportyfin',
version='1.0.6',
version='1.0.7',
author='Axel Mierczuk',
author_email='[email protected]',
packages=['sportyfin', 'sportyfin.util'],
Expand Down
16 changes: 10 additions & 6 deletions sportyfin/sportyfin.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def header():
print(f"{colours.OKGREEN} is used in Jellyfin to provide a great viewing experience.")
print()
print(f"{colours.OKGREEN} Author: Axel Mierczuk")
print(f"{colours.OKGREEN} Version: 1.0.6")
print(f"{colours.OKGREEN} Version: 1.0.7")
print(f"{colours.OKGREEN} Github: https://github.com/axelmierczuk/sportyfin")
print()
print()
Expand Down Expand Up @@ -66,13 +66,17 @@ def generate_xmltv(self, lg: str):
root = ET.Element("tv")
for match in self.streaming_sites[lg]:
for url in match['match']['m3u8_urls']:
doc = ET.SubElement(root, "programme", start=match['match']['start'], stop=match['match']['stop'], channel=str(url))
ET.SubElement(doc, "title", lang="en").text = match['match']['name']
ET.SubElement(doc, "category", lang="en").text = "sports"
doc = ET.SubElement(root, "channel", id=str(url))
ET.SubElement(doc, "display-name").text = match['match']['name']
ET.SubElement(doc, "icon").text = f"{OUTPUT}/{lg}/{match['match']['img_location'].split('/')[-1]}"

doc_p = ET.SubElement(root, "programme", start=match['match']['start'], stop=match['match']['stop'], channel=str(url))
ET.SubElement(doc_p, "title", lang="en").text = match['match']['name']
ET.SubElement(doc_p, "category", lang="en").text = "sports"
audio = ET.Element("audio")
doc.append(audio)
doc_p.append(audio)
ET.SubElement(audio, "stereo").text = "stereo"
ET.SubElement(doc, "icon", src=f"{OUTPUT}/{lg}/{match['match']['img_location'].split('/')[-1]}")
ET.SubElement(doc_p, "icon", src=f"{OUTPUT}/{lg}/{match['match']['img_location'].split('/')[-1]}")
tree = ET.ElementTree(root)
outp = os.path.join(OUTPUT, f"docs")
if not os.path.isdir(f"{OUTPUT}"):
Expand Down
14 changes: 12 additions & 2 deletions sportyfin/util/scraping.py
Original file line number Diff line number Diff line change
Expand Up @@ -200,8 +200,18 @@ def make_match(api_res, hosts, lg) -> list:
}
}
try:
match['match']['start'] = ''.join(g['formatedStartDate'].split('-')) + ''.join(g['startTime'].split(':')) + " GMT"
match['match']['stop'] = ''.join(g['formatedStartDate'].split('-')) + str(int(''.join(g['startTime'].split(':'))) + 300) + " GMT"
t = ''.join(g['startTime'].split(':'))
if len(t) > 4:
t = t[:(4-len(t))]
t_end = str(int(t) + 300)
if len(t_end) < 4:
t_end = "0" + t_end
try:
match['match']['start'] = ''.join(g['formatedStartDate'].split('-')) + t + " GMT"
match['match']['stop'] = ''.join(g['formatedStartDate'].split('-')) + t_end + " GMT"
except:
match['match']['start'] = ''.join(g['startDate'].split('-')) + t + " GMT"
match['match']['stop'] = ''.join(g['startDate'].split('-')) + t_end + " GMT"
except:
pass
if match['match']['name'] == '':
Expand Down

0 comments on commit 00b22dd

Please sign in to comment.