Open sippeangelo opened 8 years ago
/streams don't contain video ID. Don't all people store past broadcasts. It will work incorrect, if stream crash and have more one part. "grabbing the first result" is bad idea, becouse stream ID is not equal video ID.
The result of /videos return a broadcast_id
though, which should match up with _id
from /streams!
ok, but if stream crash and have more one part?
I don't know how your bot operates, but I guess you're polling the API at a certain interval to see when it goes offline? If so, you could store the stream ID's that the stream goes through before it goes offline for real.
If that doesn't work, you could always link the videos returned by where the videos start time + length matches up with another videos start time!
you could store the stream ID's
Yes bot can store, but after show more one link? Text under photo is limited and more one link is bad idea. I can show first link but I don't think that it good idea.
Ah yes, that's true, but I think you should be able to fit at least two links inside the 200 character limit though!
🏁, Hunt for the Bandos Cloak continues , RuneScape https://www.twitch.tv/mmorpgrs https://www.twitch.tv/mmorpgrs/v/77729390 https://www.twitch.tv/mmorpgrs/v/77729390
for example is only 162 characters, and if you remove the link to the livestream (which is no longer needed anyway) you'd fit 3!
its look bad.. easy open site or app and watch. I think link for first part is best solution
Agreed. It's rare for streams to crash anyway and it will be a lot easier to implement.
Ok i try do it.
I try do it, but it bad idea, so many people have more one part of strem. It work unstable for them.
That's a shame. I might have a shot at implementing and running my own fork privately then, since it's sufficient for my own use cases. Thanks anyway for looking into it!
Hopefully in the future I'll find an elegant solution to this problem. Perhaps there will be new features in the API or something else.
It would be super useful if the bot edited the message to link to the VOD of the broadcast after the broadcast has ended!
I don't know about the other services, but Twitch does record and save past broadcasts. Grabbing the first result from the API /channels/:channel/videos while passing
true
to thebroadcasts
parameter to filter out highlights should give you the link. There might be a delay after the stream ends until the video is available though.