ProgrammingTwitch VOD ID parser
Posted:

ProgrammingTwitch VOD ID parserPosted:

Saki
  • Retired Staff
Status: Offline
Joined: Apr 09, 201113Year Member
Posts: 4,994
Reputation Power: 14230
Motto: Wow crazy USA hamburger yes
Motto: Wow crazy USA hamburger yes
Status: Offline
Joined: Apr 09, 201113Year Member
Posts: 4,994
Reputation Power: 14230
Motto: Wow crazy USA hamburger yes
Ive had this side project of trying to dig up 'deleted' twitch content still hosted on the CDN. As it currently stands, twitch holds every single clip ever made since 2016 (even those deleted by the streamer). I have a program to brute force clip ID offsets down to the minute and have had good results. The problem I'm facing lies with the way twitch stores content on their backend.

There are currently 3 urls twitch uses to serve you content, and they all contain clips:

clips-media-assets2.twitch.tv/vod-(Vod ID)-offset-(number).mp4 (contain about 30% of the clips from a stream)

clips-media-assets2.twitch.tv/(Clip ID)-offset-(number).mp4 (contain about 50% of clips from a stream)

clips-media-assets2.twitch.tv/AT-cm(random string of text).mp4 (random, but up to about 20% of clips from a stream id say. The 'AT-cm' url is only used when someone clips something and gives it a custom name instead of the default stream title, or so I've noticed)

Twitch clip IDs are clear as day to find, it's literally just the number at the end of the url for the stream. The vod ID is different though and is the "direct link" to the vod itself and not the "stream" if that makes sense. VODs delete after about 15 days but can last up to 2 months on the twitch cdn. There doesn't seem to be any pattern to what is deleted quickly and what lasts longer, but that's not my concern. I'm not looking to download the entire vod (though this would be the idea in a perfect world) but since this is impossible all I need is the url (which contains the vod-id) that points to that VOD. Whether it's accessible or not is redundant because the clips remain for years after they're "deleted".

My goal is to find a way to reliably access the VOD IDs from twitch streams so I can brute force both of them and end up with the majority of all clips made for any given stream. My knowledge of scripting and running any type of code is very minimal so I'm having quite a hard time here. My hope is someone here has more knowledge than I do and can help me figure out a solution to my problem.

If someone can help me find these IDs reliably either with a script or a program I'll send you $25 crypto, paypal, IMVU card or whatever you want it in. It's been frustrating me for months and at this point I'd rather just pay someone smarter than me to figure this out

thanks
#2. Posted:
CriticaI
  • TTG Addict
Status: Offline
Joined: Nov 05, 201311Year Member
Posts: 2,749
Reputation Power: 452
Status: Offline
Joined: Nov 05, 201311Year Member
Posts: 2,749
Reputation Power: 452
If you already know the VOD id you'll probably have better luck scraping the video urls using a stateful scraping tool.

However, if you just want to download random VODs, I was able to find an endpoint that exposes if a VOD actually exists. But you would still need to scrape for the video url afterwards.

1. Go here there is a valid client id in plain sight.
dev.twitch.tv/docs/api

2. then make request to api.twitch.tv/v5/videos/<id>/comments

    curl --request GET 'https://api.twitch.tv/v5/videos/<id>/comments' --header 'client-id: <cid>'


---

You may find some luck looking at other resources related to the VOD, images, thumbnails, etc. Or you could go through the official API and try to find some sort of exploit.
#3. Posted:
Saki
  • Retired Staff
Status: Offline
Joined: Apr 09, 201113Year Member
Posts: 4,994
Reputation Power: 14230
Motto: Wow crazy USA hamburger yes
Motto: Wow crazy USA hamburger yes
Status: Offline
Joined: Apr 09, 201113Year Member
Posts: 4,994
Reputation Power: 14230
Motto: Wow crazy USA hamburger yes
CriticaI wrote If you already know the VOD id you'll probably have better luck scraping the video urls using a stateful scraping tool.

However, if you just want to download random VODs, I was able to find an endpoint that exposes if a VOD actually exists. But you would still need to scrape for the video url afterwards.

1. Go here there is a valid client id in plain sight.
dev.twitch.tv/docs/api

2. then make request to api.twitch.tv/v5/videos/<id>/comments

    curl --request GET 'https://api.twitch.tv/v5/videos/<id>/comments' --header 'client-id: <cid>'


---

You may find some luck looking at other resources related to the VOD, images, thumbnails, etc. Or you could go through the official API and try to find some sort of exploit.


The issue im running into is finding the VOD IDs themselves. All I need is the literally the "vod number" not even a URL because the number (ie: ID) of the VOD is what I need to brute force the clips.

I've gotten lucky like 2-3 times and found the VOD ID in a google cache link or from a clip someone else posted that had it in the url but other than that it's like twitch nukes all references to a VOD once it's deleted, even something as simple as a URL that no longer works.
Users browsing this topic: None
Jump to:


RECENT POSTS

HOT TOPICS