1
mirror of https://github.com/streamlink/streamlink synced 2024-11-16 05:03:49 +01:00
streamlink/README.md

82 lines
2.0 KiB
Markdown
Raw Normal View History

2012-01-19 23:29:28 +01:00
Livestreamer
============
2012-05-27 20:12:40 +02:00
Livestreamer is a CLI program that launches streams from various
streaming services in a custom video player.
2012-01-19 23:29:28 +01:00
Currently supported sites are:
* Justin.tv/Twitch.tv
* Own3d.tv
* SVTPlay
* UStream
* YouTube
Note: Justin.tv plugin requires rtmpdump with jtv token support (recent git).
2012-01-19 23:29:28 +01:00
2012-05-27 20:12:40 +02:00
Livestreamer is compatible with Python version >= 2.6 and >= 3.0.
2012-01-19 23:29:28 +01:00
Installing (Linux, OS X etc)
----------
Make sure you have Python and Python setuptools then run:
$ sudo python setup.py install
2012-01-19 23:29:28 +01:00
Installing (Windows)
--------------------
1. Install Python
2. Install Python setuptools
3. Get rtmpdump and unpack it somewhere (rtmpdump-20110925-git-6230845-win32.zip from http://rtmpdump.mplayerhq.hu/ should work)
4. Add these paths to your Path environment variable:
* [Python path]\
* [Python path]\scripts\
* [rtmpdump path]\ (or specify full path with --rtmpdump option)
* [VLC/mplayer/other path]\ (or specify full path with --player option)
2012-01-19 23:29:28 +01:00
5. Open a command prompt and change directory to livestreamer source, then run:
2012-06-18 19:38:05 +02:00
python setup.py install
2012-01-19 23:29:28 +01:00
Note: If you want to use VLC be aware there is currently a bug in version 2.0.1/2.0.2
that prevents stdin reading from working. The bug has been fixed in version 2.0.3.
2012-01-19 23:29:28 +01:00
Using
-----
$ livestreamer --help
2012-01-19 23:29:28 +01:00
Saving arguments AKA config file
--------------------------------
Livestreamer can read arguments from the file ~/.livestreamerrc (POSIX) or %APPDATA%\livestreamer\livestreamerrc (Windows).
2012-01-19 23:29:28 +01:00
A example file:
player=mplayer
jtv-cookie=_jtv3_session_id=arandomhash
Using livestreamer as a library
-------------------------------
Livestreamer is also a library. Short example:
2012-08-23 22:46:06 +02:00
from livestreamer import *
url = "http://twitch.tv/day9tv"
2012-08-23 22:46:06 +02:00
livestreamer = Livestreamer()
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()