Watch justin.tv on VLC Player

December 15, 2011

For those of you who always wanted to watch/record Live Streams from justin.tv I wrote this tutorial. It is a bit of work to do and you have to decide wether it is worth it or not. First of all you need rtmpdump. Unzip that and change to its working directory in your cmd prompt. The main command to pipe the Stream you are about to watch to VLC is this:

$rtmpdump -r "RTMP adress" --jtv "usher token"
--swfUrl "swf adress" -o - | "local VLC adress" -

The RTMP adress can be found in the XML document at http://usher.justin.tv/find/”stream”.xml?type=any under “connect” where “stream” is the name of the stream you want to watch. In this XML you will also find the usher token under “token”. It is important that you use escape characters at some point there. For the swf adress you have to open the streampage htmlcode and search for “swfobject” in it. The local VLC adress pretty much explains itself. Have fun watching your favorite streams in VLC!

Update: For those of you who to pipe twitch.tv use the following cmd:

$rtmpdump -r "RTMP adress" -a "app" -f "WIN 11,0,1,152" -W "swf adress" -p "channel adress" -j "usher token" --live -y "playpath out of token" -o - | "local VLC adress" -

And last but not least there is also a plugin to watch megavideo with your VLC: megavideo.lua

About these ads

20 Responses to “Watch justin.tv on VLC Player”

  1. benny said

    nice post….thanks

    but got the token from the .xml file but I have no idea how to “use escape characters ” in message you’ve mentioned…

    can you give me some ideas how to convert?

    thanks.
    benny

  2. geldmacher said

    I am at work right now but I will provide an example connection to you as soon as I am back at home.

    It is basically just a backslash. Like this \’ instead of just ‘ in that string.

  3. justin.tv example:

    rtmpdump -r “rtmp://199.9.249.172/app/jtv_ju2EG2gWorOlrczy” –jtv “8ee618d6d1c782b39f758dd56259867cd9e82d95:{\”swfDomains\”: [\"justin.tv\", \"jtvx.com\", \"xarth.com\", \"twitchtv.com\", \"twitch.tv\", \"newjtv.com\", \"wdtinc.com\", \"imapweather.com\", \"facebook.com\", \"starcrafting.com\"], \”streamName\”: \”jtv_ju2EG2gWorOlrczy\”, \”expiration\”: 1323992973.4706509, \”geo_ip\”: \”88.73.151.2\”, \”server\”: \”video66-1\”}” –swfUrl “http://www-cdn.justin.tv/widgets/live_frontpage_player.r2313ee4f9e3aece3d137ed336572a68d20dd9e88.swf” -o – | “C:\Program Files (x86)\VideoLAN\vlc.exe” -

    twitch.tv example:

    rtmpdump -r “rtmp://199.9.255.43/app” -a “app” -f “WIN 11,0,1,152″ -W “http://www-cdn.justin.tv/widgets/live_site_player.rc4b0693101e4b5c2aaf35840d31f17b899da9e14.swf” -p “http://de.twitch.tv/moonmeander” -j “9334427ab9de6ff8bcf3d607062621a7978f4e8e:{\”swfDomains\”: [\"justin.tv\", \"jtvx.com\", \"xarth.com\", \"twitchtv.com\", \"twitch.tv\", \"newjtv.com\", \"wdtinc.com\", \"imapweather.com\", \"facebook.com\", \"starcrafting.com\"], \”streamName\”: \”jtv_85Zl4ugHiVRfi4Y2\”, \”expiration\”: 1324045419.0868039, \”server\”: \”iad01-video7-1\”}” –live -y “jtv_85Zl4ugHiVRfi4Y2″ -o – | “C:\Program Files (x86)\VideoLAN\vlc.exe” -

  4. Daniel said

    I wrote a Python script that generates these command lines for rtmpdump
    http://pastebin.com/wXuu57YN

    Thanks for the tip :)

  5. rol said

    Error message when using the script:

    mint12 ~ $ ./justin.py -u de.justin.tv/mychannel

    Traceback (most recent call last):
    File “./justin.py”, line 144, in
    streamId, streamService = getStreamBasicInfo(url)
    File “./justin.py”, line 69, in getStreamBasicInfo
    streamingService = r.group(1);
    AttributeError: ‘NoneType’ object has no attribute ‘group’

  6. Gontran said

    @rol: line 68 you need to replace:
    r = re.search(‘(twitch.tv|twitch.tv)\/([\w\d\-_]+)’, url)
    by
    r = re.search(‘(twitch.tv|justin.tv)\/([\w\d\-_]+)’, url)

  7. dddddd said

    Your link doesn’t work any more…

  8. John Peterson said

    Thanks!

    Regarding the missing Python script, there’s an equivalent bash script here[http://command-line-tools.googlecode.com/git/jtv.sh].

    • tim said

      im having trouble executing your script, since “stream.xml” seems to be empty:

      bash jtv.sh channel theprohacker

      XPath set is empty
      warning: failed to load external entity “stream.xml”
      jtv.sh: Zeile 17: ((: i<: Syntax Fehler: Operator erwartet. (Fehlerverursachendes Zeichen ist \"<\").

  9. I’d like to thank you for your post John and also thanks to everyone else keeping this topic alive.

    Because there is still a huge interest on this topic you should check out https://github.com/chrippa/livestreamer

    Just make sure you are using the new rtmpdump 2.4, because they just added jtv support. It works for linux as well as for windows and supports all major streaming platforms (justin/twitch, own3d, Ustream etc.)

  10. trashn said

    Pretty cool, thanks!

    Can I somehow choose the bitrate when there are multiple choices? (240p, 360p, 480p, etc)

  11. Aldwyn said

    I want to grab a stream from twitch.tv, and then broadcast it over my own network to a media device.

    I can use livestreamer to grab the stream, and I can broadcast from VLC to my device.
    But I cant figure out how to do both at the same time.

    When i start broadcasting from VLC, I have to select an input – file or network location.
    But since livestreamer is starting VLC up automatically, I don’t know what to select as input.

    Can anyone help, or maybe provide another solution?

    • Aldwyn said

      Looking into it a bit more, it seems VLC is getting data from fd://0
      However, if I reload it, it doesn’t seem to work – even if i don’t close the player, and the stream hasn’t ended.

  12. MaReTl said

    In wich way do you get the Hash og the Stream_ID.
    I try to download a stream but i don´t get the Stream_ID

    Greetz

  13. What’s up, its nice paragraph on the topic of media print, we all know media is a enormous source of information.

  14. Debbie said

    I loved as much as you will receive carried out right here.
    The sketch is tasteful, your authored subject matter stylish.
    nonetheless, you command get got an nervousness over that
    you wish be delivering the following. unwell
    unquestionably come further formerly again as exactly the same nearly very often inside case you shield this hike.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

%d bloggers like this: