[tumblr] Modernize

pull/3520/merge
Philipp Hagemeister 10 years ago
parent 98676c08a1
commit 3da0e1f8cd

@ -10,7 +10,7 @@ from ..utils import (
class TumblrIE(InfoExtractor): class TumblrIE(InfoExtractor):
_VALID_URL = r'http://(?P<blog_name>.*?)\.tumblr\.com/((post)|(video))/(?P<id>\d*)($|/)' _VALID_URL = r'http://(?P<blog_name>.*?)\.tumblr\.com/(?:post|video)/(?P<id>[0-9]+)(?:$|[/?#])'
_TESTS = [{ _TESTS = [{
'url': 'http://tatianamaslanydaily.tumblr.com/post/54196191430/orphan-black-dvd-extra-behind-the-scenes', 'url': 'http://tatianamaslanydaily.tumblr.com/post/54196191430/orphan-black-dvd-extra-behind-the-scenes',
'md5': '479bb068e5b16462f5176a6828829767', 'md5': '479bb068e5b16462f5176a6828829767',
@ -56,13 +56,15 @@ class TumblrIE(InfoExtractor):
# 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(
webpage, 'title', flags=re.DOTALL) r'(?s)<title>(?P<title>.*?)(?: \| Tumblr)?</title>',
webpage, 'title')
return [{'id': video_id, return {
'url': video_url, 'id': video_id,
'title': video_title, 'url': video_url,
'description': self._html_search_meta('description', webpage), 'title': video_title,
'thumbnail': video_thumbnail, 'description': self._html_search_meta('description', webpage),
'ext': ext 'thumbnail': video_thumbnail,
}] 'ext': ext,
}

Loading…
Cancel
Save