Compare commits
26 commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
872be1ead1 | ||
|
|
c735633bea | ||
|
|
42fdd3ce6a | ||
|
|
867a974914 | ||
|
|
10b91c5217 |
||
|
|
285db11a03 |
||
|
|
8a8fa40127 |
||
|
|
e670aadef4 |
||
|
|
b7688c102a |
||
|
|
24e233f6dc |
||
|
|
83016da260 |
||
|
|
8841f17ca5 |
||
|
|
f7a988be06 | ||
|
|
20084687dc | ||
|
|
5be0950134 | ||
|
|
e745908aec | ||
|
|
6b9deb5086 | ||
|
|
0b3bfa128f | ||
|
|
bb236482e6 | ||
|
|
9690485ec7 | ||
|
|
699b594e50 | ||
|
|
50a4a661a1 | ||
|
|
429a67881c | ||
|
|
c070263390 | ||
|
|
64d87fdda4 | ||
|
|
3093ca0390 |
7 changed files with 180 additions and 145 deletions
15
.gitignore
vendored
15
.gitignore
vendored
|
|
@ -59,18 +59,3 @@
|
|||
/yt-dlp-2025.06.25.tar.gz
|
||||
/yt-dlp-2025.06.30.tar.gz
|
||||
/yt-dlp-2025.07.21.tar.gz
|
||||
/yt-dlp-2025.08.11.tar.gz
|
||||
/yt-dlp-2025.08.22.tar.gz
|
||||
/yt-dlp-2025.08.27.tar.gz
|
||||
/yt-dlp-2025.09.05.tar.gz
|
||||
/yt-dlp-2025.09.26.tar.gz
|
||||
/yt-dlp-2025.10.22.tar.gz
|
||||
/yt-dlp-2025.12.08.tar.gz
|
||||
/yt-dlp-2026.01.29.tar.gz
|
||||
/yt-dlp-2026.02.04.tar.gz
|
||||
/yt-dlp-2026.02.21.tar.gz
|
||||
/yt-dlp-2026.03.03.tar.gz
|
||||
/yt-dlp-2026.03.13.tar.gz
|
||||
/yt-dlp-2026.03.17.tar.gz
|
||||
/yt-dlp-2026.06.09.tar.gz
|
||||
/yt-dlp-2026.08.19.tar.gz
|
||||
|
|
|
|||
119
0001-Revert-rh-websockets-Upgrade-websockets-to-13.0-1081.patch
Normal file
119
0001-Revert-rh-websockets-Upgrade-websockets-to-13.0-1081.patch
Normal file
|
|
@ -0,0 +1,119 @@
|
|||
From fbc486f4fac78bfd49011c1b60362e656c679c71 Mon Sep 17 00:00:00 2001
|
||||
From: Maxwell G <maxwell@gtmx.me>
|
||||
Date: Mon, 6 Jan 2025 14:37:58 -0600
|
||||
Subject: [PATCH 1/2] Revert "[rh:websockets] Upgrade websockets to 13.0
|
||||
(#10815)"
|
||||
|
||||
This reverts commit 6f9e6537434562d513d0c9b68ced8a61ade94a64.
|
||||
---
|
||||
.github/workflows/core.yml | 1 -
|
||||
.github/workflows/quick-test.yml | 1 -
|
||||
pyproject.toml | 2 +-
|
||||
test/test_websockets.py | 8 ++++----
|
||||
yt_dlp/networking/_websockets.py | 5 ++++-
|
||||
5 files changed, 9 insertions(+), 8 deletions(-)
|
||||
|
||||
diff --git a/.github/workflows/core.yml b/.github/workflows/core.yml
|
||||
index 9a4342a58..bed3af94b 100644
|
||||
--- a/.github/workflows/core.yml
|
||||
+++ b/.github/workflows/core.yml
|
||||
@@ -59,7 +59,6 @@ jobs:
|
||||
- name: Install test requirements
|
||||
run: python3 ./devscripts/install_deps.py --include test --include curl-cffi
|
||||
- name: Run tests
|
||||
- timeout-minutes: 15
|
||||
continue-on-error: False
|
||||
run: |
|
||||
python3 -m yt_dlp -v || true # Print debug head
|
||||
diff --git a/.github/workflows/quick-test.yml b/.github/workflows/quick-test.yml
|
||||
index 1a32bbfe3..235a2c64d 100644
|
||||
--- a/.github/workflows/quick-test.yml
|
||||
+++ b/.github/workflows/quick-test.yml
|
||||
@@ -17,7 +17,6 @@ jobs:
|
||||
- name: Install test requirements
|
||||
run: python3 ./devscripts/install_deps.py -o --include test
|
||||
- name: Run tests
|
||||
- timeout-minutes: 15
|
||||
run: |
|
||||
python3 -m yt_dlp -v || true
|
||||
python3 ./devscripts/run_tests.py --pytest-args '--reruns 2 --reruns-delay 3.0' core
|
||||
diff --git a/pyproject.toml b/pyproject.toml
|
||||
index 5e987a6fd..6810415d1 100644
|
||||
--- a/pyproject.toml
|
||||
+++ b/pyproject.toml
|
||||
@@ -52,7 +52,7 @@ default = [
|
||||
"pycryptodomex",
|
||||
"requests>=2.32.2,<3",
|
||||
"urllib3>=1.26.17,<3",
|
||||
- "websockets>=13.0",
|
||||
+ "websockets>=12.0",
|
||||
]
|
||||
curl-cffi = [
|
||||
"curl-cffi>=0.5.10,!=0.6.*,!=0.7.*,!=0.8.*,!=0.9.*,<0.11; implementation_name=='cpython'",
|
||||
diff --git a/test/test_websockets.py b/test/test_websockets.py
|
||||
index dead5fe5c..5e0ce48cc 100644
|
||||
--- a/test/test_websockets.py
|
||||
+++ b/test/test_websockets.py
|
||||
@@ -88,7 +88,7 @@ def create_wss_websocket_server():
|
||||
certfn = os.path.join(TEST_DIR, 'testcert.pem')
|
||||
sslctx = ssl.SSLContext(ssl.PROTOCOL_TLS_SERVER)
|
||||
sslctx.load_cert_chain(certfn, None)
|
||||
- return create_websocket_server(ssl=sslctx)
|
||||
+ return create_websocket_server(ssl_context=sslctx)
|
||||
|
||||
|
||||
MTLS_CERT_DIR = os.path.join(TEST_DIR, 'testdata', 'certificate')
|
||||
@@ -103,7 +103,7 @@ def create_mtls_wss_websocket_server():
|
||||
sslctx.load_verify_locations(cafile=cacertfn)
|
||||
sslctx.load_cert_chain(certfn, None)
|
||||
|
||||
- return create_websocket_server(ssl=sslctx)
|
||||
+ return create_websocket_server(ssl_context=sslctx)
|
||||
|
||||
|
||||
def create_legacy_wss_websocket_server():
|
||||
@@ -112,7 +112,7 @@ def create_legacy_wss_websocket_server():
|
||||
sslctx.maximum_version = ssl.TLSVersion.TLSv1_2
|
||||
sslctx.set_ciphers('SHA1:AESCCM:aDSS:eNULL:aNULL')
|
||||
sslctx.load_cert_chain(certfn, None)
|
||||
- return create_websocket_server(ssl=sslctx)
|
||||
+ return create_websocket_server(ssl_context=sslctx)
|
||||
|
||||
|
||||
def ws_validate_and_send(rh, req):
|
||||
@@ -139,7 +139,7 @@ def setup_class(cls):
|
||||
cls.wss_thread, cls.wss_port = create_wss_websocket_server()
|
||||
cls.wss_base_url = f'wss://127.0.0.1:{cls.wss_port}'
|
||||
|
||||
- cls.bad_wss_thread, cls.bad_wss_port = create_websocket_server(ssl=ssl.SSLContext(ssl.PROTOCOL_TLS_SERVER))
|
||||
+ cls.bad_wss_thread, cls.bad_wss_port = create_websocket_server(ssl_context=ssl.SSLContext(ssl.PROTOCOL_TLS_SERVER))
|
||||
cls.bad_wss_host = f'wss://127.0.0.1:{cls.bad_wss_port}'
|
||||
|
||||
cls.mtls_wss_thread, cls.mtls_wss_port = create_mtls_wss_websocket_server()
|
||||
diff --git a/yt_dlp/networking/_websockets.py b/yt_dlp/networking/_websockets.py
|
||||
index d29f8e45a..a2bdb9c82 100644
|
||||
--- a/yt_dlp/networking/_websockets.py
|
||||
+++ b/yt_dlp/networking/_websockets.py
|
||||
@@ -48,7 +48,10 @@
|
||||
# 2: "AttributeError: 'ClientConnection' object has no attribute 'recv_events_exc'. Did you mean: 'recv_events'?"
|
||||
import websockets.sync.connection # isort: split
|
||||
with contextlib.suppress(Exception):
|
||||
+ # > 12.0
|
||||
websockets.sync.connection.Connection.recv_exc = None
|
||||
+ # 12.0
|
||||
+ websockets.sync.connection.Connection.recv_events_exc = None
|
||||
|
||||
|
||||
class WebsocketsResponseAdapter(WebSocketResponse):
|
||||
@@ -162,7 +165,7 @@ def _send(self, request):
|
||||
additional_headers=headers,
|
||||
open_timeout=timeout,
|
||||
user_agent_header=None,
|
||||
- ssl=ssl_ctx if wsuri.secure else None,
|
||||
+ ssl_context=ssl_ctx if wsuri.secure else None,
|
||||
close_timeout=0, # not ideal, but prevents yt-dlp hanging
|
||||
)
|
||||
return WebsocketsResponseAdapter(conn, url=request.url)
|
||||
--
|
||||
2.48.1
|
||||
|
||||
|
|
@ -1,46 +0,0 @@
|
|||
From b958f102848b73edeec7bb92fff8d4d002ae4b23 Mon Sep 17 00:00:00 2001
|
||||
From: Maxwell G <maxwell@gtmx.me>
|
||||
Date: Thu, 18 Jun 2026 21:19:45 -0500
|
||||
Subject: [PATCH 2/2] Restore compatibility with pytest < 9
|
||||
|
||||
---
|
||||
pyproject.toml | 4 +---
|
||||
test/test_downloader_external.py | 2 +-
|
||||
2 files changed, 2 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/pyproject.toml b/pyproject.toml
|
||||
index 8128fb3..8bb3631 100644
|
||||
--- a/pyproject.toml
|
||||
+++ b/pyproject.toml
|
||||
@@ -467,14 +467,12 @@ select = [
|
||||
]
|
||||
exclude = "*/extractor/lazy_extractors.py,*venv*,*/test/testdata/sigs/player-*.js,.idea,.vscode"
|
||||
|
||||
-[tool.pytest]
|
||||
+[tool.pytest.ini_options]
|
||||
addopts = [
|
||||
"-ra", # summary: all except passed
|
||||
"--tb=short",
|
||||
]
|
||||
verbosity_test_cases = "1"
|
||||
-strict_config = true
|
||||
-strict_markers = true
|
||||
markers = [
|
||||
"download",
|
||||
]
|
||||
diff --git a/test/test_downloader_external.py b/test/test_downloader_external.py
|
||||
index 0b51c96..d318d3c 100644
|
||||
--- a/test/test_downloader_external.py
|
||||
+++ b/test/test_downloader_external.py
|
||||
@@ -132,7 +132,7 @@ class TestDownloaderCookieBehavior:
|
||||
pytest.param(WgetFD, marks=pytest.mark.skipif(not WgetFD.available(), reason='wget unavailable')),
|
||||
pytest.param(Aria2cFD, marks=pytest.mark.skipif(not Aria2cFD.available(), reason='aria2c unavailable')),
|
||||
])
|
||||
- def test_cookie_behavior(self, /, downloader_cls):
|
||||
+ def test_cookie_behavior(self, downloader_cls):
|
||||
with FakeYDL() as ydl:
|
||||
downloader = downloader_cls(ydl, {})
|
||||
|
||||
--
|
||||
2.54.0
|
||||
|
||||
45
17491.patch
45
17491.patch
|
|
@ -1,45 +0,0 @@
|
|||
From b6ef4e25fe882a82c02c12ca716f19fb3c1b89f3 Mon Sep 17 00:00:00 2001
|
||||
From: Mikel Olasagasti Uranga <mikel@olasagasti.info>
|
||||
Date: Thu, 20 Aug 2026 16:23:27 +0200
|
||||
Subject: [PATCH] tests: accept newer OpenSSL handshake error wording
|
||||
|
||||
Newer Python/OpenSSL combinations may report TLS handshake failures as
|
||||
"TLS_ALERT_HANDSHAKE_FAILURE" / "tls alert handshake failure" instead
|
||||
of the older "sslv3 alert handshake failure" wording expected by the
|
||||
test suite.
|
||||
|
||||
Relax the test regexes to accept both forms without changing the
|
||||
behavior being tested.
|
||||
|
||||
Signed-off-by: Mikel Olasagasti Uranga <mikel@olasagasti.info>
|
||||
---
|
||||
test/test_networking.py | 2 +-
|
||||
test/test_websockets.py | 2 +-
|
||||
2 files changed, 2 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/test/test_networking.py b/test/test_networking.py
|
||||
index 9dbe263b6fcd..57a7a21bd14b 100644
|
||||
--- a/test/test_networking.py
|
||||
+++ b/test/test_networking.py
|
||||
@@ -338,7 +338,7 @@ def test_ssl_error(self, handler):
|
||||
https_server_thread.start()
|
||||
|
||||
with handler(verify=False) as rh:
|
||||
- with pytest.raises(SSLError, match=r'(?i)ssl(?:v3|/tls).alert.handshake.failure') as exc_info:
|
||||
+ with pytest.raises(SSLError, match=r'(?i)(?:TLS_ALERT_HANDSHAKE_FAILURE|(?:sslv3|ssl/tls|tls).alert.handshake.failure)') as exc_info:
|
||||
validate_and_send(rh, Request(f'https://127.0.0.1:{https_port}/headers'))
|
||||
assert not issubclass(exc_info.type, CertificateVerifyError)
|
||||
|
||||
diff --git a/test/test_websockets.py b/test/test_websockets.py
|
||||
index caa026f44f3a..3b3814018eeb 100644
|
||||
--- a/test/test_websockets.py
|
||||
+++ b/test/test_websockets.py
|
||||
@@ -186,7 +186,7 @@ def test_verify_cert(self, handler):
|
||||
|
||||
def test_ssl_error(self, handler):
|
||||
with handler(verify=False) as rh:
|
||||
- with pytest.raises(SSLError, match=r'ssl(?:v3|/tls) alert handshake failure') as exc_info:
|
||||
+ with pytest.raises(SSLError, match=r'(?:TLS_ALERT_HANDSHAKE_FAILURE|(?:sslv3|ssl/tls|tls) alert handshake failure)') as exc_info:
|
||||
ws_validate_and_send(rh, Request(self.bad_wss_host))
|
||||
assert not issubclass(exc_info.type, CertificateVerifyError)
|
||||
|
||||
2
sources
2
sources
|
|
@ -1 +1 @@
|
|||
SHA512 (yt-dlp-2026.08.19.tar.gz) = 04f2dae28fe2b087fed3df38fc6787eac8f85a351bd72f3b010a84fb48bccf9bfde3a50ca4c005afb384f1219ee66a4cab24e5740eb1e5b8eb1a0d8ab773bafd
|
||||
SHA512 (yt-dlp-2025.06.30.tar.gz) = 06f1c332de89eb0df7bf455d0c4917183bb508060653af96e96cb45c366c2d53da93d192e9327a1c678abff7b37d2a10fa9eb4d07cac14ff105d6e7130f0ae27
|
||||
|
|
|
|||
93
yt-dlp.spec
93
yt-dlp.spec
|
|
@ -2,30 +2,30 @@
|
|||
# SPDX-License-Identifier: MIT
|
||||
# SPDX-FileCopyrightText: Fedora Project Authors
|
||||
# SPDX-FileCopyrightText: 2022 Maxwell G <gotmax@e.email>
|
||||
# License text: https://spdx.org/licenses/MIT.html
|
||||
# See yt-dlp.spec.license for the full license text.
|
||||
|
||||
%bcond_without tests
|
||||
|
||||
Name: yt-dlp
|
||||
Version: 2026.08.19
|
||||
Version: 2025.06.30
|
||||
Release: %autorelease
|
||||
Summary: A command-line program to download videos from online video platforms
|
||||
|
||||
License: Unlicense
|
||||
URL: https://github.com/yt-dlp/yt-dlp
|
||||
Source: %{url}/archive/%{version}/yt-dlp-%{version}.tar.gz
|
||||
# License of the specfile
|
||||
Source: yt-dlp.spec.license
|
||||
|
||||
# https://github.com/yt-dlp/yt-dlp/pull/17491
|
||||
# Relax handshake error regexp
|
||||
Patch: 17491.patch
|
||||
|
||||
# Needed for compatibility with Fedora <= 44
|
||||
Patch: 0002-Restore-compatibility-with-pytest-9.patch
|
||||
# https://github.com/yt-dlp/yt-dlp/commit/6f9e6537434562d513d0c9b68ced8a61ade94a64
|
||||
# [rh:websockets] Upgrade websockets to 13.0 (#10815)
|
||||
# Revert this patch for compatibility with older Fedora versions
|
||||
# This patch is applied conditionally to Fedora <= 41
|
||||
Patch1000: 0001-Revert-rh-websockets-Upgrade-websockets-to-13.0-1081.patch
|
||||
|
||||
BuildArch: noarch
|
||||
|
||||
BuildRequires: python3-devel
|
||||
BuildRequires: tomcli
|
||||
|
||||
%if %{with tests}
|
||||
# Needed for %%check
|
||||
|
|
@ -44,42 +44,54 @@ Recommends: /usr/bin/ffprobe
|
|||
|
||||
Suggests: python3dist(keyring)
|
||||
|
||||
# START: Remove in Fedora 46
|
||||
Provides: yt-dlp-bash-completion = %{version}-%{release}
|
||||
Obsoletes: yt-dlp-bash-completion < 2025.09.26-2
|
||||
|
||||
Provides: yt-dlp-fish-completion = %{version}-%{release}
|
||||
Obsoletes: yt-dlp-fish-completion < 2025.09.26-2
|
||||
|
||||
Provides: yt-dlp-zsh-completion = %{version}-%{release}
|
||||
Obsoletes: yt-dlp-zsh-completion < 2025.09.26-2
|
||||
# END: Remove in Fedora 46
|
||||
|
||||
%description
|
||||
%global _description %{expand:
|
||||
yt-dlp is a command-line program to download videos from many different online
|
||||
video platforms, such as youtube.com. The project is a fork of youtube-dl with
|
||||
additional features and fixes.
|
||||
additional features and fixes.}
|
||||
|
||||
%description %{_description}
|
||||
|
||||
%package bash-completion
|
||||
Summary: Bash completion for yt-dlp
|
||||
Requires: yt-dlp = %{version}-%{release}
|
||||
Requires: bash-completion
|
||||
Supplements: (yt-dlp and bash-completion)
|
||||
|
||||
%description bash-completion
|
||||
Bash command line completion support for yt-dlp.
|
||||
|
||||
%package zsh-completion
|
||||
Summary: Zsh completion for yt-dlp
|
||||
Requires: yt-dlp = %{version}-%{release}
|
||||
Requires: zsh
|
||||
Supplements: (yt-dlp and zsh)
|
||||
|
||||
%description zsh-completion
|
||||
Zsh command line completion support for yt-dlp.
|
||||
|
||||
%package fish-completion
|
||||
Summary: Fish completion for yt-dlp
|
||||
Requires: yt-dlp = %{version}-%{release}
|
||||
Requires: fish
|
||||
Supplements: (yt-dlp and fish)
|
||||
|
||||
%description fish-completion
|
||||
Fish command line completion support for yt-dlp.
|
||||
|
||||
%prep
|
||||
%autosetup -p1
|
||||
|
||||
# TODO: Figure out https://bugzilla.redhat.com/show_bug.cgi?id=2405578
|
||||
# Users can configure JS challenges manually for now.
|
||||
tomcli set pyproject.toml arrays delitem \
|
||||
project.optional-dependencies.default 'yt-dlp-ejs.*'
|
||||
|
||||
# Remove -s from shebang so users can install extra deps or plugins (or yt-dlp-ejs) using pip.
|
||||
%undefine _py3_shebang_s
|
||||
%autosetup -N
|
||||
%autopatch -M 999 -p1
|
||||
%if %{defined fedora} && 0%{?fedora} <= 41
|
||||
# Revert patch for compatibility with older websockets
|
||||
%autopatch 1000 -p1
|
||||
%endif
|
||||
|
||||
# Remove unnecessary shebangs
|
||||
find -type f ! -executable -name '*.py' -print -exec sed -i -e '1{\@^#!.*@d}' '{}' +
|
||||
|
||||
|
||||
%generate_buildrequires
|
||||
%pyproject_buildrequires -x default,secretstorage
|
||||
|
||||
|
||||
%build
|
||||
# Docs and shell completions
|
||||
make yt-dlp.1 completion-bash completion-zsh completion-fish
|
||||
|
|
@ -87,30 +99,31 @@ make yt-dlp.1 completion-bash completion-zsh completion-fish
|
|||
# Docs and shell completions are also included in the wheel.
|
||||
%pyproject_wheel
|
||||
|
||||
|
||||
%install
|
||||
%pyproject_install
|
||||
%pyproject_save_files yt_dlp
|
||||
|
||||
|
||||
%check
|
||||
%if %{with tests}
|
||||
%pytest -k "not download and not test_verify_cert[Websockets]"
|
||||
%endif
|
||||
|
||||
|
||||
%files -f %{pyproject_files}
|
||||
%doc README.md
|
||||
%license LICENSE
|
||||
%{_bindir}/yt-dlp
|
||||
%{_mandir}/man1/yt-dlp.1*
|
||||
%doc README.md
|
||||
%license LICENSE
|
||||
|
||||
%files bash-completion
|
||||
%{bash_completions_dir}/yt-dlp
|
||||
%{fish_completions_dir}/yt-dlp.fish
|
||||
|
||||
%files zsh-completion
|
||||
%{zsh_completions_dir}/_yt-dlp
|
||||
|
||||
%files fish-completion
|
||||
%{fish_completions_dir}/yt-dlp.fish
|
||||
|
||||
%pyproject_extras_subpkg -n yt-dlp default secretstorage
|
||||
|
||||
|
||||
%changelog
|
||||
%autochangelog
|
||||
|
|
|
|||
9
yt-dlp.spec.license
Normal file
9
yt-dlp.spec.license
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
MIT License
|
||||
|
||||
Copyright (c) <year> <copyright holders>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
Loading…
Add table
Add a link
Reference in a new issue