2014-01-31 14:07:58 +01:00
|
|
|
from __future__ import unicode_literals
|
|
|
|
|
2013-08-24 21:10:03 +02:00
|
|
|
from .common import InfoExtractor
|
2014-11-02 11:23:40 +01:00
|
|
|
from ..compat import compat_urllib_parse_unquote
|
2013-08-24 21:10:03 +02:00
|
|
|
|
|
|
|
|
|
|
|
class Ro220IE(InfoExtractor):
|
|
|
|
IE_NAME = '220.ro'
|
2014-10-30 00:42:52 +01:00
|
|
|
_VALID_URL = r'(?x)(?:https?://)?(?:www\.)?220\.ro/(?P<category>[^/]+)/(?P<shorttitle>[^/]+)/(?P<id>[^/]+)'
|
2013-08-24 21:10:03 +02:00
|
|
|
_TEST = {
|
2014-10-30 00:42:52 +01:00
|
|
|
'url': 'http://www.220.ro/sport/Luati-Le-Banii-Sez-4-Ep-1/LYV6doKo7f/',
|
2014-01-31 14:07:58 +01:00
|
|
|
'md5': '03af18b73a07b4088753930db7a34add',
|
|
|
|
'info_dict': {
|
2014-10-30 00:42:52 +01:00
|
|
|
'id': 'LYV6doKo7f',
|
|
|
|
'ext': 'mp4',
|
|
|
|
'title': 'Luati-le Banii sez 4 ep 1',
|
2017-01-02 13:08:07 +01:00
|
|
|
'description': r're:^Iata-ne reveniti dupa o binemeritata vacanta\. +Va astept si pe Facebook cu pareri si comentarii.$',
|
2013-08-24 21:10:03 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
def _real_extract(self, url):
|
2014-10-30 00:42:52 +01:00
|
|
|
video_id = self._match_id(url)
|
2013-08-24 21:10:03 +02:00
|
|
|
|
|
|
|
webpage = self._download_webpage(url, video_id)
|
2014-10-30 00:42:52 +01:00
|
|
|
url = compat_urllib_parse_unquote(self._search_regex(
|
|
|
|
r'(?s)clip\s*:\s*{.*?url\s*:\s*\'([^\']+)\'', webpage, 'url'))
|
|
|
|
title = self._og_search_title(webpage)
|
|
|
|
description = self._og_search_description(webpage)
|
|
|
|
thumbnail = self._og_search_thumbnail(webpage)
|
|
|
|
|
|
|
|
formats = [{
|
|
|
|
'format_id': 'sd',
|
|
|
|
'url': url,
|
|
|
|
'ext': 'mp4',
|
|
|
|
}]
|
2013-08-24 21:10:03 +02:00
|
|
|
|
2014-01-31 14:07:58 +01:00
|
|
|
return {
|
2013-08-24 21:10:03 +02:00
|
|
|
'id': video_id,
|
2014-10-30 00:42:52 +01:00
|
|
|
'formats': formats,
|
|
|
|
'title': title,
|
|
|
|
'description': description,
|
|
|
|
'thumbnail': thumbnail,
|
2013-08-24 21:10:03 +02:00
|
|
|
}
|