aboutsummaryrefslogtreecommitdiffhomepage
path: root/README.md
blob: c2b2f8dcafc56c058f2d182369f162f3d0b00957 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
Livestreamer
============
Livestreamer is a CLI program that launches streams from various
streaming services in a custom video player.


Installing
----------
    $ sudo python setup.py install
Livestreamer is compatible with Python version >= 2.6 and >= 3.0.


Using
-----
    $ livestreamer --help


Example usage
-------------
Find out what stream qualities are available

    $ livestreamer http://www.twitch.tv/ignproleague
    Found streams: 240p, 360p, 480p, 720p, iphonehigh, iphonelow, live

Now play one of them

    $ livestreamer http://www.twitch.tv/ignproleague 720p

Stream now playbacks in default player (VLC).


Saving arguments AKA config file
--------------------------------
Livestreamer can read arguments from the file ~/.livestreamerrc.
A example file:

    player=mplayer
    jtv-cookie=_jtv3_session_id=arandomhash


Notes
-----
Currently supported sites are:

* Justin.tv/Twitch.tv
* Own3D.tv
* SVTPlay
* UStream
* YouTube

Justin.tv plugin requires rtmpdump with jtv token support (recent git).


Using livestreamer as a library
-------------------------------
Livestreamer is also a library. Short example:

    import livestreamer

    url = "http://twitch.tv/day9tv"
    channel = livestreamer.resolve_url(url)
    streams = channel.get_streams()

    stream = streams["720p"]
    fd = stream.open()

    while True:
        data = fd.read(1024)
        if len(data) == 0:
            break

        # do something with data

    fd.close()