mirror of
https://github.com/ytdl-org/youtube-dl
synced 2025-02-05 18:20:10 +09:00
Compare commits
18 Commits
d8c3a78439
...
c6cc12bd6b
Author | SHA1 | Date | |
---|---|---|---|
|
c6cc12bd6b | ||
|
1036478d13 | ||
|
00ad2b8ca1 | ||
|
ab7c61ca29 | ||
|
1058c29c74 | ||
|
6bde4a1377 | ||
|
89a75524e6 | ||
|
31595de72b | ||
|
5a7243b741 | ||
|
d30180d4f3 | ||
|
ff47d11269 | ||
|
7f40887b29 | ||
|
c1a696ee40 | ||
|
b955e0a5dc | ||
|
030a5713e6 | ||
|
a85625977d | ||
|
fd733f52f5 | ||
|
35779eda7a |
@ -3,25 +3,71 @@ from __future__ import unicode_literals
|
||||
|
||||
from .common import InfoExtractor
|
||||
from ..utils import (
|
||||
ExtractorError,
|
||||
determine_ext,
|
||||
js_to_json,
|
||||
)
|
||||
from ..compat import (
|
||||
compat_b64decode,
|
||||
compat_urllib_parse_unquote,
|
||||
)
|
||||
|
||||
import re
|
||||
|
||||
|
||||
class RTPIE(InfoExtractor):
|
||||
_VALID_URL = r'https?://(?:www\.)?rtp\.pt/play/p(?P<program_id>[0-9]+)/(?P<id>[^/?#]+)/?'
|
||||
_VALID_URL = r'https?://(?:(?:(?:www\.)?rtp\.pt/play/(?P<subarea>.*/)?p(?P<program_id>[0-9]+)/(?P<episode_id>e[0-9]+/)?)|(?:arquivos\.rtp\.pt/conteudos/))(?P<id>[^/?#]+)/?'
|
||||
_TESTS = [{
|
||||
'url': 'http://www.rtp.pt/play/p405/e174042/paixoes-cruzadas',
|
||||
'md5': 'e736ce0c665e459ddb818546220b4ef8',
|
||||
'url': 'https://www.rtp.pt/play/p117/e563265/os-contemporaneos',
|
||||
'info_dict': {
|
||||
'id': 'e174042',
|
||||
'ext': 'mp3',
|
||||
'title': 'Paixões Cruzadas',
|
||||
'description': 'As paixões musicais de António Cartaxo e António Macedo',
|
||||
'thumbnail': r're:^https?://.*\.jpg',
|
||||
'id': 'os-contemporaneos',
|
||||
'ext': 'mp4',
|
||||
'title': 'Os Contemporâneos Episódio 1',
|
||||
'description': 'Os Contemporâneos, um programa de humor com um olhar na sociedade portuguesa!',
|
||||
'thumbnail': r're:^https?://.*\.(jpg|png)'
|
||||
},
|
||||
}, {
|
||||
'url': 'http://www.rtp.pt/play/p831/a-quimica-das-coisas',
|
||||
'url': 'https://www.rtp.pt/play/p8157/e541212/telejornal',
|
||||
'info_dict': {
|
||||
'id': 'telejornal',
|
||||
'ext': 'mp4',
|
||||
'title': 'Telejornal de 01 Mai 2021 PARTE 1',
|
||||
'description': 'A mais rigorosa seleção de notícias, todos os dias às 20h00. De segunda a domingo, João Adelino Faria e José Rodrigues dos Santos mostram-lhe o que de'
|
||||
},
|
||||
}, {
|
||||
'url': 'https://www.rtp.pt/play/p6646/e457262/grande-entrevista',
|
||||
'info_dict': {
|
||||
'id': 'grande-entrevista',
|
||||
'ext': 'mp4',
|
||||
'title': 'Grande Entrevista Episódio 7 - de 19 Fev 2020',
|
||||
'description': 'Bruno Nogueira - É um dos mais originais humoristas portugueses e de maior êxito! Bruno Nogueira na Grande Entrevista com Vítor Gonçalves.'
|
||||
},
|
||||
}, {
|
||||
'url': 'https://www.rtp.pt/play/estudoemcasa/p7776/e539826/portugues-1-ano',
|
||||
'info_dict': {
|
||||
'id': 'portugues-1-ano',
|
||||
'ext': 'mp4',
|
||||
'title': 'Português - 1.º ano , aula 45 - 27 Abr 2021 - Estudo Em Casa - RTP',
|
||||
'description': 'A História do Pedrito Coelho, de Beatrix Potter. O dígrafo \'lh\' - A História do Pedrito Coelho, de Beatrix Potter. O dígrafo \'lh\'.'
|
||||
},
|
||||
}, {
|
||||
'url': 'https://www.rtp.pt/play/zigzag/p5449/e385973/banda-zig-zag',
|
||||
'info_dict': {
|
||||
'id': 'banda-zig-zag',
|
||||
'ext': 'mp4',
|
||||
'title': 'Banda Zig Zag Episódio 1 - Zig Zag Play - RTP',
|
||||
'description': 'A Amizade é o Nosso Mel - Zig: é a menina que além de tocar também canta. Adora aprender palavras novas e adora ler. Gosta de fazer palavras cruzadas'
|
||||
},
|
||||
}, {
|
||||
'url': 'https://arquivos.rtp.pt/conteudos/liga-dos-ultimos-152/',
|
||||
'info_dict': {
|
||||
'id': 'liga-dos-ultimos-152',
|
||||
'ext': 'mp4',
|
||||
'title': 'Liga dos Últimos – RTP Arquivos',
|
||||
'description': 'Magazine desportivo, com apresentação de Álvaro Costa e comentários em estúdio do professor Hernâni Gonçalves e do sociólogo João Nuno Coelho. Destaque para os jogos de futebol das equipas dos escalões secundários de Portugal, com momentos dos jogos: Agrário de Lamas vs Pampilhoense e Apúlia vs Fragoso.'
|
||||
},
|
||||
}, {
|
||||
'url': 'https://www.rtp.pt/play/p510/aleixo-fm',
|
||||
'only_matching': True,
|
||||
}]
|
||||
|
||||
@ -29,38 +75,115 @@ class RTPIE(InfoExtractor):
|
||||
video_id = self._match_id(url)
|
||||
|
||||
webpage = self._download_webpage(url, video_id)
|
||||
title = self._html_search_meta(
|
||||
'twitter:title', webpage, display_name='title', fatal=True)
|
||||
|
||||
config = self._parse_json(self._search_regex(
|
||||
r'(?s)RTPPlayer\(({.+?})\);', webpage,
|
||||
'player config'), video_id, js_to_json)
|
||||
# Remove JS multi-line comments from webpage source
|
||||
webpage = re.sub(r'(\/\*.*\*\/)', '', webpage, flags=re.DOTALL)
|
||||
|
||||
title = self._html_search_regex(r'<title>(.+?)</title>', webpage, 'title')
|
||||
|
||||
if 'Este episódio não se encontra disponível' in title:
|
||||
raise ExtractorError('Episode unavailable', expected=True)
|
||||
|
||||
# Replace irrelevant text in title
|
||||
title = re.sub(r' - ?RTP Play - RTP', '', title)
|
||||
|
||||
# Check if it's a video split in parts, if so add part number to title
|
||||
part = self._html_search_regex(r'section\-parts.*<span.*>(.+?)</span>.*</ul>', webpage, 'part', default=None)
|
||||
if part:
|
||||
title = '{title} {part}'.format(title=title, part=part)
|
||||
|
||||
# Get JS object
|
||||
js_object = self._search_regex(r'(?s)RTPPlayer *\( *({.+?}) *\);', webpage, 'player config')
|
||||
|
||||
json_string_for_config = ''
|
||||
filekey_found = False
|
||||
|
||||
# Verify JS object since it isn't pure JSON and probably needs some fixing
|
||||
for line in js_object.splitlines():
|
||||
stripped_line = line.strip()
|
||||
|
||||
# If JS object key is 'fileKey'
|
||||
if re.match('fileKey ?:', stripped_line):
|
||||
filekey_found = True
|
||||
if 'decodeURIComponent' in stripped_line:
|
||||
# 1) The value is an encoded URL
|
||||
encoded_url = re.match(r"[^[]*\[([^]]*)\]", stripped_line).groups()[0]
|
||||
encoded_url = re.sub(r'[\s"\',]', '', encoded_url)
|
||||
|
||||
if 'atob' in stripped_line:
|
||||
# Most of the times 'atob' approach is used but not always so we need to be sure
|
||||
decoded_url = compat_b64decode(
|
||||
compat_urllib_parse_unquote(
|
||||
encoded_url)).decode('utf-8')
|
||||
else:
|
||||
# If no 'atob' we just need to unquote it
|
||||
decoded_url = compat_urllib_parse_unquote(encoded_url)
|
||||
|
||||
# Insert the (relative) decoded URL in JSON
|
||||
json_string_for_config += '\nfileKey: "{decoded_url}",'.format(decoded_url=decoded_url)
|
||||
else:
|
||||
# 2) ... or the value URL is not encoded so keep it that way
|
||||
json_string_for_config += '\n{stripped_line}'.format(stripped_line=stripped_line)
|
||||
|
||||
elif (
|
||||
not stripped_line.startswith("//")
|
||||
and not re.match('.*extraSettings ?:', stripped_line)
|
||||
and (not filekey_found or (filekey_found and not re.match('file ?:', stripped_line)))
|
||||
):
|
||||
# Ignore commented lines and 'extraSettings'. Also ignore 'file' if 'fileKey' already exists
|
||||
json_string_for_config += '\n{stripped_line}'.format(stripped_line=stripped_line)
|
||||
|
||||
# Finally send pure JSON string for JSON parsing
|
||||
config = self._parse_json(json_string_for_config, video_id, js_to_json)
|
||||
|
||||
if 'fileKey' in config:
|
||||
# 'fileKey' has priority over 'file' on our end
|
||||
file_url = config['fileKey']
|
||||
elif 'file' in config:
|
||||
# 'RTP Arquivos' still uses old regular non-encoded 'file' key
|
||||
file_url = config['file']
|
||||
else:
|
||||
raise ExtractorError('No valid media source found in page')
|
||||
|
||||
ext = determine_ext(file_url)
|
||||
if ext == 'm3u8':
|
||||
file_key = config.get('fileKey')
|
||||
|
||||
if ext == 'mp4':
|
||||
# Due to recent changes, we need to hardcode the URL like this and download it using 'm3u8'
|
||||
file_url = 'https://streaming-vod.rtp.pt/hls{file_url}/index-v1-a1.m3u8'.format(file_url=file_url)
|
||||
|
||||
formats = self._extract_m3u8_formats(
|
||||
file_url, video_id, 'mp4', 'm3u8_native',
|
||||
m3u8_id='hls', fatal=file_key)
|
||||
if file_key:
|
||||
formats.append({
|
||||
'url': 'https://cdn-ondemand.rtp.pt' + file_key,
|
||||
'preference': 1,
|
||||
})
|
||||
self._sort_formats(formats)
|
||||
m3u8_id='hls')
|
||||
elif ext == 'm3u8':
|
||||
# It can be downloaded without any further changes
|
||||
formats = self._extract_m3u8_formats(
|
||||
file_url, video_id, 'mp4', 'm3u8_native',
|
||||
m3u8_id='hls')
|
||||
else:
|
||||
# Need to set basepath
|
||||
file_url = 'https://cdn-ondemand.rtp.pt{file_url}'.format(file_url=file_url)
|
||||
formats = [{
|
||||
'url': file_url,
|
||||
'ext': ext,
|
||||
}]
|
||||
if config.get('mediaType') == 'audio':
|
||||
|
||||
if config['mediaType'] == 'audio':
|
||||
for f in formats:
|
||||
f['vcodec'] = 'none'
|
||||
|
||||
subtitles = {}
|
||||
if 'vtt' in config:
|
||||
sub_lang, sub_lang_full, sub_url = config['vtt'][0]
|
||||
subtitles.setdefault(sub_lang, []).append({
|
||||
'url': sub_url,
|
||||
'ext': 'vtt',
|
||||
})
|
||||
|
||||
return {
|
||||
'id': video_id,
|
||||
'title': title,
|
||||
'formats': formats,
|
||||
'description': self._html_search_meta(['description', 'twitter:description'], webpage),
|
||||
'thumbnail': config.get('poster') or self._og_search_thumbnail(webpage),
|
||||
'subtitles': subtitles,
|
||||
'description': self._html_search_meta(['og:description', 'description', 'twitter:description'], webpage),
|
||||
'thumbnail': config['poster'] or self._og_search_thumbnail(webpage),
|
||||
}
|
||||
|
@ -9,6 +9,7 @@ import json
|
||||
import os.path
|
||||
import random
|
||||
import re
|
||||
import string
|
||||
import time
|
||||
import traceback
|
||||
|
||||
@ -67,6 +68,7 @@ from ..utils import (
|
||||
|
||||
class YoutubeBaseInfoExtractor(InfoExtractor):
|
||||
"""Provide base functions for Youtube extractors"""
|
||||
|
||||
_LOGIN_URL = 'https://accounts.google.com/ServiceLogin'
|
||||
_TWOFACTOR_URL = 'https://accounts.google.com/signin/challenge'
|
||||
|
||||
@ -138,7 +140,7 @@ class YoutubeBaseInfoExtractor(InfoExtractor):
|
||||
[2, 1, None, 1,
|
||||
'https://accounts.google.com/ServiceLogin?passive=true&continue=https%3A%2F%2Fwww.youtube.com%2Fsignin%3Fnext%3D%252F%26action_handle_signin%3Dtrue%26hl%3Den%26app%3Ddesktop%26feature%3Dsign_in_button&hl=en&service=youtube&uilel=3&requestPath=%2FServiceLogin&Page=PasswordSeparationSignIn',
|
||||
None, [], 4],
|
||||
1, [None, None, []], None, None, None, True
|
||||
1, [None, None, []], None, None, None, True,
|
||||
],
|
||||
username,
|
||||
]
|
||||
@ -160,7 +162,7 @@ class YoutubeBaseInfoExtractor(InfoExtractor):
|
||||
None, 1, None, [1, None, None, None, [password, None, True]],
|
||||
[
|
||||
None, None, [2, 1, None, 1, 'https://accounts.google.com/ServiceLogin?passive=true&continue=https%3A%2F%2Fwww.youtube.com%2Fsignin%3Fnext%3D%252F%26action_handle_signin%3Dtrue%26hl%3Den%26app%3Ddesktop%26feature%3Dsign_in_button&hl=en&service=youtube&uilel=3&requestPath=%2FServiceLogin&Page=PasswordSeparationSignIn', None, [], 4],
|
||||
1, [None, None, []], None, None, None, True
|
||||
1, [None, None, []], None, None, None, True,
|
||||
]]
|
||||
|
||||
challenge_results = req(
|
||||
@ -213,7 +215,7 @@ class YoutubeBaseInfoExtractor(InfoExtractor):
|
||||
user_hash, None, 2, None,
|
||||
[
|
||||
9, None, None, None, None, None, None, None,
|
||||
[None, tfa_code, True, 2]
|
||||
[None, tfa_code, True, 2],
|
||||
]]
|
||||
|
||||
tfa_results = req(
|
||||
@ -284,7 +286,7 @@ class YoutubeBaseInfoExtractor(InfoExtractor):
|
||||
'client': {
|
||||
'clientName': 'WEB',
|
||||
'clientVersion': '2.20201021.03.00',
|
||||
}
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
@ -385,7 +387,7 @@ class YoutubeBaseInfoExtractor(InfoExtractor):
|
||||
'client': {
|
||||
'clientName': 'WEB',
|
||||
'clientVersion': '2.20201021.03.00',
|
||||
}
|
||||
},
|
||||
},
|
||||
'query': query,
|
||||
}
|
||||
@ -462,7 +464,7 @@ class YoutubeBaseInfoExtractor(InfoExtractor):
|
||||
# (HTML, videodetails, metadata, renderers)
|
||||
'name': ('content', 'author', (('ownerChannelName', None), 'title'), ['text']),
|
||||
'url': ('href', 'ownerProfileUrl', 'vanityChannelUrl',
|
||||
['navigationEndpoint', 'browseEndpoint', 'canonicalBaseUrl'])
|
||||
['navigationEndpoint', 'browseEndpoint', 'canonicalBaseUrl']),
|
||||
}
|
||||
if any((videodetails, metadata, renderers)):
|
||||
result = (
|
||||
@ -671,7 +673,7 @@ class YoutubeIE(YoutubeBaseInfoExtractor):
|
||||
'uploader_url': r're:https?://(?:www\.)?youtube\.com/user/8KVIDEO',
|
||||
'description': '',
|
||||
'uploader': '8KVIDEO',
|
||||
'title': 'UHDTV TEST 8K VIDEO.mp4'
|
||||
'title': 'UHDTV TEST 8K VIDEO.mp4',
|
||||
},
|
||||
'params': {
|
||||
'youtube_include_dash_manifest': True,
|
||||
@ -711,7 +713,7 @@ class YoutubeIE(YoutubeBaseInfoExtractor):
|
||||
'uploader_url': r're:https?://(?:www\.)?youtube\.com/@theamazingatheist',
|
||||
'title': 'Burning Everyone\'s Koran',
|
||||
'description': 'SUBSCRIBE: http://www.youtube.com/saturninefilms \r\n\r\nEven Obama has taken a stand against freedom on this issue: http://www.huffingtonpost.com/2010/09/09/obama-gma-interview-quran_n_710282.html',
|
||||
}
|
||||
},
|
||||
},
|
||||
# Age-gated videos
|
||||
{
|
||||
@ -839,7 +841,7 @@ class YoutubeIE(YoutubeBaseInfoExtractor):
|
||||
},
|
||||
'expected_warnings': [
|
||||
'DASH manifest missing',
|
||||
]
|
||||
],
|
||||
},
|
||||
# Olympics (https://github.com/ytdl-org/youtube-dl/issues/4431)
|
||||
{
|
||||
@ -1820,8 +1822,8 @@ class YoutubeIE(YoutubeBaseInfoExtractor):
|
||||
|
||||
# cpn generation algorithm is reverse engineered from base.js.
|
||||
# In fact it works even with dummy cpn.
|
||||
CPN_ALPHABET = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-_'
|
||||
cpn = ''.join(CPN_ALPHABET[random.randint(0, 256) & 63] for _ in range(0, 16))
|
||||
CPN_ALPHABET = string.ascii_letters + string.digits + '-_'
|
||||
cpn = ''.join(CPN_ALPHABET[random.randint(0, 256) & 63] for _ in range(16))
|
||||
|
||||
# more consistent results setting it to right before the end
|
||||
qs = parse_qs(playback_url)
|
||||
@ -1881,8 +1883,7 @@ class YoutubeIE(YoutubeBaseInfoExtractor):
|
||||
mobj = re.match(cls._VALID_URL, url, re.VERBOSE)
|
||||
if mobj is None:
|
||||
raise ExtractorError('Invalid URL: %s' % url)
|
||||
video_id = mobj.group(2)
|
||||
return video_id
|
||||
return mobj.group(2)
|
||||
|
||||
def _extract_chapters_from_json(self, data, video_id, duration):
|
||||
chapters_list = try_get(
|
||||
@ -2035,7 +2036,7 @@ class YoutubeIE(YoutubeBaseInfoExtractor):
|
||||
headers = {
|
||||
'X-YouTube-Client-Name': '85',
|
||||
'X-YouTube-Client-Version': '2.0',
|
||||
'Origin': 'https://www.youtube.com'
|
||||
'Origin': 'https://www.youtube.com',
|
||||
}
|
||||
|
||||
video_info = self._call_api('player', query, video_id, fatal=False, headers=headers)
|
||||
@ -2064,8 +2065,8 @@ class YoutubeIE(YoutubeBaseInfoExtractor):
|
||||
return ''.join([r['text'] for r in runs if isinstance(r.get('text'), compat_str)])
|
||||
|
||||
search_meta = (
|
||||
lambda x: self._html_search_meta(x, webpage, default=None)) \
|
||||
if webpage else lambda x: None
|
||||
(lambda x: self._html_search_meta(x, webpage, default=None))
|
||||
if webpage else lambda _: None)
|
||||
|
||||
video_details = player_response.get('videoDetails') or {}
|
||||
microformat = try_get(
|
||||
@ -2137,7 +2138,7 @@ class YoutubeIE(YoutubeBaseInfoExtractor):
|
||||
def build_fragments(f):
|
||||
return LazyList({
|
||||
'url': update_url_query(f['url'], {
|
||||
'range': '{0}-{1}'.format(range_start, min(range_start + CHUNK_SIZE - 1, f['filesize']))
|
||||
'range': '{0}-{1}'.format(range_start, min(range_start + CHUNK_SIZE - 1, f['filesize'])),
|
||||
})
|
||||
} for range_start in range(0, f['filesize'], CHUNK_SIZE))
|
||||
|
||||
@ -2236,7 +2237,7 @@ class YoutubeIE(YoutubeBaseInfoExtractor):
|
||||
'protocol': 'http_dash_segments',
|
||||
'fragments': build_fragments(dct),
|
||||
} if dct['filesize'] else {
|
||||
'downloader_options': {'http_chunk_size': CHUNK_SIZE} # No longer useful?
|
||||
'downloader_options': {'http_chunk_size': CHUNK_SIZE}, # No longer useful?
|
||||
})
|
||||
|
||||
formats.append(dct)
|
||||
@ -2414,9 +2415,9 @@ class YoutubeIE(YoutubeBaseInfoExtractor):
|
||||
'is_live': is_live,
|
||||
}
|
||||
|
||||
pctr = try_get(
|
||||
pctr = traverse_obj(
|
||||
player_response,
|
||||
lambda x: x['captions']['playerCaptionsTracklistRenderer'], dict)
|
||||
('captions', 'playerCaptionsTracklistRenderer', T(dict)))
|
||||
if pctr:
|
||||
def process_language(container, base_url, lang_code, query):
|
||||
lang_subs = []
|
||||
@ -2430,9 +2431,11 @@ class YoutubeIE(YoutubeBaseInfoExtractor):
|
||||
})
|
||||
container[lang_code] = lang_subs
|
||||
|
||||
def process_subtitles():
|
||||
subtitles = {}
|
||||
for caption_track in (pctr.get('captionTracks') or []):
|
||||
base_url = caption_track.get('baseUrl')
|
||||
for caption_track in traverse_obj(pctr, (
|
||||
'captionTracks', lambda _, v: v.get('baseUrl'))):
|
||||
base_url = self._yt_urljoin(caption_track['baseUrl'])
|
||||
if not base_url:
|
||||
continue
|
||||
if caption_track.get('kind') != 'asr':
|
||||
@ -2443,18 +2446,19 @@ class YoutubeIE(YoutubeBaseInfoExtractor):
|
||||
subtitles, base_url, lang_code, {})
|
||||
continue
|
||||
automatic_captions = {}
|
||||
for translation_language in (pctr.get('translationLanguages') or []):
|
||||
translation_language_code = translation_language.get('languageCode')
|
||||
if not translation_language_code:
|
||||
continue
|
||||
for translation_language in traverse_obj(pctr, (
|
||||
'translationLanguages', lambda _, v: v.get('languageCode'))):
|
||||
translation_language_code = translation_language['languageCode']
|
||||
process_language(
|
||||
automatic_captions, base_url, translation_language_code,
|
||||
{'tlang': translation_language_code})
|
||||
info['automatic_captions'] = automatic_captions
|
||||
info['subtitles'] = subtitles
|
||||
|
||||
process_subtitles()
|
||||
|
||||
parsed_url = compat_urllib_parse_urlparse(url)
|
||||
for component in [parsed_url.fragment, parsed_url.query]:
|
||||
for component in (parsed_url.fragment, parsed_url.query):
|
||||
query = compat_parse_qs(component)
|
||||
for k, v in query.items():
|
||||
for d_k, s_ks in [('start', ('start', 't')), ('end', ('end',))]:
|
||||
@ -2684,7 +2688,7 @@ class YoutubeTabIE(YoutubeBaseInfoExtractor):
|
||||
'title': 'Super Cooper Shorts - Shorts',
|
||||
'uploader': 'Super Cooper Shorts',
|
||||
'uploader_id': '@SuperCooperShorts',
|
||||
}
|
||||
},
|
||||
}, {
|
||||
# Channel that does not have a Shorts tab. Test should just download videos on Home tab instead
|
||||
'url': 'https://www.youtube.com/@emergencyawesome/shorts',
|
||||
@ -2738,7 +2742,7 @@ class YoutubeTabIE(YoutubeBaseInfoExtractor):
|
||||
'description': 'md5:609399d937ea957b0f53cbffb747a14c',
|
||||
'uploader': 'ThirstForScience',
|
||||
'uploader_id': '@ThirstForScience',
|
||||
}
|
||||
},
|
||||
}, {
|
||||
'url': 'https://www.youtube.com/c/ChristophLaimer/playlists',
|
||||
'only_matching': True,
|
||||
@ -3037,7 +3041,7 @@ class YoutubeTabIE(YoutubeBaseInfoExtractor):
|
||||
'uploader': '3Blue1Brown',
|
||||
'uploader_id': '@3blue1brown',
|
||||
'channel_id': 'UCYO_jab_esuFRV4b17AJtAw',
|
||||
}
|
||||
},
|
||||
}]
|
||||
|
||||
@classmethod
|
||||
@ -3335,7 +3339,7 @@ class YoutubeTabIE(YoutubeBaseInfoExtractor):
|
||||
'client': {
|
||||
'clientName': 'WEB',
|
||||
'clientVersion': client_version,
|
||||
}
|
||||
},
|
||||
}
|
||||
visitor_data = try_get(context, lambda x: x['client']['visitorData'], compat_str)
|
||||
|
||||
@ -3354,7 +3358,7 @@ class YoutubeTabIE(YoutubeBaseInfoExtractor):
|
||||
headers['x-goog-visitor-id'] = visitor_data
|
||||
data['continuation'] = continuation['continuation']
|
||||
data['clickTracking'] = {
|
||||
'clickTrackingParams': continuation['itct']
|
||||
'clickTrackingParams': continuation['itct'],
|
||||
}
|
||||
count = 0
|
||||
retries = 3
|
||||
@ -3613,7 +3617,7 @@ class YoutubePlaylistIE(InfoExtractor):
|
||||
'uploader': 'milan',
|
||||
'uploader_id': '@milan5503',
|
||||
'channel_id': 'UCEI1-PVPcYXjB73Hfelbmaw',
|
||||
}
|
||||
},
|
||||
}, {
|
||||
'url': 'http://www.youtube.com/embed/_xDOZElKyNU?list=PLsyOSbh5bs16vubvKePAQ1x3PhKavfBIl',
|
||||
'playlist_mincount': 455,
|
||||
@ -3623,7 +3627,7 @@ class YoutubePlaylistIE(InfoExtractor):
|
||||
'uploader': 'LBK',
|
||||
'uploader_id': '@music_king',
|
||||
'channel_id': 'UC21nz3_MesPLqtDqwdvnoxA',
|
||||
}
|
||||
},
|
||||
}, {
|
||||
'url': 'TLGGrESM50VT6acwMjAyMjAxNw',
|
||||
'only_matching': True,
|
||||
@ -3734,7 +3738,7 @@ class YoutubeSearchIE(SearchInfoExtractor, YoutubeBaseInfoExtractor):
|
||||
'info_dict': {
|
||||
'id': 'youtube-dl test video',
|
||||
'title': 'youtube-dl test video',
|
||||
}
|
||||
},
|
||||
}]
|
||||
|
||||
def _get_n_results(self, query, n):
|
||||
@ -3754,7 +3758,7 @@ class YoutubeSearchDateIE(YoutubeSearchIE):
|
||||
'info_dict': {
|
||||
'id': 'youtube-dl test video',
|
||||
'title': 'youtube-dl test video',
|
||||
}
|
||||
},
|
||||
}]
|
||||
|
||||
|
||||
@ -3769,7 +3773,7 @@ class YoutubeSearchURLIE(YoutubeBaseInfoExtractor):
|
||||
'id': 'youtube-dl test video',
|
||||
'title': 'youtube-dl test video',
|
||||
},
|
||||
'params': {'playlistend': 5}
|
||||
'params': {'playlistend': 5},
|
||||
}, {
|
||||
'url': 'https://www.youtube.com/results?q=test&sp=EgQIBBgB',
|
||||
'only_matching': True,
|
||||
@ -3785,6 +3789,7 @@ class YoutubeSearchURLIE(YoutubeBaseInfoExtractor):
|
||||
class YoutubeFeedsInfoExtractor(YoutubeTabIE):
|
||||
"""
|
||||
Base class for feed extractors
|
||||
|
||||
Subclasses must define the _FEED_NAME property.
|
||||
"""
|
||||
_LOGIN_REQUIRED = True
|
||||
|
Loading…
Reference in New Issue
Block a user