mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2024-12-02 16:11:11 -05:00
[keek] extract uploader and uploader id with _search_regex
This commit is contained in:
parent
f30e9976d6
commit
98e1c935a1
1 changed files with 2 additions and 8 deletions
|
@ -1,8 +1,6 @@
|
||||||
# coding: utf-8
|
# coding: utf-8
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
import re
|
|
||||||
|
|
||||||
from .common import InfoExtractor
|
from .common import InfoExtractor
|
||||||
|
|
||||||
|
|
||||||
|
@ -26,10 +24,6 @@ def _real_extract(self, url):
|
||||||
video_id = self._match_id(url)
|
video_id = self._match_id(url)
|
||||||
|
|
||||||
webpage = self._download_webpage(url, video_id)
|
webpage = self._download_webpage(url, video_id)
|
||||||
uploader = uploader_id = None
|
|
||||||
matches = re.search(r'data-username="(?P<uploader>[^"]+)"[^>]*data-user-id="(?P<uploader_id>[^"]+)"', webpage)
|
|
||||||
if matches:
|
|
||||||
uploader, uploader_id = matches.groups()
|
|
||||||
|
|
||||||
return {
|
return {
|
||||||
'id': video_id,
|
'id': video_id,
|
||||||
|
@ -38,6 +32,6 @@ def _real_extract(self, url):
|
||||||
'title': self._og_search_title(webpage),
|
'title': self._og_search_title(webpage),
|
||||||
'description': self._og_search_description(webpage),
|
'description': self._og_search_description(webpage),
|
||||||
'thumbnail': self._og_search_thumbnail(webpage),
|
'thumbnail': self._og_search_thumbnail(webpage),
|
||||||
'uploader': uploader,
|
'uploader': self._search_regex(r'data-username="([^"]+)"', webpage, 'uploader', None),
|
||||||
'uploader_id': uploader_id,
|
'uploader_id': self._search_regex(r'data-user-id="([^"]+)"', webpage, 'uploader id', None),
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue