diff options
| author | Pierre Rudloff <contact@rudloff.pro> | 2013-08-24 23:01:39 +0200 | 
|---|---|---|
| committer | Pierre Rudloff <contact@rudloff.pro> | 2013-08-24 23:01:39 +0200 | 
| commit | 5c6658d4dd5ea4f25e8ae8b62a47b09f164cd30b (patch) | |
| tree | 1d96bd8eb6b4cb941ba11d8e80a961878ffb1cdc /youtube_dl/extractor/ro220.py | |
| parent | adeb9c73d638090349243383eca0c3c7ebc1e6bc (diff) | |
| parent | 9585f890f8c0eff70eb874c7962dc30baea1049c (diff) | |
Merge remote-tracking branch 'upstream/master'
Diffstat (limited to 'youtube_dl/extractor/ro220.py')
| -rw-r--r-- | youtube_dl/extractor/ro220.py | 42 | 
1 files changed, 42 insertions, 0 deletions
| diff --git a/youtube_dl/extractor/ro220.py b/youtube_dl/extractor/ro220.py new file mode 100644 index 000000000..c32f64d99 --- /dev/null +++ b/youtube_dl/extractor/ro220.py @@ -0,0 +1,42 @@ +import re + +from .common import InfoExtractor +from ..utils import ( +    clean_html, +    compat_parse_qs, +) + + +class Ro220IE(InfoExtractor): +    IE_NAME = '220.ro' +    _VALID_URL = r'(?x)(?:https?://)?(?:www\.)?220\.ro/(?P<category>[^/]+)/(?P<shorttitle>[^/]+)/(?P<video_id>[^/]+)' +    _TEST = { +        u"url": u"http://www.220.ro/sport/Luati-Le-Banii-Sez-4-Ep-1/LYV6doKo7f/", +        u'file': u'LYV6doKo7f.mp4', +        u'md5': u'03af18b73a07b4088753930db7a34add', +        u'info_dict': { +            u"title": u"Luati-le Banii sez 4 ep 1", +            u"description": u"Iata-ne reveniti dupa o binemeritata vacanta. Va astept si pe Facebook cu pareri si comentarii.", +        } +    } + +    def _real_extract(self, url): +        mobj = re.match(self._VALID_URL, url) +        video_id = mobj.group('video_id') + +        webpage = self._download_webpage(url, video_id) +        flashVars_str = self._search_regex( +            r'<param name="flashVars" value="([^"]+)"', +            webpage, u'flashVars') +        flashVars = compat_parse_qs(flashVars_str) + +        info = { +            '_type': 'video', +            'id': video_id, +            'ext': 'mp4', +            'url': flashVars['videoURL'][0], +            'title': flashVars['title'][0], +            'description': clean_html(flashVars['desc'][0]), +            'thumbnail': flashVars['preview'][0], +        } +        return info | 
