mirror of
https://codeberg.org/polarisfm/youtube-dl
synced 2024-11-23 00:54:31 +01:00
[narando] extract thumbnails
This commit is contained in:
parent
83809b6ee1
commit
9d5e117c16
@ -6,6 +6,7 @@ from .common import InfoExtractor
|
|||||||
|
|
||||||
class NarandoIE(InfoExtractor):
|
class NarandoIE(InfoExtractor):
|
||||||
IE_NAME = 'narando'
|
IE_NAME = 'narando'
|
||||||
|
_THUMB_SIZES = ('small', 'square', 'medium', 'big', 'original')
|
||||||
_VALID_URL = r'https?://narando\.com/widget\?.*?r=(?P<id>\w+)&?'
|
_VALID_URL = r'https?://narando\.com/widget\?.*?r=(?P<id>\w+)&?'
|
||||||
_TEST = {
|
_TEST = {
|
||||||
'url': 'https://narando.com/widget?r=b2t4t789kxgy9g7ms4rwjvvw',
|
'url': 'https://narando.com/widget?r=b2t4t789kxgy9g7ms4rwjvvw',
|
||||||
@ -22,11 +23,22 @@ class NarandoIE(InfoExtractor):
|
|||||||
webpage = self._download_webpage(url, video_id)
|
webpage = self._download_webpage(url, video_id)
|
||||||
title = self._html_search_regex(r'<span class="clip-title">(.+?)</span>', webpage, 'title')
|
title = self._html_search_regex(r'<span class="clip-title">(.+?)</span>', webpage, 'title')
|
||||||
download_url = self._html_search_regex(r'<div class="stream_url hide">(.+)</div>', webpage, 'download_url')
|
download_url = self._html_search_regex(r'<div class="stream_url hide">(.+)</div>', webpage, 'download_url')
|
||||||
|
thumbnail_id = self._html_search_regex(r'article_picture\/(.+?)\/small\.jpg', webpage, 'thumbnail_id', fatal=False)
|
||||||
|
thumbnail_dict = []
|
||||||
|
thumb_id = 0
|
||||||
|
for size in self._THUMB_SIZES:
|
||||||
|
thumbnail_dict.append({
|
||||||
|
'url': 'https://static.narando.com/article_picture/' + thumbnail_id + '/' + size + '.jpg',
|
||||||
|
'id': size,
|
||||||
|
'preference': thumb_id,
|
||||||
|
})
|
||||||
|
thumb_id += 1
|
||||||
return {
|
return {
|
||||||
'id': video_id,
|
'id': video_id,
|
||||||
'title': title,
|
'title': title,
|
||||||
'url': download_url,
|
'url': download_url,
|
||||||
'vcodec': 'none',
|
'vcodec': 'none',
|
||||||
|
'thumbnails': thumbnail_dict,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -44,7 +56,7 @@ class NarandoArticleIE(InfoExtractor):
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
'url': 'https://narando.com/r/b2t4t789kxgy9g7ms4rwjvvw', #alternate URL format
|
'url': 'https://narando.com/r/b2t4t789kxgy9g7ms4rwjvvw', # alternate URL format
|
||||||
'md5': 'd20f671f0395bab8f8285d1f6e8f965e',
|
'md5': 'd20f671f0395bab8f8285d1f6e8f965e',
|
||||||
'info_dict': {
|
'info_dict': {
|
||||||
'id': 'b2t4t789kxgy9g7ms4rwjvvw',
|
'id': 'b2t4t789kxgy9g7ms4rwjvvw',
|
||||||
|
Loading…
Reference in New Issue
Block a user