-
Notifications
You must be signed in to change notification settings - Fork 84
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Feature Request] Download clips by Stream ID #42
Comments
Looking into it. |
How do you determine which offsets to scan? I found clips at pretty high offsets, 5000+. |
If I understand it right, Rydan's solution on twitter works like this: |
I don't want to add this to twitch-dl until I fully understand the logic so I've made a new project to play around with it. You need python3.5+. Download the package here. To test, try this out:
Note that
You can leave out the min and max offset, and they will be set to 0 and video length in seconds respectively. |
hmm, tried it out with this vod:
Works with your example, though |
same output with a different vod without offset parameters:
|
I think i know what the issue is, but i don't have any more time to work on this today. Paid job beckons. I'll get around to this later. |
Okay, thanks for helping out! I'm currently playing around with getting stream ids from old vods which are gone to scan them for clips which are still there. Is there any way to convert an old vod id (e.g. 78349737) into a stream id? For me it returns
So that wasn't an issue, sorry.
|
Everything works very well on a good connection, albeit only for one vod at a time... I hope this isn't asking for too much, but could there be an option to pass an array of stream ids from a txt file in which every stream id is on a new line? With the program writing outputs to urls-{stream_id}.txt. Tried to do it myself but couldn't figure it out, would really appreciate help with this. |
@Daniil1288 I added some retries and hopefully fixed the stream_id parsing logic. About your request, I can do that. Could you also provide the stream duration? I don't have a simple way to get stream duration from a stream_id. |
BTW, have you noticed that all clips downloaded this way have a duration of 30 seconds? Also I'm getting some some duplication, e.g. in the example i sent before i get these clips:
Clips at offsets 2694 and 2698 overlap. |
Hey @ihabunek, I guess it would be easier to make it an argument that converts hours into seconds. In my case, the average stream length is 8 hrs, so I have to check offsets from 1 to 28800. The only way to get the length accurately would be to use a third-party website like twitchtracker.com which is where I got my stream IDs from as their https://twitchtracker.com/{streamername}/streams page gives all the required information just like this in one request for all streams for any streamer on the website:
The clips downloaded this way have a duration of 30 seconds because this is how non-customized clips are stored. Customized clips with custom length have this format: AT-cm_363621067 but I don't think there's a way to bruteforce these easily if at all since the number looks to be random and isn't associated with any streamer. Here's Rydan explaining it on twitter. |
The way you get the stream id which you've called 'hacky' in the recent commit is actually perfectly normal, that's how most twitch clip downloaders used to work iirc, i.e. by splitting the thumbnail URL. |
https://git.sr.ht/~ihabunek/clips-dl/refs/0.3.0/clips-dl.0.3.0.pyz I made searching for clips for the whole channel.
For example:
Still just outputs urls, does not download. You can still download for a single video id:
|
Tips:
|
You've hardcoded the bananasaurus_rex argument by mistake, I think: |
503'd on the fourth stream after letting it run for an hour with -w 10. |
LOL about hardcoded channel. I'll handle the exception. Don't know if I'll have time today. Probably over the weekend. |
Hello, hope you're doing well, is there a possibility you'll handle the exception any time soon? It's very usable if it weren't for it crashing every now and then. |
@Daniil1288 Sorry, got distracted by other stuff. Here's a new version which should solve the retries (retry on any error, not only timeout), removes the hardcoded channel name and adds options for retries and timeout. https://git.sr.ht/~ihabunek/clips-dl/refs/0.4.0/clips-dl.0.4.0.pyz
|
Hey, ran it for a while, it managed to do thirty or so vods and then errored out with this:
Twitch was down for a while, this is why. |
Okay, it still works, it's just that some older clips got deleted, it looks like. |
Hey, so with all this DMCA stuff going on many streamers nuked their clips.
However, it's still possible to download them by using a Stream ID like this:
https://pastebin.com/H25NPesp
Could it be possible to implement such a useful feature? Check stream IDs on this website: twitchtracker.com
The text was updated successfully, but these errors were encountered: