mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2026-08-29 23:32:07 +03:00
[cleanup] Remove dead extractors (#16137)
Closes #2623 Closes #2679 Closes #2821 Closes #3416 Closes #4828 Closes #4939 Closes #5421 Closes #7064 Closes #7264 Closes #7654 Closes #8075 Closes #8798 Closes #9313 Closes #9617 Closes #10162 Closes #10252 Closes #10264 Closes #15640 Authored by: doe1080, bashonly Co-authored-by: bashonly <88596187+bashonly@users.noreply.github.com>
This commit is contained in:
@@ -1,70 +1,13 @@
|
||||
import re
|
||||
|
||||
from .common import InfoExtractor
|
||||
from ..utils import (
|
||||
clean_html,
|
||||
int_or_none,
|
||||
parse_codecs,
|
||||
parse_duration,
|
||||
str_to_int,
|
||||
unified_timestamp,
|
||||
)
|
||||
|
||||
|
||||
class GabTVIE(InfoExtractor):
|
||||
_VALID_URL = r'https?://tv\.gab\.com/channel/[^/]+/view/(?P<id>[a-z0-9-]+)'
|
||||
_TESTS = [{
|
||||
'url': 'https://tv.gab.com/channel/wurzelroot/view/why-was-america-in-afghanistan-61217eacea5665de450d0488',
|
||||
'info_dict': {
|
||||
'id': '61217eacea5665de450d0488',
|
||||
'ext': 'mp4',
|
||||
'title': 'WHY WAS AMERICA IN AFGHANISTAN - AMERICA FIRST AGAINST AMERICAN OLIGARCHY',
|
||||
'uploader': 'Wurzelroot',
|
||||
'uploader_id': '608fb0a85738fd1974984f7d',
|
||||
'thumbnail': 'https://tv.gab.com/image/61217eacea5665de450d0488',
|
||||
},
|
||||
}]
|
||||
|
||||
def _real_extract(self, url):
|
||||
video_id = self._match_id(url).split('-')[-1]
|
||||
webpage = self._download_webpage(url, video_id)
|
||||
channel_id = self._search_regex(r'data-channel-id=\"(?P<channel_id>[^\"]+)', webpage, 'channel_id')
|
||||
channel_name = self._search_regex(r'data-channel-name=\"(?P<channel_id>[^\"]+)', webpage, 'channel_name')
|
||||
title = self._search_regex(r'data-episode-title=\"(?P<channel_id>[^\"]+)', webpage, 'title')
|
||||
view_key = self._search_regex(r'data-view-key=\"(?P<channel_id>[^\"]+)', webpage, 'view_key')
|
||||
description = clean_html(
|
||||
self._html_search_regex(self._meta_regex('description'), webpage, 'description', group='content')) or None
|
||||
available_resolutions = re.findall(
|
||||
rf'<a\ data-episode-id=\"{video_id}\"\ data-resolution=\"(?P<resolution>[^\"]+)', webpage)
|
||||
|
||||
formats = []
|
||||
for resolution in available_resolutions:
|
||||
frmt = {
|
||||
'url': f'https://tv.gab.com/media/{video_id}?viewKey={view_key}&r={resolution}',
|
||||
'format_id': resolution,
|
||||
'vcodec': 'h264',
|
||||
'acodec': 'aac',
|
||||
'ext': 'mp4',
|
||||
}
|
||||
if 'audio-' in resolution:
|
||||
frmt['abr'] = str_to_int(resolution.replace('audio-', ''))
|
||||
frmt['height'] = 144
|
||||
frmt['quality'] = -10
|
||||
else:
|
||||
frmt['height'] = str_to_int(resolution.replace('p', ''))
|
||||
formats.append(frmt)
|
||||
|
||||
return {
|
||||
'id': video_id,
|
||||
'title': title,
|
||||
'formats': formats,
|
||||
'description': description,
|
||||
'uploader': channel_name,
|
||||
'uploader_id': channel_id,
|
||||
'thumbnail': f'https://tv.gab.com/image/{video_id}',
|
||||
}
|
||||
|
||||
|
||||
class GabIE(InfoExtractor):
|
||||
_VALID_URL = r'https?://(?:www\.)?gab\.com/[^/]+/posts/(?P<id>\d+)'
|
||||
_TESTS = [{
|
||||
|
||||
Reference in New Issue
Block a user