diff options
author | megustamucho <megustamucho@users.noreply.github.com> | 2014-09-20 22:41:45 +1000 |
---|---|---|
committer | megustamucho <megustamucho@users.noreply.github.com> | 2014-09-20 22:41:45 +1000 |
commit | 34e14a9beb3abe76bcda1154030978979c6c1d1d (patch) | |
tree | b773b8f873084056eea80826e776569de90ec090 /youtube_dl/extractor/tumblr.py | |
parent | a8aa99442f0bd6e3c65bd6c464dfd0a87c99f65d (diff) | |
parent | ffb5b05db1f55b9b6e188d2c86befe0493829927 (diff) | |
download | youtube-dl-34e14a9beb3abe76bcda1154030978979c6c1d1d.tar.xz |
Merge remote-tracking branch 'upstream/master'
Diffstat (limited to 'youtube_dl/extractor/tumblr.py')
-rw-r--r-- | youtube_dl/extractor/tumblr.py | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/youtube_dl/extractor/tumblr.py b/youtube_dl/extractor/tumblr.py index 2882c1809..306fe8974 100644 --- a/youtube_dl/extractor/tumblr.py +++ b/youtube_dl/extractor/tumblr.py @@ -10,7 +10,7 @@ from ..utils import ( 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 = [{ 'url': 'http://tatianamaslanydaily.tumblr.com/post/54196191430/orphan-black-dvd-extra-behind-the-scenes', 'md5': '479bb068e5b16462f5176a6828829767', @@ -56,13 +56,15 @@ class TumblrIE(InfoExtractor): # The only place where you can get a title, it's not complete, # but searching in other places doesn't work for all videos - video_title = self._html_search_regex(r'<title>(?P<title>.*?)(?: \| Tumblr)?</title>', - webpage, 'title', flags=re.DOTALL) + video_title = self._html_search_regex( + r'(?s)<title>(?P<title>.*?)(?: \| Tumblr)?</title>', + webpage, 'title') - return [{'id': video_id, - 'url': video_url, - 'title': video_title, - 'description': self._html_search_meta('description', webpage), - 'thumbnail': video_thumbnail, - 'ext': ext - }] + return { + 'id': video_id, + 'url': video_url, + 'title': video_title, + 'description': self._html_search_meta('description', webpage), + 'thumbnail': video_thumbnail, + 'ext': ext, + } |