mirror of
https://codeberg.org/polarisfm/youtube-dl
synced 2024-11-26 18:34:32 +01:00
[vidzi] Simplify
This commit is contained in:
parent
e65e06fbe2
commit
018e835594
@ -1,6 +1,8 @@
|
|||||||
import re
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
from .common import InfoExtractor
|
from .common import InfoExtractor
|
||||||
|
|
||||||
|
|
||||||
class VidziIE(InfoExtractor):
|
class VidziIE(InfoExtractor):
|
||||||
_VALID_URL = r'https?://(?:www\.)?vidzi\.tv/(?P<id>\w+)'
|
_VALID_URL = r'https?://(?:www\.)?vidzi\.tv/(?P<id>\w+)'
|
||||||
_TEST = {
|
_TEST = {
|
||||||
@ -14,12 +16,13 @@ class VidziIE(InfoExtractor):
|
|||||||
}
|
}
|
||||||
|
|
||||||
def _real_extract(self, url):
|
def _real_extract(self, url):
|
||||||
mobj = re.match(self._VALID_URL, url)
|
video_id = self._match_id(url)
|
||||||
video_id = mobj.group('id')
|
|
||||||
|
|
||||||
webpage = self._download_webpage('http://vidzi.tv/' + video_id, video_id)
|
webpage = self._download_webpage(url, video_id)
|
||||||
video_url = self._html_search_regex(r'{\s*file\s*:\s*"([^"]+)"\s*}', webpage, u'vidzi url')
|
video_url = self._html_search_regex(
|
||||||
title = self._html_search_regex(r'<Title>([^<]+)<\/Title>', webpage, u'vidzi title')
|
r'{\s*file\s*:\s*"([^"]+)"\s*}', webpage, 'video url')
|
||||||
|
title = self._html_search_regex(
|
||||||
|
r'<Title>([^<]+)<\/Title>', webpage, 'title')
|
||||||
|
|
||||||
return {
|
return {
|
||||||
'id': video_id,
|
'id': video_id,
|
||||||
|
Loading…
Reference in New Issue
Block a user