mirror of
https://codeberg.org/polarisfm/youtube-dl
synced 2025-01-08 14:17:54 +01:00
airvuz: add remaining attributes
This commit is contained in:
parent
44e9793a97
commit
80a2c83998
@ -2,28 +2,46 @@
|
|||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
from .common import InfoExtractor
|
from .common import InfoExtractor
|
||||||
|
from ..utils import determine_ext
|
||||||
|
|
||||||
|
import re
|
||||||
|
|
||||||
|
|
||||||
class AirVuzIE(InfoExtractor):
|
class AirVuzIE(InfoExtractor):
|
||||||
_VALID_URL = r'https?://(?:www\.)?airvuz\.com/video/(?:.+)?id=(?P<id>.+)'
|
_VALID_URL = r'https?://(?:www\.)?airvuz\.com/video/(?P<display_id>.+)\?id=(?P<id>.+)'
|
||||||
_TEST = {
|
_TEST = {
|
||||||
'url': 'https://www.airvuz.com/video/An-Imaginary-World?id=599e85c49282a717c50f2f7a',
|
'url': 'https://www.airvuz.com/video/An-Imaginary-World?id=599e85c49282a717c50f2f7a',
|
||||||
'info_dict': {
|
'info_dict': {
|
||||||
'id': '599e85c49282a717c50f2f7a',
|
'id': '599e85c49282a717c50f2f7a',
|
||||||
'ext': 'mp4',
|
'display_id': 'An-Imaginary-World',
|
||||||
'title': 'md5:7fc56270e7a70fa81a5935b72eacbe29',
|
'title': 'md5:7fc56270e7a70fa81a5935b72eacbe29',
|
||||||
|
'ext': 'mp4',
|
||||||
|
'thumbnail': r're:^https?://.*\.jpg$',
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
def _real_extract(self, url):
|
def _real_extract(self, url):
|
||||||
video_id = self._match_id(url)
|
groups = re.match(self._VALID_URL, url)
|
||||||
|
video_id = groups.group('id')
|
||||||
|
display_id = groups.group('display_id')
|
||||||
|
|
||||||
webpage = self._download_webpage(url, video_id)
|
webpage = self._download_webpage(url, video_id)
|
||||||
|
|
||||||
title = self._html_search_meta('og:title', webpage)
|
title = self._og_search_title(webpage)
|
||||||
|
thumbnail = self._og_search_thumbnail(webpage)
|
||||||
|
description = self._og_search_description(webpage)
|
||||||
|
uploader = self._html_search_regex(r'class=(?:\'img-circle\'|"img-circle"|img-circle)[^>]+?alt=(?:"([^"]+?)"|\'([^\']+?)\'|([^\s"\'=<>`]+))', webpage, 'uploader', fatal=False) or self._html_search_regex(r'https?://(?:www\.)?airvuz\.com/user/([^>]*)', webpage, 'uploader', fatal=False)
|
||||||
|
|
||||||
video_url = self._html_search_regex(r'<meta[^>]+?(?:name|property)=(?:\'og:video:url\'|"og:video:url"|og:video:url)[^>]+?content=(?:"([^"]+?)"|\'([^\']+?)\'|([^\s"\'=<>`]+))', webpage, 'video_url')
|
video_url = self._html_search_regex(r'<meta[^>]+?(?:name|property)=(?:\'og:video:url\'|"og:video:url"|og:video:url)[^>]+?content=(?:"([^"]+?)"|\'([^\']+?)\'|([^\s"\'=<>`]+))', webpage, 'video_url')
|
||||||
|
ext = determine_ext(video_url)
|
||||||
|
|
||||||
return {
|
return {
|
||||||
'id': video_id,
|
'id': video_id,
|
||||||
|
'display_id': display_id,
|
||||||
'title': title,
|
'title': title,
|
||||||
'url': video_url,
|
'url': video_url,
|
||||||
|
'ext': ext,
|
||||||
|
'thumbnail': thumbnail,
|
||||||
|
'description': description,
|
||||||
|
'uploader': uploader,
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user