I was able to download Twitch clips and entire VODs using this library as an embed code in my program written in Python.
The download_clip function takes input from the link, which extracts the slug from the clip, rearranging the link used for the download itself.
I was reading the tool repository and I can't find any information if there is any way to query the game information on such clips.
Specifically, I need to know what game was being played during the livestream so I can validate my analysis later.
I am able to download clips using the following code:
def download_clip(link: str):
clip_id = get_clip_slug(link)
url = f'https://clips.twitch.tv/{clip_id}'
ydl_opts = {'format': 'bestvideo[ext=mp4]+bestaudio[ext=m4a]/best[ext=mp4]/best'}
try:
with YoutubeDL(ydl_opts) as ydl:
ydl.download([url])
except:
print('Not working..')
I also took a look at the youtube-dl and its exactly the same thing.. I can't find any info about it. Any workaround or tips?