Skip to content

Commit

Permalink
Update app.py
Browse files Browse the repository at this point in the history
  • Loading branch information
firofame authored Jul 22, 2024
1 parent 25916cd commit a24d53c
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions app.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

# Write the playlist file
with open('playlist.m3u', 'w') as f:
f.write('#EXTM3U\n\n')
f.write('#EXTM3U\n')
for i, (handle, group) in enumerate(handles, start=1):
# Construct the URL for the channel's live stream
url = f'https://www.youtube.com/@{handle}/live'
Expand All @@ -36,10 +36,11 @@
channel_id = data['contents']['twoColumnWatchNextResults']['results']['results']['contents'][1]['videoSecondaryInfoRenderer']['owner']['videoOwnerRenderer']['title']['runs'][0]['navigationEndpoint']['browseEndpoint']['browseId']

# Construct the M3U8 URL for the channel's live stream
m3u8_url = f'https://live.firofame.workers.dev/?@={handle}'
# m3u8_url = f'https://live.firofame.workers.dev/?@={handle}'
m3u8_url = f'https://ythls.armelin.one/channel/{channel_id}.m3u8'

# Write the metadata and URL to the playlist file
f.write(f'#EXTINF:-1 tvg-logo="{image_url}" group-title="{group}", {channel_name}\n{m3u8_url}\n\n')
f.write(f'#EXTINF:-1 tvg-logo="{image_url}" group-title="{group}", {channel_name}\n{m3u8_url}\n')

# Add the channel data to the list
channel_data.append({
Expand Down

0 comments on commit a24d53c

Please sign in to comment.