Plugin cleanup and tweaks

This commit is contained in:
2023-02-20 19:18:45 -06:00
parent 372e4ff3dc
commit 3ad9e1c7bb
1138 changed files with 48878 additions and 40445 deletions

View File

@@ -1,15 +1,13 @@
# coding: utf-8
from __future__ import unicode_literals
from ..compat import (
compat_b64decode,
compat_urllib_parse_unquote,
compat_urlparse,
)
from ..utils import (
ExtractorError,
determine_ext,
update_url_query,
traverse_obj,
)
from .bokecc import BokeCCBaseIE
@@ -38,6 +36,7 @@ class InfoQIE(BokeCCBaseIE):
'ext': 'flv',
'description': 'md5:308d981fb28fa42f49f9568322c683ff',
},
'skip': 'Sorry, the page you visited does not exist',
}, {
'url': 'https://www.infoq.com/presentations/Simple-Made-Easy',
'md5': '0e34642d4d9ef44bf86f66f6399672db',
@@ -90,8 +89,10 @@ class InfoQIE(BokeCCBaseIE):
}]
def _extract_http_audio(self, webpage, video_id):
fields = self._form_hidden_inputs('mp3Form', webpage)
http_audio_url = fields.get('filename')
try:
http_audio_url = traverse_obj(self._form_hidden_inputs('mp3Form', webpage), 'filename')
except ExtractorError:
http_audio_url = None
if not http_audio_url:
return []
@@ -115,7 +116,7 @@ class InfoQIE(BokeCCBaseIE):
video_id = self._match_id(url)
webpage = self._download_webpage(url, video_id)
video_title = self._html_search_regex(r'<title>(.*?)</title>', webpage, 'title')
video_title = self._html_extract_title(webpage)
video_description = self._html_search_meta('description', webpage, 'description')
if '/cn/' in url:
@@ -127,8 +128,6 @@ class InfoQIE(BokeCCBaseIE):
+ self._extract_http_video(webpage)
+ self._extract_http_audio(webpage, video_id))
self._sort_formats(formats)
return {
'id': video_id,
'title': video_title,