From 80a2c8399880449790432d3ead2e267dcbd1643e Mon Sep 17 00:00:00 2001 From: Diogo Lemos Date: Tue, 25 Feb 2020 21:15:11 +0000 Subject: [PATCH] airvuz: add remaining attributes --- youtube_dl/extractor/airvuz.py | 26 ++++++++++++++++++++++---- 1 file changed, 22 insertions(+), 4 deletions(-) diff --git a/youtube_dl/extractor/airvuz.py b/youtube_dl/extractor/airvuz.py index a53dd0339..c677e1147 100644 --- a/youtube_dl/extractor/airvuz.py +++ b/youtube_dl/extractor/airvuz.py @@ -2,28 +2,46 @@ from __future__ import unicode_literals from .common import InfoExtractor +from ..utils import determine_ext + +import re class AirVuzIE(InfoExtractor): - _VALID_URL = r'https?://(?:www\.)?airvuz\.com/video/(?:.+)?id=(?P.+)' + _VALID_URL = r'https?://(?:www\.)?airvuz\.com/video/(?P.+)\?id=(?P.+)' _TEST = { 'url': 'https://www.airvuz.com/video/An-Imaginary-World?id=599e85c49282a717c50f2f7a', 'info_dict': { 'id': '599e85c49282a717c50f2f7a', - 'ext': 'mp4', + 'display_id': 'An-Imaginary-World', 'title': 'md5:7fc56270e7a70fa81a5935b72eacbe29', + 'ext': 'mp4', + 'thumbnail': r're:^https?://.*\.jpg$', }, } 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) - 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']+?(?:name|property)=(?:\'og:video:url\'|"og:video:url"|og:video:url)[^>]+?content=(?:"([^"]+?)"|\'([^\']+?)\'|([^\s"\'=<>`]+))', webpage, 'video_url') + ext = determine_ext(video_url) return { 'id': video_id, + 'display_id': display_id, 'title': title, 'url': video_url, + 'ext': ext, + 'thumbnail': thumbnail, + 'description': description, + 'uploader': uploader, }