aboutsummaryrefslogtreecommitdiffhomepage
path: root/README.md
diff options
context:
space:
mode:
authorGravatar Christopher Rosell <chrippa@tanuki.se>2012-03-21 22:49:15 +0100
committerGravatar Christopher Rosell <chrippa@tanuki.se>2012-03-21 22:49:15 +0100
commitedfc2de50a4a15fc883a57dffed1e1ae60e93fc9 (patch)
tree8402d30dd8b5b0c6d4241cd9df542b95e0b1ba7c /README.md
parent1f413ed99ca82fc35e004b627654e3e41b8704a2 (diff)
Make livestreamer more usable as a library.
Diffstat (limited to 'README.md')
-rw-r--r--README.md23
1 files changed, 23 insertions, 0 deletions
diff --git a/README.md b/README.md
index 7a282eb..a04b0aa 100644
--- a/README.md
+++ b/README.md
@@ -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()
+