Wednesday, August 13, 2014

How to playback any TWITCH VoD WITH AUDIO

No longer works for VoDs stored since August 6th !!!

    Twitch has this nice API for any VoD stored. The following link to their API has all you need to still play any VoD WITH audio: http://api.justin.tv/api/broadcast/by_archive/<VIDEOID>.json. You just have to put the <VIDEOID> in that link which is easy to find by going to any video on Twitch. I will show an example below. Through the API link above you can easily find the urls for the stored 30 minutes video parts in flv format. Look for this: "video_file_url", which is followed by the url you need to playback that part of the video. I usually use VLC for playback of any media and by opening the url found in the API in my browser it will ask me to allow VLC to play the video in the browser. Once allowed it will play perfectly fine WITH the audio that is muted by Twitch when you try to watch the video on their website. I can even watch it within VLC itself instead of in the browser. For any VoD longer than 30 mins, you will find multiple urls in the API link, just look for the next "video_file_url".

    This method above can easily be automated with some code/script as a nice feature to embed on your website or have your chatbot provide a link(s) for your viewers when they post a link in chat to one of your broadcasts muted by Twitch. It only needs to connect to the API, do some regex matching and return the url(s) which can then be used for whatever you wish to do with it.

    I wonder however how Twitch is actually 'legally' covering their ass with the new implementation for VoDs containing unauthorized third-party audio when the audio itself is actually still there. Twitch says to "respect the rights of copyright owners, and are voluntarily undertaking this effort to help protect both our broadcasters and copyright owners.". I doubt muting the audio on their own website player only does the trick for them. I think the way they implemented it is just plain bullshit.

    Now for an example I am going to use the Twitch Weekly - 7/18/2014 - Fishstix, Atrioc, Soma & Carnage (LIVE @ 4PM EDT) broadcast. The link is the following: http://www.twitch.tv/twitch/b/548824097. The number at the end of the link is the <VIDEOID>. So we will use that to get the link to the API for that broadcast, which will then become this link:  http://api.justin.tv/api/broadcast/by_archive/548824097.json. That will bring us here. You will then see a lot of information as shown in the picture below with the urls for all 3 parts of the broadcast:
When you watch this broadcast on Twitch, the muted part is after 30 minutes, because they are saved in 30 minutes parts this would be the second url you find in the picture above. The url for that second part of the broadcast is http://store45.media45.justin.tv/archives/2014-7-18/live_user_twitch_1405715067.flv. With VLC or any other flash plugin you will then be able to watch it in the browser (or within VLC) WITH the audio!

    Notice how you will also see "transcode_file_urls" Those urls are links to lower resolutions of the same video parts (240p, 360p and 480p). Very useful for those with bad internet connection and buffering issues on Twitch. With VLC for example a similar method can be used to watch a LIVE stream with lower resolution to prevent the 'oh so annoying' buffering issue you might get on Twitch. I will however not go into detail on how to do this, but I might explain that some other time.

    For those who want the easy way out, here is a link to a website that does this same 'trick' I explained above by using some code/script and Flowplayer to let you watch VoDs from Twitch WITH audio by just entering the <VIDEOID> as explained above: http://twitchviews.co.uk/

Enjoy!

No comments:

Post a Comment