Removed storage to "thumbnail" key and some cosmetic changes
This commit is contained in:
parent
9f8b88ac15
commit
c748ee85af
@ -38,16 +38,11 @@ class TumblrIE(InfoExtractor):
|
|||||||
thumb_list = []
|
thumb_list = []
|
||||||
ma = re.search(r'posters.*?\[(?P<thumb>\\x22.*?\\x22)]', webpage)
|
ma = re.search(r'posters.*?\[(?P<thumb>\\x22.*?\\x22)]', webpage)
|
||||||
if not ma is None:
|
if not ma is None:
|
||||||
for t in ma.group('thumb').replace('\\\\/', '/').split(','):
|
for t in ma.group('thumb').replace(r'\\/', '/').split(','):
|
||||||
t = t.replace('\\x22','"')
|
t = t.replace(r'\x22','"')
|
||||||
if (t[0] == '"') and (t[-1] == '"'):
|
if (t[0] == '"') and (t[-1] == '"'):
|
||||||
thumb_list.append(t[1:-1])
|
thumb_list.append(t[1:-1])
|
||||||
|
|
||||||
# take the first, if user only wants one
|
|
||||||
single_thumb = None
|
|
||||||
if len(thumb_list)>0:
|
|
||||||
single_thumb = thumb_list[0]
|
|
||||||
|
|
||||||
# The only place where you can get a title, it's not complete,
|
# The only place where you can get a title, it's not complete,
|
||||||
# but searching in other places doesn't work for all videos
|
# but searching in other places doesn't work for all videos
|
||||||
video_title = self._html_search_regex(r'<title>(?P<title>.*?)(?: \| Tumblr)?</title>',
|
video_title = self._html_search_regex(r'<title>(?P<title>.*?)(?: \| Tumblr)?</title>',
|
||||||
@ -57,6 +52,5 @@ class TumblrIE(InfoExtractor):
|
|||||||
'url': video_url,
|
'url': video_url,
|
||||||
'title': video_title,
|
'title': video_title,
|
||||||
'thumbnails': thumb_list,
|
'thumbnails': thumb_list,
|
||||||
'thumbnail': single_thumb,
|
|
||||||
'ext': ext
|
'ext': ext
|
||||||
}]
|
}]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user