diff options
author | Philipp Hagemeister <phihag@phihag.de> | 2014-02-03 05:19:28 +0100 |
---|---|---|
committer | Philipp Hagemeister <phihag@phihag.de> | 2014-02-03 05:19:28 +0100 |
commit | 8e93b9b9aae0e31f053eaa8c5cbfebfbab2dfbab (patch) | |
tree | 09302efc99e9388de5688c0d5f525ca273a89c70 /youtube_dl/extractor | |
parent | b4bcffefa3883ec469457cf13e500d1180d4931e (diff) | |
parent | 2b39af9b4f8cea51f11fbec726aca0482b671256 (diff) |
Merge remote-tracking branch 'origin/master'
Conflicts:
youtube_dl/extractor/bliptv.py
Diffstat (limited to 'youtube_dl/extractor')
-rw-r--r-- | youtube_dl/extractor/__init__.py | 1 | ||||
-rw-r--r-- | youtube_dl/extractor/bliptv.py | 1 | ||||
-rw-r--r-- | youtube_dl/extractor/tinypic.py | 50 |
3 files changed, 52 insertions, 0 deletions
diff --git a/youtube_dl/extractor/__init__.py b/youtube_dl/extractor/__init__.py index 9b346ac68..073f3a0d1 100644 --- a/youtube_dl/extractor/__init__.py +++ b/youtube_dl/extractor/__init__.py @@ -200,6 +200,7 @@ from .ted import TEDIE from .tf1 import TF1IE from .theplatform import ThePlatformIE from .thisav import ThisAVIE +from .tinypic import TinyPicIE from .toutv import TouTvIE from .traileraddict import TrailerAddictIE from .trilulilu import TriluliluIE diff --git a/youtube_dl/extractor/bliptv.py b/youtube_dl/extractor/bliptv.py index c8234ac31..9c120051c 100644 --- a/youtube_dl/extractor/bliptv.py +++ b/youtube_dl/extractor/bliptv.py @@ -66,6 +66,7 @@ class BlipTVIE(SubtitlesInfoExtractor): json_url = url + cchar + 'skin=json&version=2&no_wrap=1' request = compat_urllib_request.Request(json_url) request.add_header('User-Agent', 'iTunes/10.6.1') + json_data = self._download_json(request, video_id=presumptive_id) if 'Post' in json_data: diff --git a/youtube_dl/extractor/tinypic.py b/youtube_dl/extractor/tinypic.py new file mode 100644 index 000000000..2246d27b2 --- /dev/null +++ b/youtube_dl/extractor/tinypic.py @@ -0,0 +1,50 @@ +from __future__ import unicode_literals + +import re + +from .common import InfoExtractor +from youtube_dl.utils import ExtractorError + + +class TinyPicIE(InfoExtractor): + IE_NAME = 'tinypic' + IE_DESC = 'tinypic.com videos' + _VALID_URL = r'http://tinypic\.com/player\.php\?v=(?P<id>[^&]+)&s=\d+' + + _TEST = { + 'url': 'http://tinypic.com/player.php?v=6xw7tc%3E&s=5#.UtqZmbRFCM8', + 'md5': '609b74432465364e72727ebc6203f044', + 'info_dict': { + 'id': '6xw7tc', + 'ext': 'flv', + 'title': 'shadow phenomenon weird', + } + } + + def _real_extract(self, url): + mobj = re.match(self._VALID_URL, url) + video_id = mobj.group('id') + + webpage = self._download_webpage(url, video_id, 'Downloading page') + + mobj = re.search(r'(?m)fo\.addVariable\("file",\s"(?P<fileid>[\da-z]+)"\);\n' + '\s+fo\.addVariable\("s",\s"(?P<serverid>\d+)"\);', webpage) + if mobj is None: + raise ExtractorError('Video %s does not exist' % video_id, expected=True) + + file_id = mobj.group('fileid') + server_id = mobj.group('serverid') + + KEYWORDS_SUFFIX = ', Video, images, photos, videos, myspace, ebay, video hosting, photo hosting' + keywords = self._html_search_meta('keywords', webpage, 'title') + title = keywords[:-len(KEYWORDS_SUFFIX)] if keywords.endswith(KEYWORDS_SUFFIX) else '' + + video_url = 'http://v%s.tinypic.com/%s.flv' % (server_id, file_id) + thumbnail = 'http://v%s.tinypic.com/%s_th.jpg' % (server_id, file_id) + + return { + 'id': file_id, + 'url': video_url, + 'thumbnail': thumbnail, + 'title': title + }
\ No newline at end of file |