View | Details | Raw Unified | Return to bug 196828
Collapse All | Expand All

(-)./Makefile (-1 / +1 lines)
Lines 2-8 Link Here
2
# $FreeBSD: head/multimedia/livestreamer/Makefile 374600 2014-12-12 17:15:45Z nox $
2
# $FreeBSD: head/multimedia/livestreamer/Makefile 374600 2014-12-12 17:15:45Z nox $
3
3
4
PORTNAME=	livestreamer
4
PORTNAME=	livestreamer
5
PORTVERSION=	1.11.0
5
PORTVERSION=	1.11.1
6
CATEGORIES=	multimedia python
6
CATEGORIES=	multimedia python
7
MASTER_SITES=	CHEESESHOP
7
MASTER_SITES=	CHEESESHOP
8
PKGNAMEPREFIX=	${PYTHON_PKGNAMEPREFIX}
8
PKGNAMEPREFIX=	${PYTHON_PKGNAMEPREFIX}
(-)./distinfo (-2 / +2 lines)
Lines 1-2 Link Here
1
SHA256 (livestreamer-1.11.0.tar.gz) = 5af677ec93ebce229ac235ea6c23aec915deb4aacc8bdb8418c8488fbdd96920
1
SHA256 (livestreamer-1.11.1.tar.gz) = 84dd83d301518ffcf96f30cbffc0e0598e0756e7ab8e7498d11285d42fe17f9c
2
SIZE (livestreamer-1.11.0.tar.gz) = 421706
2
SIZE (livestreamer-1.11.1.tar.gz) = 421719
(-)./files/patch-bbc6d0e7c1a8b6bf053345e88366cae115baa2d3 (-54 lines)
Lines 1-54 Link Here
1
From bbc6d0e7c1a8b6bf053345e88366cae115baa2d3 Mon Sep 17 00:00:00 2001
2
From: Christopher Rosell <chrippa@tanuki.se>
3
Date: Fri, 12 Dec 2014 00:14:43 +0100
4
Subject: [PATCH] plugins.twitch: Update for API change.
5
6
Resolves #633.
7
---
8
 src/livestreamer/plugins/twitch.py | 17 +++++++++--------
9
 1 file changed, 9 insertions(+), 8 deletions(-)
10
11
diff --git a/src/livestreamer/plugins/twitch.py b/src/livestreamer/plugins/twitch.py
12
index ca0d2bd..0adc872 100644
13
--- a/src/livestreamer/plugins/twitch.py
14
+++ b/src/livestreamer/plugins/twitch.py
15
@@ -125,8 +125,8 @@ def time_to_offset(t):
16
 
17
 
18
 class UsherService(object):
19
-    def _create_url(self, endpoint, asset, **extra_params):
20
-        url = "http://usher.twitch.tv/{0}/{1}".format(endpoint, asset)
21
+    def _create_url(self, endpoint, **extra_params):
22
+        url = "http://usher.twitch.tv{0}".format(endpoint)
23
         params = {
24
             "player": "twitchweb",
25
             "p": int(random() * 999999),
26
@@ -145,11 +145,12 @@ def _create_url(self, endpoint, asset, **extra_params):
27
 
28
         return req.url
29
 
30
-    def select(self, channel, **extra_params):
31
-        return self._create_url("select", channel, **extra_params)
32
+    def channel(self, channel, **extra_params):
33
+        return self._create_url("/api/channel/hls/{0}.m3u8".format(channel),
34
+                                **extra_params)
35
 
36
-    def vod(self, vod_id, **extra_params):
37
-        return self._create_url("vod", vod_id, **extra_params)
38
+    def video(self, video_id, **extra_params):
39
+        return self._create_url("/vod/{0}".format(video_id), **extra_params)
40
 
41
 
42
 class TwitchAPI(object):
43
@@ -417,9 +418,9 @@ def _get_hls_streams(self, type="live"):
44
         self._authenticate()
45
         sig, token = self._access_token(type)
46
         if type == "live":
47
-            url = self.usher.select(self.channel, nauthsig=sig, nauth=token)
48
+            url = self.usher.channel(self.channel, sig=sig, token=token)
49
         elif type == "video":
50
-            url = self.usher.vod(self.video_id, nauthsig=sig, nauth=token)
51
+            url = self.usher.video(self.video_id, nauthsig=sig, nauth=token)
52
 
53
         try:
54
             streams = HLSStream.parse_variant_playlist(self.session, url)

Return to bug 196828