]> jfr.im git - yt-dlp.git/commitdiff
[bilibili] Fix uploader
authorpukkandan <redacted>
Thu, 8 Apr 2021 07:51:02 +0000 (13:21 +0530)
committerpukkandan <redacted>
Thu, 8 Apr 2021 07:52:04 +0000 (13:22 +0530)
Related: https://github.com/yt-dlp/yt-dlp/issues/222

yt_dlp/extractor/bilibili.py

index 554a5700593924d5b15be0c14180257fd7c5ccd5..0029a7e49bd3934f316ab351c484c21e2c8d73ec 100644 (file)
@@ -120,6 +120,7 @@ class BiliBiliIE(InfoExtractor):
         'url': 'https://www.bilibili.com/video/BV1bK411W797',
         'info_dict': {
             'id': 'BV1bK411W797',
+            'title': '物语中的人物是如何吐槽自己的OP的'
         },
         'playlist_count': 17,
     }]
@@ -156,7 +157,8 @@ def _real_extract(self, url):
                 if r is not None:
                     self.to_screen('Downloading anthology %s - add --no-playlist to just download video' % video_id)
                     return r
-            self.to_screen('Downloading just video %s because of --no-playlist' % video_id)
+            else:
+                self.to_screen('Downloading just video %s because of --no-playlist' % video_id)
 
         if 'anime/' not in url:
             cid = self._search_regex(
@@ -274,7 +276,7 @@ def _real_extract(self, url):
         }
 
         uploader_mobj = re.search(
-            r'<a[^>]+href="(?:https?:)?//space\.bilibili\.com/(?P<id>\d+)"[^>]*>(?P<name>[^<]+)',
+            r'<a[^>]+href="(?:https?:)?//space\.bilibili\.com/(?P<id>\d+)"[^>]*>\s*(?P<name>[^<]+?)\s*<',
             webpage)
         if uploader_mobj:
             info.update({