projects
/
youtube-dl
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
[keek] Make uploader fields non fatal
[youtube-dl]
/
youtube_dl
/
extractor
/
keek.py
diff --git
a/youtube_dl/extractor/keek.py
b/youtube_dl/extractor/keek.py
index 280134a2ae9fde0c8f67d850f0d50c38307d8b00..7e1a3f67c84153592830978427c7c22a13dd645f 100644
(file)
--- a/
youtube_dl/extractor/keek.py
+++ b/
youtube_dl/extractor/keek.py
@@
-1,7
+1,6
@@
+# coding: utf-8
from __future__ import unicode_literals
from __future__ import unicode_literals
-import re
-
from .common import InfoExtractor
from .common import InfoExtractor
@@
-14,7
+13,7
@@
class KeekIE(InfoExtractor):
'info_dict': {
'id': 'NODfbab',
'ext': 'mp4',
'info_dict': {
'id': 'NODfbab',
'ext': 'mp4',
- 'title': 'test chars: "\'/\\
\xe4
<>This is a test video for youtube-dl.For more information, contact phihag@phihag.de . - Video - Videos on Keek',
+ 'title': 'test chars: "\'/\\
รค
<>This is a test video for youtube-dl.For more information, contact phihag@phihag.de . - Video - Videos on Keek',
'description': 'md5:35d42050a3ece241d5ddd7fdcc6fd896',
'uploader': 'ytdl',
'uploader_id': 'eGT5bab',
'description': 'md5:35d42050a3ece241d5ddd7fdcc6fd896',
'uploader': 'ytdl',
'uploader_id': 'eGT5bab',
@@
-25,10
+24,6
@@
class KeekIE(InfoExtractor):
video_id = self._match_id(url)
webpage = self._download_webpage(url, video_id)
video_id = self._match_id(url)
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 {
'id': video_id,
return {
'id': video_id,
@@
-37,6
+32,6
@@
class KeekIE(InfoExtractor):
'title': self._og_search_title(webpage),
'description': self._og_search_description(webpage),
'thumbnail': self._og_search_thumbnail(webpage),
'title': self._og_search_title(webpage),
'description': self._og_search_description(webpage),
'thumbnail': self._og_search_thumbnail(webpage),
- 'uploader':
uploader
,
- 'uploader_id':
uploader_id
,
+ 'uploader':
self._search_regex(r'data-username="([^"]+)"', webpage, 'uploader', fatal=False)
,
+ 'uploader_id':
self._search_regex(r'data-user-id="([^"]+)"', webpage, 'uploader id', fatal=False)
,
}
}