1
0
mirror of https://github.com/l1ving/youtube-dl synced 2024-11-25 11:12:53 +08:00

[ro220] Simplify and use unicode_literals

This commit is contained in:
Jaime Marquínez Ferrándiz 2014-01-31 14:07:58 +01:00
parent 0eb799bae9
commit 7aed837595

View File

@ -1,3 +1,5 @@
from __future__ import unicode_literals
import re import re
from .common import InfoExtractor from .common import InfoExtractor
@ -11,12 +13,12 @@ class Ro220IE(InfoExtractor):
IE_NAME = '220.ro' IE_NAME = '220.ro'
_VALID_URL = r'(?x)(?:https?://)?(?:www\.)?220\.ro/(?P<category>[^/]+)/(?P<shorttitle>[^/]+)/(?P<video_id>[^/]+)' _VALID_URL = r'(?x)(?:https?://)?(?:www\.)?220\.ro/(?P<category>[^/]+)/(?P<shorttitle>[^/]+)/(?P<video_id>[^/]+)'
_TEST = { _TEST = {
u"url": u"http://www.220.ro/sport/Luati-Le-Banii-Sez-4-Ep-1/LYV6doKo7f/", "url": "http://www.220.ro/sport/Luati-Le-Banii-Sez-4-Ep-1/LYV6doKo7f/",
u'file': u'LYV6doKo7f.mp4', 'file': 'LYV6doKo7f.mp4',
u'md5': u'03af18b73a07b4088753930db7a34add', 'md5': '03af18b73a07b4088753930db7a34add',
u'info_dict': { 'info_dict': {
u"title": u"Luati-le Banii sez 4 ep 1", "title": "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.", "description": "Iata-ne reveniti dupa o binemeritata vacanta. Va astept si pe Facebook cu pareri si comentarii.",
} }
} }
@ -27,10 +29,10 @@ class Ro220IE(InfoExtractor):
webpage = self._download_webpage(url, video_id) webpage = self._download_webpage(url, video_id)
flashVars_str = self._search_regex( flashVars_str = self._search_regex(
r'<param name="flashVars" value="([^"]+)"', r'<param name="flashVars" value="([^"]+)"',
webpage, u'flashVars') webpage, 'flashVars')
flashVars = compat_parse_qs(flashVars_str) flashVars = compat_parse_qs(flashVars_str)
info = { return {
'_type': 'video', '_type': 'video',
'id': video_id, 'id': video_id,
'ext': 'mp4', 'ext': 'mp4',
@ -39,4 +41,3 @@ class Ro220IE(InfoExtractor):
'description': clean_html(flashVars['desc'][0]), 'description': clean_html(flashVars['desc'][0]),
'thumbnail': flashVars['preview'][0], 'thumbnail': flashVars['preview'][0],
} }
return info