Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import streamlink
- import subprocess
- # List of channels you want to view
- channels = ['twitch.tv/lirik', 'twitch.tv/ninja', 'youtube.com/channel/UCiDFDL2XzFvZSK4WvGrBCTg/live']
- # Use Streamlink to get available streams for each channel
- streams = {}
- for channel in channels:
- streams[channel] = streamlink.streams(channel)
- # Print available streams for each channel
- for channel, available_streams in streams.items():
- print(f"Available streams for {channel}:")
- for stream in available_streams:
- print(stream)
- # Ask user to select a stream to view
- selected_channel = input("Enter the channel you want to view: ")
- if selected_channel not in channels:
- print("Invalid channel selected.")
- exit()
- selected_stream = input(f"Enter the stream for {selected_channel} you want to view: ")
- if selected_stream not in streams[selected_channel]:
- print("Invalid stream selected.")
- exit()
- # Use Streamlink to launch the selected stream in VLC media player
- stream_url = streams[selected_channel][selected_stream].url
- subprocess.call(['vlc', stream_url])
Advertisement
Add Comment
Please, Sign In to add comment