]> gitweb @ CieloNegro.org - youtube-dl.git/commitdiff
[periscope] Update uploader_id (Closes #9565)
authorSergey M․ <dstftw@gmail.com>
Sat, 21 May 2016 20:39:15 +0000 (02:39 +0600)
committerSergey M․ <dstftw@gmail.com>
Sat, 21 May 2016 20:39:15 +0000 (02:39 +0600)
youtube_dl/extractor/periscope.py

index b2008deccb9c66dd854abe61197f741305c6d6b1..c23b314e79df70e6b115fee6fb91386345d00ad4 100644 (file)
@@ -45,8 +45,11 @@ class PeriscopeIE(InfoExtractor):
         broadcast = broadcast_data['broadcast']
         status = broadcast['status']
 
-        uploader = broadcast.get('user_display_name') or broadcast_data.get('user', {}).get('display_name')
-        uploader_id = broadcast.get('user_id') or broadcast_data.get('user', {}).get('id')
+        user = broadcast_data.get('user', {})
+
+        uploader = broadcast.get('user_display_name') or user.get('display_name')
+        uploader_id = (broadcast.get('username') or user.get('username') or
+                       broadcast.get('user_id') or user.get('id'))
 
         title = '%s - %s' % (uploader, status) if uploader else status
         state = broadcast.get('state').lower()