[periscope] Add support for videos with broadcast_id (Closes #7359)
authorSergey M․ <dstftw@gmail.com>
Wed, 4 Nov 2015 20:51:30 +0000 (02:51 +0600)
committerSergey M․ <dstftw@gmail.com>
Wed, 4 Nov 2015 20:51:30 +0000 (02:51 +0600)
youtube_dl/extractor/periscope.py

index 8ad9367584e3c7f5e524baf3fb5333b1b2819a5d..0f9d7576fae0a312a419428e551e0d4afdee756f 100644 (file)
@@ -27,9 +27,10 @@ class PeriscopeIE(InfoExtractor):
         'skip': 'Expires in 24 hours',
     }
 
-    def _call_api(self, method, token):
+    def _call_api(self, method, value):
+        attribute = 'token' if len(value) > 13 else 'broadcast_id'
         return self._download_json(
-            'https://api.periscope.tv/api/v2/%s?token=%s' % (method, token), token)
+            'https://api.periscope.tv/api/v2/%s?%s=%s' % (method, attribute, value), value)
 
     def _real_extract(self, url):
         token = self._match_id(url)