diff options
author | Christopher Rosell <chrippa@tanuki.se> | 2012-03-21 22:49:15 +0100 |
---|---|---|
committer | Christopher Rosell <chrippa@tanuki.se> | 2012-03-21 22:49:15 +0100 |
commit | edfc2de50a4a15fc883a57dffed1e1ae60e93fc9 (patch) | |
tree | 8402d30dd8b5b0c6d4241cd9df542b95e0b1ba7c /README.md | |
parent | 1f413ed99ca82fc35e004b627654e3e41b8704a2 (diff) |
Make livestreamer more usable as a library.
Diffstat (limited to 'README.md')
-rw-r--r-- | README.md | 23 |
1 files changed, 23 insertions, 0 deletions
@@ -47,3 +47,26 @@ Currently supported sites are: 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"] + stream.open() + + while True: + data = stream.read(1024) + if len(data) == 0: + break + + # do something with data + + stream.close() + |