kopia lustrzana https://github.com/yt-dlp/yt-dlp
Porównaj commity
10 Commity
4f3f201d64
...
7fa89c7adc
Autor | SHA1 | Data |
---|---|---|
Grabien | 7fa89c7adc | |
bashonly | e3b42d8b1b | |
bashonly | c9ce57d9bf | |
bashonly | 02483bea1c | |
Grabien | fe354fa548 | |
Grabien | 35b614b598 | |
Grabien | 974babf965 | |
pukkandan | c6f0d05213 | |
Grabien | 2f54918f30 | |
Grabien | 424dd9e061 |
|
@ -254,7 +254,7 @@ jobs:
|
||||||
# We need to fuse our own universal2 wheels for curl_cffi
|
# We need to fuse our own universal2 wheels for curl_cffi
|
||||||
python3 -m pip install -U --user delocate
|
python3 -m pip install -U --user delocate
|
||||||
mkdir curl_cffi_whls curl_cffi_universal2
|
mkdir curl_cffi_whls curl_cffi_universal2
|
||||||
python3 devscripts/install_deps.py --print -o --include curl_cffi > requirements.txt
|
python3 devscripts/install_deps.py --print -o --include curl-cffi > requirements.txt
|
||||||
for platform in "macosx_11_0_arm64" "macosx_11_0_x86_64"; do
|
for platform in "macosx_11_0_arm64" "macosx_11_0_x86_64"; do
|
||||||
python3 -m pip download \
|
python3 -m pip download \
|
||||||
--only-binary=:all: \
|
--only-binary=:all: \
|
||||||
|
@ -362,7 +362,7 @@ jobs:
|
||||||
- name: Install Requirements
|
- name: Install Requirements
|
||||||
run: | # Custom pyinstaller built with https://github.com/yt-dlp/pyinstaller-builds
|
run: | # Custom pyinstaller built with https://github.com/yt-dlp/pyinstaller-builds
|
||||||
python devscripts/install_deps.py -o --include build
|
python devscripts/install_deps.py -o --include build
|
||||||
python devscripts/install_deps.py --include py2exe --include curl_cffi
|
python devscripts/install_deps.py --include py2exe --include curl-cffi
|
||||||
python -m pip install -U "https://yt-dlp.github.io/Pyinstaller-Builds/x86_64/pyinstaller-5.8.0-py3-none-any.whl"
|
python -m pip install -U "https://yt-dlp.github.io/Pyinstaller-Builds/x86_64/pyinstaller-5.8.0-py3-none-any.whl"
|
||||||
|
|
||||||
- name: Prepare
|
- name: Prepare
|
||||||
|
|
|
@ -202,7 +202,7 @@ While all the other dependencies are optional, `ffmpeg` and `ffprobe` are highly
|
||||||
The following provide support for impersonating browser requests. This may be required for some sites that employ TLS fingerprinting.
|
The following provide support for impersonating browser requests. This may be required for some sites that employ TLS fingerprinting.
|
||||||
|
|
||||||
* [**curl_cffi**](https://github.com/yifeikong/curl_cffi) (recommended) - Python binding for [curl-impersonate](https://github.com/lwthiker/curl-impersonate). Provides impersonation targets for Chrome, Edge and Safari. Licensed under [MIT](https://github.com/yifeikong/curl_cffi/blob/main/LICENSE)
|
* [**curl_cffi**](https://github.com/yifeikong/curl_cffi) (recommended) - Python binding for [curl-impersonate](https://github.com/lwthiker/curl-impersonate). Provides impersonation targets for Chrome, Edge and Safari. Licensed under [MIT](https://github.com/yifeikong/curl_cffi/blob/main/LICENSE)
|
||||||
* Can be installed with the `curl_cffi` group, e.g. `pip install yt-dlp[default,curl_cffi]`
|
* Can be installed with the `curl-cffi` group, e.g. `pip install yt-dlp[default,curl-cffi]`
|
||||||
* Currently only included in `yt-dlp.exe` and `yt-dlp_macos` builds
|
* Currently only included in `yt-dlp.exe` and `yt-dlp_macos` builds
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -53,7 +53,7 @@ dependencies = [
|
||||||
|
|
||||||
[project.optional-dependencies]
|
[project.optional-dependencies]
|
||||||
default = []
|
default = []
|
||||||
curl_cffi = ["curl-cffi==0.5.10; implementation_name=='cpython'"]
|
curl-cffi = ["curl-cffi==0.5.10; implementation_name=='cpython'"]
|
||||||
secretstorage = [
|
secretstorage = [
|
||||||
"cffi",
|
"cffi",
|
||||||
"secretstorage",
|
"secretstorage",
|
||||||
|
|
|
@ -560,7 +560,7 @@ class FacebookIE(InfoExtractor):
|
||||||
js_data, lambda x: x['jsmods']['instances'], list) or [])
|
js_data, lambda x: x['jsmods']['instances'], list) or [])
|
||||||
|
|
||||||
def extract_dash_manifest(video, formats):
|
def extract_dash_manifest(video, formats):
|
||||||
dash_manifest = video.get('dash_manifest')
|
dash_manifest = traverse_obj(video, 'dash_manifest', 'playlist', expected_type=str)
|
||||||
if dash_manifest:
|
if dash_manifest:
|
||||||
formats.extend(self._parse_mpd_formats(
|
formats.extend(self._parse_mpd_formats(
|
||||||
compat_etree_fromstring(urllib.parse.unquote_plus(dash_manifest)),
|
compat_etree_fromstring(urllib.parse.unquote_plus(dash_manifest)),
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
import itertools
|
import itertools
|
||||||
|
import urllib.parse
|
||||||
|
|
||||||
from .common import InfoExtractor
|
from .common import InfoExtractor
|
||||||
from .vimeo import VimeoIE
|
from .vimeo import VimeoIE
|
||||||
from ..compat import compat_urllib_parse_unquote
|
|
||||||
from ..networking.exceptions import HTTPError
|
from ..networking.exceptions import HTTPError
|
||||||
from ..utils import (
|
from ..utils import (
|
||||||
KNOWN_EXTENSIONS,
|
KNOWN_EXTENSIONS,
|
||||||
|
@ -14,7 +14,6 @@ from ..utils import (
|
||||||
parse_iso8601,
|
parse_iso8601,
|
||||||
str_or_none,
|
str_or_none,
|
||||||
traverse_obj,
|
traverse_obj,
|
||||||
try_get,
|
|
||||||
url_or_none,
|
url_or_none,
|
||||||
urljoin,
|
urljoin,
|
||||||
)
|
)
|
||||||
|
@ -199,6 +198,27 @@ class PatreonIE(PatreonBaseIE):
|
||||||
'channel_id': '2147162',
|
'channel_id': '2147162',
|
||||||
'uploader_url': 'https://www.patreon.com/yaboyroshi',
|
'uploader_url': 'https://www.patreon.com/yaboyroshi',
|
||||||
},
|
},
|
||||||
|
}, {
|
||||||
|
# NSFW vimeo embed URL
|
||||||
|
'url': 'https://www.patreon.com/posts/4k-spiderman-4k-96414599',
|
||||||
|
'info_dict': {
|
||||||
|
'id': '902250943',
|
||||||
|
'ext': 'mp4',
|
||||||
|
'title': '❤️(4K) Spiderman Girl Yeonhwa’s Gift ❤️(4K) 스파이더맨걸 연화의 선물',
|
||||||
|
'description': '❤️(4K) Spiderman Girl Yeonhwa’s Gift \n❤️(4K) 스파이더맨걸 연화의 선물',
|
||||||
|
'uploader': 'Npickyeonhwa',
|
||||||
|
'uploader_id': '90574422',
|
||||||
|
'uploader_url': 'https://www.patreon.com/Yeonhwa726',
|
||||||
|
'channel_id': '10237902',
|
||||||
|
'channel_url': 'https://www.patreon.com/Yeonhwa726',
|
||||||
|
'duration': 70,
|
||||||
|
'timestamp': 1705150153,
|
||||||
|
'upload_date': '20240113',
|
||||||
|
'comment_count': int,
|
||||||
|
'like_count': int,
|
||||||
|
'thumbnail': r're:^https?://.+',
|
||||||
|
},
|
||||||
|
'params': {'skip_download': 'm3u8'},
|
||||||
}]
|
}]
|
||||||
|
|
||||||
def _real_extract(self, url):
|
def _real_extract(self, url):
|
||||||
|
@ -268,16 +288,19 @@ class PatreonIE(PatreonBaseIE):
|
||||||
})
|
})
|
||||||
|
|
||||||
# handle Vimeo embeds
|
# handle Vimeo embeds
|
||||||
if try_get(attributes, lambda x: x['embed']['provider']) == 'Vimeo':
|
if traverse_obj(attributes, ('embed', 'provider')) == 'Vimeo':
|
||||||
embed_html = try_get(attributes, lambda x: x['embed']['html'])
|
v_url = urllib.parse.unquote(self._html_search_regex(
|
||||||
v_url = url_or_none(compat_urllib_parse_unquote(
|
r'(https(?:%3A%2F%2F|://)player\.vimeo\.com.+app_id(?:=|%3D)+\d+)',
|
||||||
self._search_regex(r'(https(?:%3A%2F%2F|://)player\.vimeo\.com.+app_id(?:=|%3D)+\d+)', embed_html, 'vimeo url', fatal=False)))
|
traverse_obj(attributes, ('embed', 'html', {str})), 'vimeo url', fatal=False) or '')
|
||||||
if v_url:
|
if url_or_none(v_url) and self._request_webpage(
|
||||||
v_url = VimeoIE._smuggle_referrer(v_url, 'https://patreon.com')
|
v_url, video_id, 'Checking Vimeo embed URL',
|
||||||
if self._request_webpage(v_url, video_id, 'Checking Vimeo embed URL', fatal=False, errnote=False):
|
headers={'Referer': 'https://patreon.com/'},
|
||||||
return self.url_result(v_url, VimeoIE, url_transparent=True, **info)
|
fatal=False, errnote=False):
|
||||||
|
return self.url_result(
|
||||||
|
VimeoIE._smuggle_referrer(v_url, 'https://patreon.com/'),
|
||||||
|
VimeoIE, url_transparent=True, **info)
|
||||||
|
|
||||||
embed_url = try_get(attributes, lambda x: x['embed']['url'])
|
embed_url = traverse_obj(attributes, ('embed', 'url', {url_or_none}))
|
||||||
if embed_url and self._request_webpage(embed_url, video_id, 'Checking embed URL', fatal=False, errnote=False):
|
if embed_url and self._request_webpage(embed_url, video_id, 'Checking embed URL', fatal=False, errnote=False):
|
||||||
return self.url_result(embed_url, **info)
|
return self.url_result(embed_url, **info)
|
||||||
|
|
||||||
|
|
|
@ -12,37 +12,37 @@ from ..utils import (
|
||||||
)
|
)
|
||||||
|
|
||||||
_COMMITTEES = {
|
_COMMITTEES = {
|
||||||
'ag': ('76440', 'http://ag-f.akamaihd.net'),
|
'ag': ('76440', 'https://ag-f.akamaihd.net', '2036803', 'agriculture'),
|
||||||
'aging': ('76442', 'http://aging-f.akamaihd.net'),
|
'aging': ('76442', 'https://aging-f.akamaihd.net', '2036801', 'aging'),
|
||||||
'approps': ('76441', 'http://approps-f.akamaihd.net'),
|
'approps': ('76441', 'https://approps-f.akamaihd.net', '2036802', 'appropriations'),
|
||||||
'arch': ('', 'http://ussenate-f.akamaihd.net'),
|
'arch': ('', 'https://ussenate-f.akamaihd.net/', '', 'arch'),
|
||||||
'armed': ('76445', 'http://armed-f.akamaihd.net'),
|
'armed': ('76445', 'https://armed-f.akamaihd.net', '2036800', 'armedservices'),
|
||||||
'banking': ('76446', 'http://banking-f.akamaihd.net'),
|
'banking': ('76446', 'https://banking-f.akamaihd.net', '2036799', 'banking'),
|
||||||
'budget': ('76447', 'http://budget-f.akamaihd.net'),
|
'budget': ('76447', 'https://budget-f.akamaihd.net', '2036798', 'budget'),
|
||||||
'cecc': ('76486', 'http://srs-f.akamaihd.net'),
|
'cecc': ('76486', 'https://srs-f.akamaihd.net', '2036782', 'srs_cecc'),
|
||||||
'commerce': ('80177', 'http://commerce1-f.akamaihd.net'),
|
'commerce': ('80177', 'https://commerce1-f.akamaihd.net', '2036779', 'commerce'),
|
||||||
'csce': ('75229', 'http://srs-f.akamaihd.net'),
|
'csce': ('75229', 'https://srs-f.akamaihd.net', '2036777', 'srs_srs'),
|
||||||
'dpc': ('76590', 'http://dpc-f.akamaihd.net'),
|
'dpc': ('76590', 'https://dpc-f.akamaihd.net', '', 'dpc'),
|
||||||
'energy': ('76448', 'http://energy-f.akamaihd.net'),
|
'energy': ('76448', 'https://energy-f.akamaihd.net', '2036797', 'energy'),
|
||||||
'epw': ('76478', 'http://epw-f.akamaihd.net'),
|
'epw': ('76478', 'https://epw-f.akamaihd.net', '2036783', 'environment'),
|
||||||
'ethics': ('76449', 'http://ethics-f.akamaihd.net'),
|
'ethics': ('76449', 'https://ethics-f.akamaihd.net', '2036796', 'ethics'),
|
||||||
'finance': ('76450', 'http://finance-f.akamaihd.net'),
|
'finance': ('76450', 'https://finance-f.akamaihd.net', '2036795', 'finance_finance'),
|
||||||
'foreign': ('76451', 'http://foreign-f.akamaihd.net'),
|
'foreign': ('76451', 'https://foreign-f.akamaihd.net', '2036794', 'foreignrelations'),
|
||||||
'govtaff': ('76453', 'http://govtaff-f.akamaihd.net'),
|
'govtaff': ('76453', 'https://govtaff-f.akamaihd.net', '2036792', 'hsgac'),
|
||||||
'help': ('76452', 'http://help-f.akamaihd.net'),
|
'help': ('76452', 'https://help-f.akamaihd.net', '2036793', 'help'),
|
||||||
'indian': ('76455', 'http://indian-f.akamaihd.net'),
|
'indian': ('76455', 'https://indian-f.akamaihd.net', '2036791', 'indianaffairs'),
|
||||||
'intel': ('76456', 'http://intel-f.akamaihd.net'),
|
'intel': ('76456', 'https://intel-f.akamaihd.net', '2036790', 'intelligence'),
|
||||||
'intlnarc': ('76457', 'http://intlnarc-f.akamaihd.net'),
|
'intlnarc': ('76457', 'https://intlnarc-f.akamaihd.net', '', 'internationalnarcoticscaucus'),
|
||||||
'jccic': ('85180', 'http://jccic-f.akamaihd.net'),
|
'jccic': ('85180', 'https://jccic-f.akamaihd.net', '2036778', 'jccic'),
|
||||||
'jec': ('76458', 'http://jec-f.akamaihd.net'),
|
'jec': ('76458', 'https://jec-f.akamaihd.net', '2036789', 'jointeconomic'),
|
||||||
'judiciary': ('76459', 'http://judiciary-f.akamaihd.net'),
|
'judiciary': ('76459', 'https://judiciary-f.akamaihd.net', '2036788', 'judiciary'),
|
||||||
'rpc': ('76591', 'http://rpc-f.akamaihd.net'),
|
'rpc': ('76591', 'https://rpc-f.akamaihd.net', '', 'rpc'),
|
||||||
'rules': ('76460', 'http://rules-f.akamaihd.net'),
|
'rules': ('76460', 'https://rules-f.akamaihd.net', '2036787', 'rules'),
|
||||||
'saa': ('76489', 'http://srs-f.akamaihd.net'),
|
'saa': ('76489', 'https://srs-f.akamaihd.net', '2036780', 'srs_saa'),
|
||||||
'smbiz': ('76461', 'http://smbiz-f.akamaihd.net'),
|
'smbiz': ('76461', 'https://smbiz-f.akamaihd.net', '2036786', 'smallbusiness'),
|
||||||
'srs': ('75229', 'http://srs-f.akamaihd.net'),
|
'srs': ('75229', 'https://srs-f.akamaihd.net', '2031966', 'srs_srs'),
|
||||||
'uscc': ('76487', 'http://srs-f.akamaihd.net'),
|
'uscc': ('76487', 'https://srs-f.akamaihd.net', '2036781', 'srs_uscc'),
|
||||||
'vetaff': ('76462', 'http://vetaff-f.akamaihd.net'),
|
'vetaff': ('76462', 'https://vetaff-f.akamaihd.net', '2036785', 'veteransaffairs'),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -176,15 +176,23 @@ class SenateGovIE(InfoExtractor):
|
||||||
def _real_extract(self, url):
|
def _real_extract(self, url):
|
||||||
display_id = self._generic_id(url)
|
display_id = self._generic_id(url)
|
||||||
webpage = self._download_webpage(url, display_id)
|
webpage = self._download_webpage(url, display_id)
|
||||||
parse_info = parse_qs(self._search_regex(
|
iframe_src = self._search_regex(
|
||||||
r'<iframe class="[^>"]*streaminghearing[^>"]*"\s[^>]*\bsrc="([^">]*)', webpage, 'hearing URL'))
|
(r'<iframe class="[^>"]*streaminghearing[^>"]*"\s[^>]*\bsrc="([^">]*)',
|
||||||
|
r'<iframe title="[^>"]*[^>"]*"\s[^>]*\bsrc="([^">]*)'),
|
||||||
stream_num, stream_domain = _COMMITTEES[parse_info['comm'][-1]]
|
webpage, 'hearing URL').replace('&', '&')
|
||||||
|
parse_info = parse_qs(iframe_src)
|
||||||
|
comm = parse_info['comm'][-1]
|
||||||
|
stream_num, stream_domain, stream_id, msl3 = _COMMITTEES[comm]
|
||||||
filename = parse_info['filename'][-1]
|
filename = parse_info['filename'][-1]
|
||||||
|
|
||||||
formats = self._extract_m3u8_formats(
|
urls_alternatives = [f'https://www-senate-gov-media-srs.akamaized.net/hls/live/{stream_id}/{comm}/{filename}/master.m3u8',
|
||||||
f'{stream_domain}/i/{filename}_1@{stream_num}/master.m3u8',
|
f'https://www-senate-gov-msl3archive.akamaized.net/{msl3}/{filename}_1/master.m3u8',
|
||||||
display_id, ext='mp4')
|
f'{stream_domain}/i/{filename}_1@{stream_num}/master.m3u8',
|
||||||
|
f'{stream_domain}/i/{filename}.mp4/master.m3u8']
|
||||||
|
for video_url in urls_alternatives:
|
||||||
|
formats = self._extract_m3u8_formats(video_url, display_id, ext='mp4', fatal=False)
|
||||||
|
if formats:
|
||||||
|
break
|
||||||
|
|
||||||
title = self._html_search_regex(
|
title = self._html_search_regex(
|
||||||
(*self._og_regexes('title'), r'(?s)<title>([^<]*?)</title>'), webpage, 'video title')
|
(*self._og_regexes('title'), r'(?s)<title>([^<]*?)</title>'), webpage, 'video title')
|
||||||
|
|
Ładowanie…
Reference in New Issue