]>
Commit | Line | Data |
---|---|---|
7aed8375 JMF |
1 | from __future__ import unicode_literals |
2 | ||
9460db83 | 3 | from .common import InfoExtractor |
8c25f81b | 4 | from ..compat import compat_urllib_parse_unquote |
9460db83 PH |
5 | |
6 | ||
7 | class Ro220IE(InfoExtractor): | |
8 | IE_NAME = '220.ro' | |
b8a618f8 | 9 | _VALID_URL = r'(?x)(?:https?://)?(?:www\.)?220\.ro/(?P<category>[^/]+)/(?P<shorttitle>[^/]+)/(?P<id>[^/]+)' |
9460db83 | 10 | _TEST = { |
b8a618f8 | 11 | 'url': 'http://www.220.ro/sport/Luati-Le-Banii-Sez-4-Ep-1/LYV6doKo7f/', |
7aed8375 JMF |
12 | 'md5': '03af18b73a07b4088753930db7a34add', |
13 | 'info_dict': { | |
b8a618f8 NJ |
14 | 'id': 'LYV6doKo7f', |
15 | 'ext': 'mp4', | |
16 | 'title': 'Luati-le Banii sez 4 ep 1', | |
ec85ded8 | 17 | 'description': r're:^Iata-ne reveniti dupa o binemeritata vacanta\. +Va astept si pe Facebook cu pareri si comentarii.$', |
9460db83 PH |
18 | } |
19 | } | |
20 | ||
21 | def _real_extract(self, url): | |
b8a618f8 | 22 | video_id = self._match_id(url) |
9460db83 PH |
23 | |
24 | webpage = self._download_webpage(url, video_id) | |
b8a618f8 NJ |
25 | url = compat_urllib_parse_unquote(self._search_regex( |
26 | r'(?s)clip\s*:\s*{.*?url\s*:\s*\'([^\']+)\'', webpage, 'url')) | |
27 | title = self._og_search_title(webpage) | |
28 | description = self._og_search_description(webpage) | |
29 | thumbnail = self._og_search_thumbnail(webpage) | |
30 | ||
31 | formats = [{ | |
32 | 'format_id': 'sd', | |
33 | 'url': url, | |
34 | 'ext': 'mp4', | |
35 | }] | |
9460db83 | 36 | |
7aed8375 | 37 | return { |
9460db83 | 38 | 'id': video_id, |
b8a618f8 NJ |
39 | 'formats': formats, |
40 | 'title': title, | |
41 | 'description': description, | |
42 | 'thumbnail': thumbnail, | |
9460db83 | 43 | } |