mirror of
https://github.com/ytdl-org/youtube-dl
synced 2025-07-13 23:14:13 +09:00
Compare commits
8 Commits
584c2bf6f9
...
6f4463b1c8
Author | SHA1 | Date | |
---|---|---|---|
![]() |
6f4463b1c8 | ||
![]() |
da7223d4aa | ||
![]() |
37c2440d6a | ||
![]() |
a2e33ecb48 | ||
![]() |
efb6d21eb9 | ||
![]() |
d8414d01bd | ||
![]() |
5f38e78a96 | ||
![]() |
a525f1d913 |
@ -232,8 +232,32 @@ _NSIG_TESTS = [
|
|||||||
'W9HJZKktxuYoDTqW', 'jHbbkcaxm54',
|
'W9HJZKktxuYoDTqW', 'jHbbkcaxm54',
|
||||||
),
|
),
|
||||||
(
|
(
|
||||||
'https://www.youtube.com/s/player/91201489/player_ias_tce.vflset/en_US/base.js',
|
'https://www.youtube.com/s/player/643afba4/player_ias.vflset/en_US/base.js',
|
||||||
'W9HJZKktxuYoDTqW', 'U48vOZHaeYS6vO',
|
'W9HJZKktxuYoDTqW', 'larxUlagTRAcSw',
|
||||||
|
),
|
||||||
|
(
|
||||||
|
'https://www.youtube.com/s/player/e7567ecf/player_ias_tce.vflset/en_US/base.js',
|
||||||
|
'Sy4aDGc0VpYRR9ew_', '5UPOT1VhoZxNLQ',
|
||||||
|
),
|
||||||
|
(
|
||||||
|
'https://www.youtube.com/s/player/d50f54ef/player_ias_tce.vflset/en_US/base.js',
|
||||||
|
'Ha7507LzRmH3Utygtj', 'XFTb2HoeOE5MHg',
|
||||||
|
),
|
||||||
|
(
|
||||||
|
'https://www.youtube.com/s/player/074a8365/player_ias_tce.vflset/en_US/base.js',
|
||||||
|
'Ha7507LzRmH3Utygtj', 'ufTsrE0IVYrkl8v',
|
||||||
|
),
|
||||||
|
(
|
||||||
|
'https://www.youtube.com/s/player/643afba4/player_ias.vflset/en_US/base.js',
|
||||||
|
'N5uAlLqm0eg1GyHO', 'dCBQOejdq5s-ww',
|
||||||
|
),
|
||||||
|
(
|
||||||
|
'https://www.youtube.com/s/player/69f581a5/tv-player-ias.vflset/tv-player-ias.js',
|
||||||
|
'-qIP447rVlTTwaZjY', 'KNcGOksBAvwqQg',
|
||||||
|
),
|
||||||
|
(
|
||||||
|
'https://www.youtube.com/s/player/643afba4/tv-player-ias.vflset/tv-player-ias.js',
|
||||||
|
'ir9-V6cdbCiyKxhr', '2PL7ZDYAALMfmA',
|
||||||
),
|
),
|
||||||
]
|
]
|
||||||
|
|
||||||
|
@ -1327,7 +1327,10 @@ from .trovo import (
|
|||||||
)
|
)
|
||||||
from .trunews import TruNewsIE
|
from .trunews import TruNewsIE
|
||||||
from .trutv import TruTVIE
|
from .trutv import TruTVIE
|
||||||
from .tube8 import Tube8IE
|
from .tube8 import (
|
||||||
|
Tube8IE,
|
||||||
|
Tube8ListIE,
|
||||||
|
)
|
||||||
from .tubitv import TubiTvIE
|
from .tubitv import TubiTvIE
|
||||||
from .tumblr import TumblrIE
|
from .tumblr import TumblrIE
|
||||||
from .tunein import (
|
from .tunein import (
|
||||||
|
@ -1,86 +1,275 @@
|
|||||||
|
# coding: utf-8
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
|
import itertools
|
||||||
import re
|
import re
|
||||||
|
from time import sleep
|
||||||
|
|
||||||
|
from .common import InfoExtractor
|
||||||
from ..utils import (
|
from ..utils import (
|
||||||
|
clean_html,
|
||||||
|
ExtractorError,
|
||||||
|
get_element_by_class,
|
||||||
|
get_element_by_id,
|
||||||
int_or_none,
|
int_or_none,
|
||||||
str_to_int,
|
merge_dicts,
|
||||||
|
parse_qs,
|
||||||
|
strip_or_none,
|
||||||
|
T,
|
||||||
|
traverse_obj,
|
||||||
|
url_or_none,
|
||||||
|
urljoin,
|
||||||
)
|
)
|
||||||
from .keezmovies import KeezMoviesIE
|
|
||||||
|
|
||||||
|
|
||||||
class Tube8IE(KeezMoviesIE):
|
class Tube8IE(InfoExtractor):
|
||||||
_VALID_URL = r'https?://(?:www\.)?tube8\.com/(?:[^/]+/)+(?P<display_id>[^/]+)/(?P<id>\d+)'
|
_VALID_URL = r'https?://(?:www\.)?tube8\.com/porn-video/(?P<id>\d+)'
|
||||||
_TESTS = [{
|
_TESTS = [{
|
||||||
'url': 'http://www.tube8.com/teen/kasia-music-video/229795/',
|
'url': 'https://www.tube8.com/porn-video/189530841/',
|
||||||
'md5': '65e20c48e6abff62ed0c3965fff13a39',
|
'md5': '532408f59e89a32027d873af6289c85a',
|
||||||
'info_dict': {
|
'info_dict': {
|
||||||
'id': '229795',
|
'id': '189530841',
|
||||||
'display_id': 'kasia-music-video',
|
|
||||||
'ext': 'mp4',
|
'ext': 'mp4',
|
||||||
'description': 'hot teen Kasia grinding',
|
'title': 'Found dildo. She let it cum in her tight ass to keep the secret',
|
||||||
'uploader': 'unknown',
|
'description': 'Cowgirl:479',
|
||||||
'title': 'Kasia music video',
|
'uploader': 'MaryKrylova',
|
||||||
|
'thumbnail': r're:https?://.*\.jpg$',
|
||||||
'age_limit': 18,
|
'age_limit': 18,
|
||||||
'duration': 230,
|
}
|
||||||
'categories': ['Teen'],
|
|
||||||
'tags': ['dancing'],
|
|
||||||
},
|
|
||||||
}, {
|
|
||||||
'url': 'http://www.tube8.com/shemale/teen/blonde-cd-gets-kidnapped-by-two-blacks-and-punished-for-being-a-slutty-girl/19569151/',
|
|
||||||
'only_matching': True,
|
|
||||||
}]
|
}]
|
||||||
|
|
||||||
@staticmethod
|
_EMBED_REGEX = r'<iframe [^>]*\bsrc=["\'](?P<url>(?:https?:)?//(?:www\.)?tube8\.com/embed/(?:[^/]+/)*\d+)'
|
||||||
def _extract_urls(webpage):
|
|
||||||
return re.findall(
|
@classmethod
|
||||||
r'<iframe[^>]+\bsrc=["\']((?:https?:)?//(?:www\.)?tube8\.com/embed/(?:[^/]+/)+\d+)',
|
def _extract_urls(cls, webpage):
|
||||||
webpage)
|
return [m.group('url') for m in re.finditer(cls._EMBED_REGEX, webpage)]
|
||||||
|
|
||||||
def _real_extract(self, url):
|
def _real_extract(self, url):
|
||||||
webpage, info = self._extract_info(url)
|
video_id = self._match_id(url)
|
||||||
|
webpage = self._download_webpage(url, video_id)
|
||||||
|
|
||||||
if not info['title']:
|
title = self._html_search_regex(
|
||||||
info['title'] = self._html_search_regex(
|
r'<title(?:\s[^>]*)?>([^<]+)(?:\|\s*Tube8\s*)?</title>',
|
||||||
r'videoTitle\s*=\s*"([^"]+)', webpage, 'title')
|
webpage, 'title', default=None)
|
||||||
|
if title == 'Removed Video':
|
||||||
|
raise ExtractorError('Video has been removed', expected=True)
|
||||||
|
|
||||||
description = self._html_search_regex(
|
age_verify_msg = self._search_regex(
|
||||||
r'(?s)Description:</dt>\s*<dd>(.+?)</dd>', webpage, 'description', fatal=False)
|
r'(your elected officials in \w+(?:\s+\w+){,2} are requiring us to verify your age before allowing you access to our website)',
|
||||||
uploader = self._html_search_regex(
|
webpage, 'age verification message', default=None)
|
||||||
r'<span class="username">\s*(.+?)\s*<',
|
if age_verify_msg:
|
||||||
webpage, 'uploader', fatal=False)
|
self.raise_geo_restricted('%s said: "%s"' % (self.IE_NAME, age_verify_msg))
|
||||||
|
|
||||||
like_count = int_or_none(self._search_regex(
|
playervars = self._search_json(
|
||||||
r'rupVar\s*=\s*"(\d+)"', webpage, 'like count', fatal=False))
|
r'\bplayervars\s*:', webpage, 'playervars', video_id)
|
||||||
dislike_count = int_or_none(self._search_regex(
|
|
||||||
r'rdownVar\s*=\s*"(\d+)"', webpage, 'dislike count', fatal=False))
|
|
||||||
view_count = str_to_int(self._search_regex(
|
|
||||||
r'Views:\s*</dt>\s*<dd>([\d,\.]+)',
|
|
||||||
webpage, 'view count', fatal=False))
|
|
||||||
comment_count = str_to_int(self._search_regex(
|
|
||||||
r'<span id="allCommentsCount">(\d+)</span>',
|
|
||||||
webpage, 'comment count', fatal=False))
|
|
||||||
|
|
||||||
category = self._search_regex(
|
info = self._search_json_ld(webpage, video_id, expected_type='VideoObject', default={})
|
||||||
r'Category:\s*</dt>\s*<dd>\s*<a[^>]+href=[^>]+>([^<]+)',
|
for k in ('url', 'description'):
|
||||||
webpage, 'category', fatal=False)
|
info.pop(k, None)
|
||||||
categories = [category] if category else None
|
|
||||||
|
|
||||||
tags_str = self._search_regex(
|
info['title'] = (
|
||||||
r'(?s)Tags:\s*</dt>\s*<dd>(.+?)</(?!a)',
|
traverse_obj(playervars, ('video_title', T(strip_or_none)))
|
||||||
webpage, 'tags', fatal=False)
|
or info.get('title') or title or self._og_search_title(webpage))
|
||||||
tags = [t for t in re.findall(
|
|
||||||
r'<a[^>]+href=[^>]+>([^<]+)', tags_str)] if tags_str else None
|
|
||||||
|
|
||||||
info.update({
|
# Borrowed from youporn extractor
|
||||||
'description': description,
|
def get_fmt(x):
|
||||||
'uploader': uploader,
|
v_url = url_or_none(x.get('videoUrl'))
|
||||||
'view_count': view_count,
|
if v_url:
|
||||||
'like_count': like_count,
|
x['videoUrl'] = v_url
|
||||||
'dislike_count': dislike_count,
|
return (x['format'], x)
|
||||||
'comment_count': comment_count,
|
|
||||||
'categories': categories,
|
|
||||||
'tags': tags,
|
|
||||||
})
|
|
||||||
|
|
||||||
return info
|
defs_by_format = dict(traverse_obj(playervars, (
|
||||||
|
'mediaDefinitions', lambda _, v: v.get('format'), T(get_fmt))))
|
||||||
|
|
||||||
|
def get_format_data(f):
|
||||||
|
if f not in defs_by_format:
|
||||||
|
return []
|
||||||
|
return self._download_json(
|
||||||
|
defs_by_format[f]['videoUrl'], video_id, '{0}-formats'.format(f))
|
||||||
|
|
||||||
|
formats = traverse_obj(get_format_data('mp4'), (
|
||||||
|
lambda _, v: v.get('videoUrl'), {
|
||||||
|
'url': ('videoUrl', T(url_or_none)),
|
||||||
|
'height': ('quality', T(int_or_none)),
|
||||||
|
}))
|
||||||
|
|
||||||
|
info['formats'] = []
|
||||||
|
for fmt in formats:
|
||||||
|
if not fmt.get('url'):
|
||||||
|
continue
|
||||||
|
height, fmt['tbr'] = map(int_or_none, self._search_regex(
|
||||||
|
r'(?i)(?P<height>\d{3,4})p_(?P<bitrate>\d+)k_\d+', fmt['url'],
|
||||||
|
'media details', group=('height', 'bitrate'),
|
||||||
|
default=(None, None)))
|
||||||
|
if fmt.get('height') is None:
|
||||||
|
fmt['height'] = height
|
||||||
|
else:
|
||||||
|
height = fmt['height']
|
||||||
|
fmt['format_id'] = '%dp' % height if height else 'mp4'
|
||||||
|
info['formats'].append(fmt)
|
||||||
|
|
||||||
|
self._sort_formats(info['formats'])
|
||||||
|
|
||||||
|
return merge_dicts({
|
||||||
|
'id': video_id,
|
||||||
|
'uploader': clean_html(get_element_by_class('submitByLink', webpage)),
|
||||||
|
'age_limit': self._rta_search(webpage),
|
||||||
|
}, info, traverse_obj(playervars, {
|
||||||
|
'thumbnail': ('image_url', T(url_or_none)),
|
||||||
|
'duration': ('video_duration', T(int_or_none)),
|
||||||
|
'description': 'actionTags',
|
||||||
|
}))
|
||||||
|
|
||||||
|
|
||||||
|
# Currently only user channels
|
||||||
|
class Tube8ListIE(InfoExtractor):
|
||||||
|
_PLAYLIST_TITLEBAR_RE = r'\s+[Vv]ideos\s*$'
|
||||||
|
_PAGE_RETRY_COUNT = 0 # ie, no retry
|
||||||
|
_PAGE_RETRY_DELAY = 2 # seconds
|
||||||
|
|
||||||
|
_VALID_URL = r'https?://(?:www\.)?tube8\.com/user-videos/(?P<id>\d+)/(?P<author>[^/#?]+)'
|
||||||
|
_TESTS = [{
|
||||||
|
'url': 'https://www.tube8.com/user-videos/195075441/MaryKrylova/',
|
||||||
|
'info_dict': {
|
||||||
|
'id': '195075441',
|
||||||
|
},
|
||||||
|
'playlist_mincount': 29,
|
||||||
|
}, {
|
||||||
|
'url': 'https://www.tube8.com/user-videos/195048331/FoxyElf/',
|
||||||
|
'info_dict': {
|
||||||
|
'id': '195048331',
|
||||||
|
},
|
||||||
|
'playlist_mincount': 80,
|
||||||
|
}]
|
||||||
|
|
||||||
|
# Borrowed from youporn extractor
|
||||||
|
@classmethod
|
||||||
|
def _get_title_from_slug(cls, title_slug):
|
||||||
|
return re.sub(r'[_-]', ' ', title_slug)
|
||||||
|
|
||||||
|
# Borrowed from youporn extractor
|
||||||
|
def _get_next_url(self, url, pl_id, html):
|
||||||
|
return urljoin(url, self._search_regex(
|
||||||
|
r'''<a\s[^>]*?(?<!-)\bhref\s*=\s*("|')(?P<url>(?:(?!\1)[^>])+)\1''',
|
||||||
|
get_element_by_id('next', html) or '', 'next page',
|
||||||
|
group='url', default=None))
|
||||||
|
|
||||||
|
# Borrowed from youporn extractor
|
||||||
|
def _entries(self, url, pl_id, html=None, page_num=None):
|
||||||
|
|
||||||
|
# separates page sections
|
||||||
|
PLAYLIST_SECTION_RE = (
|
||||||
|
r'''<div\s[^>]*(?<!-)\bclass\s*=\s*('|")(?:[\w$-]+\s+|\s)*?title-bar(?:\s+[\w$-]+|\s)*\1[^>]*>'''
|
||||||
|
)
|
||||||
|
# contains video link
|
||||||
|
VIDEO_URL_RE = r'''(?x)
|
||||||
|
<div\s[^>]*(?<!-)\bdata-video-id\s*=\s*('|")\d+\1[^>]*>\s*
|
||||||
|
(?:<div\b[\s\S]+?</div>\s*)*
|
||||||
|
<a\s[^>]*(?<!-)\bhref\s*=\s*('|")(?P<url>(?:(?!\2)[^>])+)\2
|
||||||
|
'''
|
||||||
|
|
||||||
|
def yield_pages(url, html=html, page_num=page_num):
|
||||||
|
fatal = not html
|
||||||
|
for pnum in itertools.count(start=page_num or 1):
|
||||||
|
if not html:
|
||||||
|
html = self._download_webpage(
|
||||||
|
url, pl_id, note='Downloading page %d' % pnum,
|
||||||
|
fatal=fatal)
|
||||||
|
if not html:
|
||||||
|
break
|
||||||
|
fatal = False
|
||||||
|
yield (url, html, pnum)
|
||||||
|
# explicit page: extract just that page
|
||||||
|
if page_num is not None:
|
||||||
|
break
|
||||||
|
next_url = self._get_next_url(url, pl_id, html)
|
||||||
|
if not next_url or next_url == url:
|
||||||
|
break
|
||||||
|
url, html = next_url, None
|
||||||
|
|
||||||
|
def retry_page(msg, tries_left, page_data):
|
||||||
|
if tries_left <= 0:
|
||||||
|
return
|
||||||
|
self.report_warning(msg, pl_id)
|
||||||
|
sleep(self._PAGE_RETRY_DELAY)
|
||||||
|
return next(
|
||||||
|
yield_pages(page_data[0], page_num=page_data[2]), None)
|
||||||
|
|
||||||
|
def yield_entries(html):
|
||||||
|
for frag in re.split(PLAYLIST_SECTION_RE, html):
|
||||||
|
if not frag:
|
||||||
|
continue
|
||||||
|
t_text = get_element_by_class('title-text', frag or '')
|
||||||
|
if not (t_text and re.search(self._PLAYLIST_TITLEBAR_RE, t_text)):
|
||||||
|
continue
|
||||||
|
for m in re.finditer(VIDEO_URL_RE, frag):
|
||||||
|
video_url = urljoin(url, m.group('url'))
|
||||||
|
if video_url:
|
||||||
|
yield self.url_result(video_url)
|
||||||
|
|
||||||
|
last_first_url = None
|
||||||
|
for page_data in yield_pages(url, html=html, page_num=page_num):
|
||||||
|
# page_data: url, html, page_num
|
||||||
|
first_url = None
|
||||||
|
tries_left = self._PAGE_RETRY_COUNT + 1
|
||||||
|
while tries_left > 0:
|
||||||
|
tries_left -= 1
|
||||||
|
for from_ in yield_entries(page_data[1]):
|
||||||
|
# may get the same page twice instead of empty page
|
||||||
|
# or (site bug) intead of actual next page
|
||||||
|
if not first_url:
|
||||||
|
first_url = from_['url']
|
||||||
|
if first_url == last_first_url:
|
||||||
|
# sometimes (/porntags/) the site serves the previous page
|
||||||
|
# instead but may provide the correct page after a delay
|
||||||
|
page_data = retry_page(
|
||||||
|
'Retrying duplicate page...', tries_left, page_data)
|
||||||
|
if page_data:
|
||||||
|
first_url = None
|
||||||
|
break
|
||||||
|
continue
|
||||||
|
yield from_
|
||||||
|
else:
|
||||||
|
if not first_url and 'no-result-paragarph1' in page_data[1]:
|
||||||
|
page_data = retry_page(
|
||||||
|
'Retrying empty page...', tries_left, page_data)
|
||||||
|
if page_data:
|
||||||
|
continue
|
||||||
|
else:
|
||||||
|
# success/failure
|
||||||
|
break
|
||||||
|
# may get an infinite (?) sequence of empty pages
|
||||||
|
if not first_url:
|
||||||
|
break
|
||||||
|
last_first_url = first_url
|
||||||
|
|
||||||
|
# Borrowed from youporn extractor
|
||||||
|
def _real_extract(self, url, html=None):
|
||||||
|
# exceptionally, id may be None
|
||||||
|
m_dict = self._match_valid_url(url).groupdict()
|
||||||
|
pl_id, page_type, sort = (m_dict.get(k) for k in ('id', 'type', 'sort'))
|
||||||
|
|
||||||
|
qs = dict(traverse_obj(parse_qs(url), (
|
||||||
|
T(dict.items), lambda _, k_v: k_v[1],
|
||||||
|
T(lambda k_v: (k_v[0], k_v[0][-1])))))
|
||||||
|
|
||||||
|
base_id = pl_id or 'Tube8'
|
||||||
|
title = self._get_title_from_slug(base_id)
|
||||||
|
if page_type:
|
||||||
|
title = '%s %s' % (page_type.capitalize(), title)
|
||||||
|
base_id = [base_id.lower()]
|
||||||
|
if sort is None:
|
||||||
|
title += ' videos'
|
||||||
|
else:
|
||||||
|
title = '%s videos by %s' % (title, re.sub(r'[_-]', ' ', sort))
|
||||||
|
base_id.append(sort)
|
||||||
|
if qs:
|
||||||
|
ps = ['%s=%s' % item for item in sorted(qs.items())]
|
||||||
|
title += ' (%s)' % ','.join(ps)
|
||||||
|
base_id.extend(ps)
|
||||||
|
pl_id = '/'.join(base_id)
|
||||||
|
|
||||||
|
return self.playlist_result(
|
||||||
|
self._entries(url, pl_id, html=html,
|
||||||
|
page_num=int_or_none(qs.get('page'))),
|
||||||
|
playlist_id=pl_id)
|
||||||
|
@ -91,12 +91,12 @@ class YoutubeBaseInfoExtractor(InfoExtractor):
|
|||||||
'INNERTUBE_CONTEXT': {
|
'INNERTUBE_CONTEXT': {
|
||||||
'client': {
|
'client': {
|
||||||
'clientName': 'IOS',
|
'clientName': 'IOS',
|
||||||
'clientVersion': '19.45.4',
|
'clientVersion': '20.10.4',
|
||||||
'deviceMake': 'Apple',
|
'deviceMake': 'Apple',
|
||||||
'deviceModel': 'iPhone16,2',
|
'deviceModel': 'iPhone16,2',
|
||||||
'userAgent': 'com.google.ios.youtube/19.45.4 (iPhone16,2; U; CPU iOS 18_1_0 like Mac OS X;)',
|
'userAgent': 'com.google.ios.youtube/20.10.4 (iPhone16,2; U; CPU iOS 18_3_2 like Mac OS X;)',
|
||||||
'osName': 'iPhone',
|
'osName': 'iPhone',
|
||||||
'osVersion': '18.1.0.22B83',
|
'osVersion': '18.3.2.22D82',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
'INNERTUBE_CONTEXT_CLIENT_NAME': 5,
|
'INNERTUBE_CONTEXT_CLIENT_NAME': 5,
|
||||||
@ -109,7 +109,7 @@ class YoutubeBaseInfoExtractor(InfoExtractor):
|
|||||||
'INNERTUBE_CONTEXT': {
|
'INNERTUBE_CONTEXT': {
|
||||||
'client': {
|
'client': {
|
||||||
'clientName': 'MWEB',
|
'clientName': 'MWEB',
|
||||||
'clientVersion': '2.20241202.07.00',
|
'clientVersion': '2.20250311.03.00',
|
||||||
# mweb previously did not require PO Token with this UA
|
# mweb previously did not require PO Token with this UA
|
||||||
'userAgent': 'Mozilla/5.0 (iPad; CPU OS 16_7_10 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.6 Mobile/15E148 Safari/604.1,gzip(gfe)',
|
'userAgent': 'Mozilla/5.0 (iPad; CPU OS 16_7_10 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.6 Mobile/15E148 Safari/604.1,gzip(gfe)',
|
||||||
},
|
},
|
||||||
@ -122,7 +122,7 @@ class YoutubeBaseInfoExtractor(InfoExtractor):
|
|||||||
'INNERTUBE_CONTEXT': {
|
'INNERTUBE_CONTEXT': {
|
||||||
'client': {
|
'client': {
|
||||||
'clientName': 'TVHTML5',
|
'clientName': 'TVHTML5',
|
||||||
'clientVersion': '7.20250120.19.00',
|
'clientVersion': '7.20250312.16.00',
|
||||||
'userAgent': 'Mozilla/5.0 (ChromiumStylePlatform) Cobalt/Version',
|
'userAgent': 'Mozilla/5.0 (ChromiumStylePlatform) Cobalt/Version',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@ -133,7 +133,7 @@ class YoutubeBaseInfoExtractor(InfoExtractor):
|
|||||||
'INNERTUBE_CONTEXT': {
|
'INNERTUBE_CONTEXT': {
|
||||||
'client': {
|
'client': {
|
||||||
'clientName': 'WEB',
|
'clientName': 'WEB',
|
||||||
'clientVersion': '2.20241126.01.00',
|
'clientVersion': '2.20250312.04.00',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
'INNERTUBE_CONTEXT_CLIENT_NAME': 1,
|
'INNERTUBE_CONTEXT_CLIENT_NAME': 1,
|
||||||
@ -692,7 +692,7 @@ class YoutubeIE(YoutubeBaseInfoExtractor):
|
|||||||
'invidious': '|'.join(_INVIDIOUS_SITES),
|
'invidious': '|'.join(_INVIDIOUS_SITES),
|
||||||
}
|
}
|
||||||
_PLAYER_INFO_RE = (
|
_PLAYER_INFO_RE = (
|
||||||
r'/s/player/(?P<id>[a-zA-Z0-9_-]{8,})/player',
|
r'/s/player/(?P<id>[a-zA-Z0-9_-]{8,})//(?:tv-)?player',
|
||||||
r'/(?P<id>[a-zA-Z0-9_-]{8,})/player(?:_ias\.vflset(?:/[a-zA-Z]{2,3}_[a-zA-Z]{2,3})?|-plasma-ias-(?:phone|tablet)-[a-z]{2}_[A-Z]{2}\.vflset)/base\.js$',
|
r'/(?P<id>[a-zA-Z0-9_-]{8,})/player(?:_ias\.vflset(?:/[a-zA-Z]{2,3}_[a-zA-Z]{2,3})?|-plasma-ias-(?:phone|tablet)-[a-z]{2}_[A-Z]{2}\.vflset)/base\.js$',
|
||||||
r'\b(?P<id>vfl[a-zA-Z0-9_-]+)\b.*?\.js$',
|
r'\b(?P<id>vfl[a-zA-Z0-9_-]+)\b.*?\.js$',
|
||||||
)
|
)
|
||||||
@ -1857,7 +1857,7 @@ class YoutubeIE(YoutubeBaseInfoExtractor):
|
|||||||
def _extract_n_function_code_jsi(self, video_id, jsi, player_id=None):
|
def _extract_n_function_code_jsi(self, video_id, jsi, player_id=None):
|
||||||
|
|
||||||
var_ay = self._search_regex(
|
var_ay = self._search_regex(
|
||||||
r'(?:[;\s]|^)\s*(var\s*[\w$]+\s*=\s*"[^"]+"\s*\.\s*split\("\{"\))(?=\s*[,;])',
|
r'(?:[;\s]|^)\s*(var\s*[\w$]+\s*=\s*"(?:\\"|[^"])+"\s*\.\s*split\("\W+"\))(?=\s*[,;])',
|
||||||
jsi.code, 'useful values', default='')
|
jsi.code, 'useful values', default='')
|
||||||
|
|
||||||
func_name = self._extract_n_function_name(jsi.code)
|
func_name = self._extract_n_function_name(jsi.code)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user