Update German TV (#76)

* Update germany.md

adding some channels

* Update germany.md

* Update germany.md

One aktualisiert, RBB hinzugefügt.

* Update germany.md

* Update make_playlist.py

using f-strings

* Update germany.md

Co-authored-by: Free TV <[email protected]>
This commit is contained in:
Axel Schneider
2021-08-17 13:15:41 +01:00
committed by GitHub
co-authored by Free TV
parent a40dc9f120
commit 64679be231
2 changed files with 6 additions and 17 deletions
+3 -5
View File
@@ -17,9 +17,7 @@ class Channel():
self.logo = self.logo[self.logo.find('src="')+5:self.logo.rfind('"')]
def to_m3u_line(self):
return('#EXTINF:-1 tvg-name="%(name)s" tvg-logo="%(logo)s" group-title="%(group)s",%(name)s\n%(url)s' \
% {'name':self.name, 'logo':self.logo, 'group':self.group, 'url':self.url})
return (f'#EXTINF:-1 tvg-name="{self.name}" tvg-logo="{self.logo}" group-title="{self.group}",{self.name}\n{self.url}')
if __name__ == "__main__":
with open("playlist.m3u8", "w", encoding='utf-8') as playlist:
@@ -29,7 +27,7 @@ if __name__ == "__main__":
continue
with open(filename, encoding='utf-8') as markup_file:
group = filename.replace(".md", "").title()
print("Generating %s" % group)
print(f"Generating {group}")
for line in markup_file:
if "<h1>" in line.lower() and "</h1>" in line.lower():
group = re.sub('<[^<>]+>', '', line.strip())
@@ -37,4 +35,4 @@ if __name__ == "__main__":
continue
channel = Channel(group, line)
print(channel.to_m3u_line(), file=playlist)