[IndavideoEmbed] extracted method video_url_to_format
This commit is contained in:
parent
92ded33a05
commit
1564eea880
@ -58,11 +58,7 @@ class IndavideoEmbedIE(InfoExtractor):
|
||||
if flv_url not in video_urls:
|
||||
video_urls.append(flv_url)
|
||||
|
||||
formats = [{
|
||||
'url': video_url,
|
||||
'height': int_or_none(self._search_regex(
|
||||
r'\.(\d{3,4})\.mp4(?:\?|$)', video_url, 'height', default=None)),
|
||||
} for video_url in video_urls]
|
||||
formats = [self.video_url_to_format(video_url) for video_url in video_urls]
|
||||
self._sort_formats(formats)
|
||||
|
||||
timestamp = video.get('date')
|
||||
@ -90,6 +86,13 @@ class IndavideoEmbedIE(InfoExtractor):
|
||||
'formats': formats,
|
||||
}
|
||||
|
||||
def video_url_to_format(self, video_url):
|
||||
return {
|
||||
'url': video_url,
|
||||
'height': int_or_none(self._search_regex(
|
||||
r'\.(\d{3,4})\.mp4(?:\?|$)', video_url, 'height', default=None)),
|
||||
}
|
||||
|
||||
|
||||
class IndavideoIE(InfoExtractor):
|
||||
_VALID_URL = r'https?://(?:.+?\.)?indavideo\.hu/video/(?P<id>[^/#?]+)'
|
||||
|
Loading…
x
Reference in New Issue
Block a user