A feature-rich command-line audio/video downloader
Remove Python 3.8 support (#11321)
bashonlyd784464399b6
diff --git a/.github/workflows/build.yml b/.github/workflows/build.ymlindex fdca5d702e..d062d7720d 100644--- a/.github/workflows/build.yml+++ b/.github/workflows/build.yml@@ -405,8 +405,8 @@ jobs:steps:- uses: actions/checkout@v4- uses: actions/setup-python@v5- with: # 3.8 is used for Win7 support- python-version: "3.8"+ with:+ python-version: "3.10"- name: Install Requirementsrun: | # Custom pyinstaller built with https://github.com/yt-dlp/pyinstaller-buildspython devscripts/install_deps.py -o --include build@@ -454,7 +454,7 @@ jobs:- uses: actions/checkout@v4- uses: actions/setup-python@v5with:- python-version: "3.8"+ python-version: "3.10"architecture: "x86"- name: Install Requirementsrun: |@@ -529,20 +529,28 @@ jobs:lock 2023.11.16 (?!win_x86_exe).+ Python 3\.7lock 2023.11.16 win_x86_exe .+ Windows-(?:Vista|2008Server)lock 2024.10.22 py2exe .+- lock 2024.10.22 linux_(?:armv7l|aarch64)_exe .+ glibc 2\.(?:[12]?\d|30)\b+ lock 2024.10.22 linux_(?:armv7l|aarch64)_exe .+-glibc2\.(?:[12]?\d|30)\b+ lock 2024.10.22 (?!\w+_exe).+ Python 3\.8+ lock 2024.10.22 win(?:_x86)?_exe Python 3\.[78].+ Windows-(?:7-|2008ServerR2)lockV2 yt-dlp/yt-dlp 2022.08.18.36 .+ Python 3\.6lockV2 yt-dlp/yt-dlp 2023.11.16 (?!win_x86_exe).+ Python 3\.7lockV2 yt-dlp/yt-dlp 2023.11.16 win_x86_exe .+ Windows-(?:Vista|2008Server)lockV2 yt-dlp/yt-dlp 2024.10.22 py2exe .+- lockV2 yt-dlp/yt-dlp 2024.10.22 linux_(?:armv7l|aarch64)_exe .+ glibc 2\.(?:[12]?\d|30)\b+ lockV2 yt-dlp/yt-dlp 2024.10.22 linux_(?:armv7l|aarch64)_exe .+-glibc2\.(?:[12]?\d|30)\b+ lockV2 yt-dlp/yt-dlp 2024.10.22 (?!\w+_exe).+ Python 3\.8+ lockV2 yt-dlp/yt-dlp 2024.10.22 win(?:_x86)?_exe Python 3\.[78].+ Windows-(?:7-|2008ServerR2)lockV2 yt-dlp/yt-dlp-nightly-builds 2023.11.15.232826 (?!win_x86_exe).+ Python 3\.7lockV2 yt-dlp/yt-dlp-nightly-builds 2023.11.15.232826 win_x86_exe .+ Windows-(?:Vista|2008Server)lockV2 yt-dlp/yt-dlp-nightly-builds 2024.10.22.051025 py2exe .+- lockV2 yt-dlp/yt-dlp-nightly-builds 2024.10.22.051025 linux_(?:armv7l|aarch64)_exe .+ glibc 2\.(?:[12]?\d|30)\b+ lockV2 yt-dlp/yt-dlp-nightly-builds 2024.10.22.051025 linux_(?:armv7l|aarch64)_exe .+-glibc2\.(?:[12]?\d|30)\b+ lockV2 yt-dlp/yt-dlp-nightly-builds 2024.10.22.051025 (?!\w+_exe).+ Python 3\.8+ lockV2 yt-dlp/yt-dlp-nightly-builds 2024.10.22.051025 win(?:_x86)?_exe Python 3\.[78].+ Windows-(?:7-|2008ServerR2)lockV2 yt-dlp/yt-dlp-master-builds 2023.11.15.232812 (?!win_x86_exe).+ Python 3\.7lockV2 yt-dlp/yt-dlp-master-builds 2023.11.15.232812 win_x86_exe .+ Windows-(?:Vista|2008Server)lockV2 yt-dlp/yt-dlp-master-builds 2024.10.22.045052 py2exe .+- lockV2 yt-dlp/yt-dlp-master-builds 2024.10.22.060347 linux_(?:armv7l|aarch64)_exe .+ glibc 2\.(?:[12]?\d|30)\b+ lockV2 yt-dlp/yt-dlp-master-builds 2024.10.22.060347 linux_(?:armv7l|aarch64)_exe .+-glibc2\.(?:[12]?\d|30)\b+ lockV2 yt-dlp/yt-dlp-master-builds 2024.10.22.060347 (?!\w+_exe).+ Python 3\.8+ lockV2 yt-dlp/yt-dlp-master-builds 2024.10.22.060347 win(?:_x86)?_exe Python 3\.[78].+ Windows-(?:7-|2008ServerR2)EOF- name: Sign checksum filesdiff --git a/CONTRIBUTING.md b/CONTRIBUTING.mdindex f1646e5952..fd7b0f1210 100644--- a/CONTRIBUTING.md+++ b/CONTRIBUTING.md@@ -37,14 +37,18 @@ Bugs and suggestions should be reported at: [yt-dlp/yt-dlp/issues](https://githu**Please include the full output of yt-dlp when run with `-vU`**, i.e. **add** `-vU` flag to **your command line**, copy the **whole** output and post it in the issue body wrapped in \`\`\` for better formatting. It should look similar to this:```$ yt-dlp -vU <your command line>-[debug] Command-line config: ['-v', 'demo.com']-[debug] Encodings: locale UTF-8, fs utf-8, out utf-8, pref UTF-8-[debug] yt-dlp version 2021.09.25 (zip)-[debug] Python version 3.8.10 (CPython 64bit) - Linux-5.4.0-74-generic-x86_64-with-glibc2.29-[debug] exe versions: ffmpeg 4.2.4, ffprobe 4.2.4+[debug] Command-line config: ['-vU', 'https://www.example.com/']+[debug] Encodings: locale cp65001, fs utf-8, pref cp65001, out utf-8, error utf-8, screen utf-8+[debug] yt-dlp version nightly@... from yt-dlp/yt-dlp-nightly-builds [1a176d874] (win_exe)+[debug] Python 3.10.11 (CPython AMD64 64bit) - Windows-10-10.0.20348-SP0 (OpenSSL 1.1.1t 7 Feb 2023)+[debug] exe versions: ffmpeg 7.0.2 (setts), ffprobe 7.0.2+[debug] Optional libraries: Cryptodome-3.21.0, brotli-1.1.0, certifi-2024.08.30, curl_cffi-0.5.10, mutagen-1.47.0, requests-2.32.3, sqlite3-3.40.1, urllib3-2.2.3, websockets-13.1[debug] Proxy map: {}-Current Build Hash 25cc412d1d3c0725a1f2f5b7e4682f6fb40e6d15f7024e96f7afd572e9919535-yt-dlp is up to date (2021.09.25)+[debug] Request Handlers: urllib, requests, websockets, curl_cffi+[debug] Loaded 1838 extractors+[debug] Fetching release info: https://api.github.com/repos/yt-dlp/yt-dlp/releases/latest+Latest version: nightly@... from yt-dlp/yt-dlp-nightly-builds+yt-dlp is up to date (nightly@... from yt-dlp/yt-dlp-nightly-builds)...```**Do not post screenshots of verbose logs; only plain text is acceptable.**@@ -268,7 +272,7 @@ After you have ensured this site is distributing its content legally, you can foYou can use `hatch fmt` to automatically fix problems. Rules that the linter/formatter enforces should not be disabled with `# noqa` unless a maintainer requests it. The only exception allowed is for old/printf-style string formatting in GraphQL query templates (use `# noqa: UP031`).-1. Make sure your code works under all [Python](https://www.python.org/) versions supported by yt-dlp, namely CPython >=3.8 and PyPy >=3.10. Backward compatibility is not required for even older versions of Python.+1. Make sure your code works under all [Python](https://www.python.org/) versions supported by yt-dlp, namely CPython >=3.9 and PyPy >=3.10. Backward compatibility is not required for even older versions of Python.1. When the tests pass, [add](https://git-scm.com/docs/git-add) the new files, [commit](https://git-scm.com/docs/git-commit) them and [push](https://git-scm.com/docs/git-push) the result, like this:```shelldiff --git a/README.md b/README.mdindex 46fff07df2..05b8e2b868 100644--- a/README.md+++ b/README.md@@ -98,14 +98,14 @@ You can install yt-dlp using [the binaries](#release-files), [pip](https://pypi.File|Description:---|:---[yt-dlp](https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp)|Platform-independent [zipimport](https://docs.python.org/3/library/zipimport.html) binary. Needs Python (recommended for **Linux/BSD**)-[yt-dlp.exe](https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp.exe)|Windows (Win7 SP1+) standalone x64 binary (recommended for **Windows**)+[yt-dlp.exe](https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp.exe)|Windows (Win8+) standalone x64 binary (recommended for **Windows**)[yt-dlp_macos](https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp_macos)|Universal MacOS (10.15+) standalone executable (recommended for **MacOS**)#### AlternativesFile|Description:---|:----[yt-dlp_x86.exe](https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp_x86.exe)|Windows (Win7 SP1+) standalone x86 (32-bit) binary+[yt-dlp_x86.exe](https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp_x86.exe)|Windows (Win8+) standalone x86 (32-bit) binary[yt-dlp_linux](https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp_linux)|Linux standalone x64 binary[yt-dlp_linux_armv7l](https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp_linux_armv7l)|Linux standalone armv7l (32-bit) binary[yt-dlp_linux_aarch64](https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp_linux_aarch64)|Linux standalone aarch64 (64-bit) binary@@ -172,7 +172,7 @@ python3 -m pip install -U --pre "yt-dlp[default]"```## DEPENDENCIES-Python versions 3.8+ (CPython) and 3.10+ (PyPy) are supported. Other versions and implementations may or may not work correctly.+Python versions 3.9+ (CPython) and 3.10+ (PyPy) are supported. Other versions and implementations may or may not work correctly.<!-- Python 3.5+ uses VC++14 and it is already embedded in the binary created<!x-- https://www.microsoft.com/en-us/download/details.aspx?id=26999 --x>@@ -253,7 +253,7 @@ On some systems, you may need to use `py` or `python` instead of `python3`.**Important**: Running `pyinstaller` directly **instead of** using `python -m bundle.pyinstaller` is **not** officially supported. This may or may not work correctly.### Platform-independent Binary (UNIX)-You will need the build tools `python` (3.8+), `zip`, `make` (GNU), `pandoc`\* and `pytest`\*.+You will need the build tools `python` (3.9+), `zip`, `make` (GNU), `pandoc`\* and `pytest`\*.After installing these, simply run `make`.@@ -2200,7 +2200,7 @@ Features marked with a **\*** have been back-ported to youtube-dlSome of yt-dlp's default options are different from that of youtube-dl and youtube-dlc:-* yt-dlp supports only [Python 3.8+](## "Windows 7"), and will remove support for more versions as they [become EOL](https://devguide.python.org/versions/#python-release-cycle); while [youtube-dl still supports Python 2.6+ and 3.2+](https://github.com/ytdl-org/youtube-dl/issues/30568#issue-1118238743)+* yt-dlp supports only [Python 3.9+](## "Windows 8"), and will remove support for more versions as they [become EOL](https://devguide.python.org/versions/#python-release-cycle); while [youtube-dl still supports Python 2.6+ and 3.2+](https://github.com/ytdl-org/youtube-dl/issues/30568#issue-1118238743)* The options `--auto-number` (`-A`), `--title` (`-t`) and `--literal` (`-l`), no longer work. See [removed options](#Removed) for details* `avconv` is not supported as an alternative to `ffmpeg`* yt-dlp stores config files in slightly different locations to youtube-dl. See [CONFIGURATION](#configuration) for a list of correct locationsdiff --git a/devscripts/make_issue_template.py b/devscripts/make_issue_template.pyindex 8135689c7e..2a418ddbf7 100644--- a/devscripts/make_issue_template.py+++ b/devscripts/make_issue_template.py@@ -32,14 +32,15 @@ VERBOSE_TMPL = '''placeholder: |[debug] Command-line config: ['-vU', 'https://www.youtube.com/watch?v=BaW_jenozKc'][debug] Encodings: locale cp65001, fs utf-8, pref cp65001, out utf-8, error utf-8, screen utf-8- [debug] yt-dlp version nightly@... from yt-dlp/yt-dlp [b634ba742] (win_exe)- [debug] Python 3.8.10 (CPython 64bit) - Windows-10-10.0.22000-SP0- [debug] exe versions: ffmpeg N-106550-g072101bd52-20220410 (fdk,setts), ffprobe N-106624-g391ce570c8-20220415, phantomjs 2.1.1- [debug] Optional libraries: Cryptodome-3.15.0, brotli-1.0.9, certifi-2022.06.15, mutagen-1.45.1, sqlite3-2.6.0, websockets-10.3+ [debug] yt-dlp version nightly@... from yt-dlp/yt-dlp-nightly-builds [1a176d874] (win_exe)+ [debug] Python 3.10.11 (CPython AMD64 64bit) - Windows-10-10.0.20348-SP0 (OpenSSL 1.1.1t 7 Feb 2023)+ [debug] exe versions: ffmpeg 7.0.2 (setts), ffprobe 7.0.2+ [debug] Optional libraries: Cryptodome-3.21.0, brotli-1.1.0, certifi-2024.08.30, curl_cffi-0.5.10, mutagen-1.47.0, requests-2.32.3, sqlite3-3.40.1, urllib3-2.2.3, websockets-13.1[debug] Proxy map: {}- [debug] Request Handlers: urllib, requests- [debug] Loaded 1893 extractors- [debug] Fetching release info: https://api.github.com/repos/yt-dlp/yt-dlp-nightly-builds/releases/latest+ [debug] Request Handlers: urllib, requests, websockets, curl_cffi+ [debug] Loaded 1838 extractors+ [debug] Fetching release info: https://api.github.com/repos/yt-dlp/yt-dlp/releases/latest+ Latest version: nightly@... from yt-dlp/yt-dlp-nightly-buildsyt-dlp is up to date (nightly@... from yt-dlp/yt-dlp-nightly-builds)[youtube] Extracting URL: https://www.youtube.com/watch?v=BaW_jenozKc<more lines>diff --git a/pyproject.toml b/pyproject.tomlindex ff5e38ff50..8490cd274a 100644--- a/pyproject.toml+++ b/pyproject.toml@@ -13,7 +13,7 @@ maintainers = []description = "A feature-rich command-line audio/video downloader"readme = "README.md"-requires-python = ">=3.8"+requires-python = ">=3.9"keywords = ["youtube-dl","video-downloader",@@ -29,7 +29,6 @@ classifiers = ["Environment :: Console","Programming Language :: Python","Programming Language :: Python :: 3 :: Only",- "Programming Language :: Python :: 3.8","Programming Language :: Python :: 3.9","Programming Language :: Python :: 3.10","Programming Language :: Python :: 3.11",diff --git a/setup.cfg b/setup.cfgindex e7f3e2b955..20d40cd303 100644--- a/setup.cfg+++ b/setup.cfg@@ -29,7 +29,7 @@ setenv =[isort]-py_version = 38+py_version = 39multi_line_output = VERTICAL_HANGING_INDENTline_length = 80reverse_relative = truediff --git a/test/test_update.py b/test/test_update.pyindex 63a21e445f..23c12d38c1 100644--- a/test/test_update.py+++ b/test/test_update.py@@ -82,16 +82,32 @@ TEST_LOCKFILE_V1 = rf'''{TEST_LOCKFILE_COMMENT}lock 2022.08.18.36 .+ Python 3\.6lock 2023.11.16 (?!win_x86_exe).+ Python 3\.7lock 2023.11.16 win_x86_exe .+ Windows-(?:Vista|2008Server)+lock 2024.10.22 py2exe .++lock 2024.10.22 linux_(?:armv7l|aarch64)_exe .+-glibc2\.(?:[12]?\d|30)\b+lock 2024.10.22 (?!\w+_exe).+ Python 3\.8+lock 2024.10.22 win(?:_x86)?_exe Python 3\.[78].+ Windows-(?:7-|2008ServerR2)'''TEST_LOCKFILE_V2_TMPL = r'''%slockV2 yt-dlp/yt-dlp 2022.08.18.36 .+ Python 3\.6lockV2 yt-dlp/yt-dlp 2023.11.16 (?!win_x86_exe).+ Python 3\.7lockV2 yt-dlp/yt-dlp 2023.11.16 win_x86_exe .+ Windows-(?:Vista|2008Server)+lockV2 yt-dlp/yt-dlp 2024.10.22 py2exe .++lockV2 yt-dlp/yt-dlp 2024.10.22 linux_(?:armv7l|aarch64)_exe .+-glibc2\.(?:[12]?\d|30)\b+lockV2 yt-dlp/yt-dlp 2024.10.22 (?!\w+_exe).+ Python 3\.8+lockV2 yt-dlp/yt-dlp 2024.10.22 win(?:_x86)?_exe Python 3\.[78].+ Windows-(?:7-|2008ServerR2)lockV2 yt-dlp/yt-dlp-nightly-builds 2023.11.15.232826 (?!win_x86_exe).+ Python 3\.7lockV2 yt-dlp/yt-dlp-nightly-builds 2023.11.15.232826 win_x86_exe .+ Windows-(?:Vista|2008Server)+lockV2 yt-dlp/yt-dlp-nightly-builds 2024.10.22.051025 py2exe .++lockV2 yt-dlp/yt-dlp-nightly-builds 2024.10.22.051025 linux_(?:armv7l|aarch64)_exe .+-glibc2\.(?:[12]?\d|30)\b+lockV2 yt-dlp/yt-dlp-nightly-builds 2024.10.22.051025 (?!\w+_exe).+ Python 3\.8+lockV2 yt-dlp/yt-dlp-nightly-builds 2024.10.22.051025 win(?:_x86)?_exe Python 3\.[78].+ Windows-(?:7-|2008ServerR2)lockV2 yt-dlp/yt-dlp-master-builds 2023.11.15.232812 (?!win_x86_exe).+ Python 3\.7lockV2 yt-dlp/yt-dlp-master-builds 2023.11.15.232812 win_x86_exe .+ Windows-(?:Vista|2008Server)+lockV2 yt-dlp/yt-dlp-master-builds 2024.10.22.045052 py2exe .++lockV2 yt-dlp/yt-dlp-master-builds 2024.10.22.060347 linux_(?:armv7l|aarch64)_exe .+-glibc2\.(?:[12]?\d|30)\b+lockV2 yt-dlp/yt-dlp-master-builds 2024.10.22.060347 (?!\w+_exe).+ Python 3\.8+lockV2 yt-dlp/yt-dlp-master-builds 2024.10.22.060347 win(?:_x86)?_exe Python 3\.[78].+ Windows-(?:7-|2008ServerR2)'''TEST_LOCKFILE_V2 = TEST_LOCKFILE_V2_TMPL % TEST_LOCKFILE_COMMENT@@ -145,43 +161,76 @@ class TestUpdate(unittest.TestCase):for lockfile in (TEST_LOCKFILE_V1, TEST_LOCKFILE_V2, TEST_LOCKFILE_ACTUAL, TEST_LOCKFILE_FORK):# Normal operationtest(lockfile, 'zip Python 3.12.0', '2023.12.31', '2023.12.31')- test(lockfile, 'zip stable Python 3.12.0', '2023.12.31', '2023.12.31', exact=True)- # Python 3.6 --update should update only to its lock+ test(lockfile, 'zip Python 3.12.0', '2023.12.31', '2023.12.31', exact=True)+ # py2exe should never update beyond 2024.10.22+ test(lockfile, 'py2exe Python 3.8', '2025.01.01', '2024.10.22')+ test(lockfile, 'py2exe Python 3.8', '2025.01.01', None, exact=True)+ # Python 3.6 --update should update only to the py3.6 locktest(lockfile, 'zip Python 3.6.0', '2023.11.16', '2022.08.18.36')- # --update-to an exact version later than the lock should return None- test(lockfile, 'zip stable Python 3.6.0', '2023.11.16', None, exact=True)- # Python 3.7 should be able to update to its lock+ # Python 3.6 --update-to an exact version later than the py3.6 lock should return None+ test(lockfile, 'zip Python 3.6.0', '2023.11.16', None, exact=True)+ # Python 3.7 should be able to update to the py3.7 locktest(lockfile, 'zip Python 3.7.0', '2023.11.16', '2023.11.16')- test(lockfile, 'zip stable Python 3.7.1', '2023.11.16', '2023.11.16', exact=True)- # Non-win_x86_exe builds on py3.7 must be locked+ test(lockfile, 'zip Python 3.7.1', '2023.11.16', '2023.11.16', exact=True)+ # Non-win_x86_exe builds on py3.7 must be locked at py3.7 locktest(lockfile, 'zip Python 3.7.1', '2023.12.31', '2023.11.16')- test(lockfile, 'zip stable Python 3.7.1', '2023.12.31', None, exact=True)- test( # Windows Vista w/ win_x86_exe must be locked- lockfile, 'win_x86_exe stable Python 3.7.9 (CPython x86 32bit) - Windows-Vista-6.0.6003-SP2',+ test(lockfile, 'zip Python 3.7.1', '2023.12.31', None, exact=True)+ # Python 3.8 should only update to the py3.8 lock+ test(lockfile, 'zip Python 3.8.10', '2025.01.01', '2024.10.22')+ test(lockfile, 'zip Python 3.8.110', '2025.01.01', None, exact=True)+ test( # Windows Vista w/ win_x86_exe must be locked at Vista lock+ lockfile, 'win_x86_exe Python 3.7.9 (CPython x86 32bit) - Windows-Vista-6.0.6003-SP2','2023.12.31', '2023.11.16')- test( # Windows 2008Server w/ win_x86_exe must be locked+ test( # Windows 2008Server w/ win_x86_exe must be locked at Vista locklockfile, 'win_x86_exe Python 3.7.9 (CPython x86 32bit) - Windows-2008Server','2023.12.31', None, exact=True)- test( # Windows 7 w/ win_x86_exe py3.7 build should be able to update beyond lock- lockfile, 'win_x86_exe stable Python 3.7.9 (CPython x86 32bit) - Windows-7-6.1.7601-SP1',- '2023.12.31', '2023.12.31')- test( # Windows 8.1 w/ '2008Server' in platform string should be able to update beyond lock+ test( # Windows 7 w/ win_x86_exe py3.7 build should be able to update beyond py3.7 lock+ lockfile, 'win_x86_exe Python 3.7.9 (CPython x86 32bit) - Windows-7-6.1.7601-SP1',+ '2023.12.31', '2023.12.31', exact=True)+ test( # Windows 7 win_x86_exe should only update to Win7 lock+ lockfile, 'win_x86_exe Python 3.7.9 (CPython x86 32bit) - Windows-7-6.1.7601-SP1',+ '2025.01.01', '2024.10.22')+ test( # Windows 2008ServerR2 win_exe should only update to Win7 lock+ lockfile, 'win_exe Python 3.8.10 (CPython x86 32bit) - Windows-2008ServerR2',+ '2025.12.31', '2024.10.22')+ test( # Windows 8.1 w/ '2008Server' in platform string should be able to update beyond py3.7 locklockfile, 'win_x86_exe Python 3.7.9 (CPython x86 32bit) - Windows-post2008Server-6.2.9200','2023.12.31', '2023.12.31', exact=True)+ test( # win_exe built w/Python 3.8 on Windows>=8 should be able to update beyond py3.8 lock+ lockfile, 'win_exe Python 3.8.10 (CPython AMD64 64bit) - Windows-10-10.0.20348-SP0',+ '2025.01.01', '2025.01.01', exact=True)+ test( # linux_armv7l_exe w/glibc2.7 should only update to glibc<2.31 lock+ lockfile, 'linux_armv7l_exe Python 3.8.0 (CPython armv7l 32bit) - Linux-6.5.0-1025-azure-armv7l-with-glibc2.7',+ '2025.01.01', '2024.10.22')+ test( # linux_armv7l_exe w/Python 3.8 and glibc>=2.31 should be able to update beyond py3.8 and glibc<2.31 locks+ lockfile, 'linux_armv7l_exe Python 3.8.0 (CPython armv7l 32bit) - Linux-6.5.0-1025-azure-armv7l-with-glibc2.31',+ '2025.01.01', '2025.01.01')+ test( # linux_armv7l_exe w/glibc2.30 should only update to glibc<2.31 lock+ lockfile, 'linux_armv7l_exe Python 3.8.0 (CPython armv7l 64bit) - Linux-6.5.0-1025-azure-aarch64-with-glibc2.30 (OpenSSL',+ '2025.01.01', '2024.10.22')+ test( # linux_aarch64_exe w/glibc2.17 should only update to glibc<2.31 lock+ lockfile, 'linux_aarch64_exe Python 3.8.0 (CPython aarch64 64bit) - Linux-6.5.0-1025-azure-aarch64-with-glibc2.17',+ '2025.01.01', '2024.10.22')+ test( # linux_aarch64_exe w/glibc2.40 and glibc>=2.31 should be able to update beyond py3.8 and glibc<2.31 locks+ lockfile, 'linux_aarch64_exe Python 3.8.0 (CPython aarch64 64bit) - Linux-6.5.0-1025-azure-aarch64-with-glibc2.40',+ '2025.01.01', '2025.01.01')+ test( # linux_aarch64_exe w/glibc2.3 should only update to glibc<2.31 lock+ lockfile, 'linux_aarch64_exe Python 3.8.0 (CPython aarch64 64bit) - Linux-6.5.0-1025-azure-aarch64-with-glibc2.3 (OpenSSL',+ '2025.01.01', '2024.10.22')# Forks can block updates to non-numeric tags rather than locktest(TEST_LOCKFILE_FORK, 'zip Python 3.6.3', 'pr0000', None, repo='fork/yt-dlp')- test(TEST_LOCKFILE_FORK, 'zip stable Python 3.7.4', 'pr0000', 'pr0000', repo='fork/yt-dlp')- test(TEST_LOCKFILE_FORK, 'zip stable Python 3.7.4', 'pr1234', None, repo='fork/yt-dlp')+ test(TEST_LOCKFILE_FORK, 'zip Python 3.7.4', 'pr0000', 'pr0000', repo='fork/yt-dlp')+ test(TEST_LOCKFILE_FORK, 'zip Python 3.7.4', 'pr1234', None, repo='fork/yt-dlp')test(TEST_LOCKFILE_FORK, 'zip Python 3.8.1', 'pr1234', 'pr1234', repo='fork/yt-dlp', exact=True)test(- TEST_LOCKFILE_FORK, 'win_x86_exe stable Python 3.7.9 (CPython x86 32bit) - Windows-Vista-6.0.6003-SP2',+ TEST_LOCKFILE_FORK, 'win_x86_exe Python 3.7.9 (CPython x86 32bit) - Windows-Vista-6.0.6003-SP2','pr1234', None, repo='fork/yt-dlp')test(- TEST_LOCKFILE_FORK, 'win_x86_exe stable Python 3.7.9 (CPython x86 32bit) - Windows-7-6.1.7601-SP1',+ TEST_LOCKFILE_FORK, 'win_x86_exe Python 3.7.9 (CPython x86 32bit) - Windows-7-6.1.7601-SP1','2023.12.31', '2023.12.31', repo='fork/yt-dlp')test(TEST_LOCKFILE_FORK, 'zip Python 3.11.2', 'pr9999', None, repo='fork/yt-dlp', exact=True)- test(TEST_LOCKFILE_FORK, 'zip stable Python 3.12.0', 'pr9999', 'pr9999', repo='fork/yt-dlp')+ test(TEST_LOCKFILE_FORK, 'zip Python 3.12.0', 'pr9999', 'pr9999', repo='fork/yt-dlp')def test_query_update(self):ydl = FakeYDL()diff --git a/yt_dlp/__init__.py b/yt_dlp/__init__.pyindex d976f5bbcb..419090b9ae 100644--- a/yt_dlp/__init__.py+++ b/yt_dlp/__init__.py@@ -1,8 +1,8 @@import sys-if sys.version_info < (3, 8):+if sys.version_info < (3, 9):raise ImportError(- f'You are using an unsupported version of Python. Only Python versions 3.8 and above are supported by yt-dlp') # noqa: F541+ f'You are using an unsupported version of Python. Only Python versions 3.9 and above are supported by yt-dlp') # noqa: F541__license__ = 'The Unlicense'diff --git a/yt_dlp/compat/compat_utils.py b/yt_dlp/compat/compat_utils.pyindex d62b7d0488..d8b3c45cd3 100644--- a/yt_dlp/compat/compat_utils.py+++ b/yt_dlp/compat/compat_utils.py@@ -57,7 +57,7 @@ def passthrough_module(parent, child, allowed_attributes=(..., ), *, callback=lacallback(attr)return ret- @functools.lru_cache(maxsize=None)+ @functools.cachedef from_child(attr):nonlocal childif attr not in allowed_attributes:diff --git a/yt_dlp/compat/functools.py b/yt_dlp/compat/functools.pyindex 96689575f6..c2e9e90279 100644--- a/yt_dlp/compat/functools.py+++ b/yt_dlp/compat/functools.py@@ -5,8 +5,3 @@ from .compat_utils import passthrough_modulepassthrough_module(__name__, 'functools')del passthrough_module--try:- _ = cache # >= 3.9-except NameError:- cache = lru_cache(maxsize=None)diff --git a/yt_dlp/extractor/pornbox.py b/yt_dlp/extractor/pornbox.pyindex e15244dac0..9b89adbf9d 100644--- a/yt_dlp/extractor/pornbox.py+++ b/yt_dlp/extractor/pornbox.py@@ -1,5 +1,6 @@+import functools+from .common import InfoExtractor-from ..compat import functoolsfrom ..utils import (int_or_none,parse_duration,diff --git a/yt_dlp/plugins.py b/yt_dlp/plugins.pyindex 204558d603..2bf55df71e 100644--- a/yt_dlp/plugins.py+++ b/yt_dlp/plugins.py@@ -1,4 +1,5 @@import contextlib+import functoolsimport importlibimport importlib.abcimport importlib.machinery@@ -13,7 +14,6 @@ import zipimportfrom pathlib import Pathfrom zipfile import ZipFile-from .compat import functools # isort: splitfrom .utils import (Config,get_executable_path,diff --git a/yt_dlp/update.py b/yt_dlp/update.pyindex 3a8d78de41..90df2509f0 100644--- a/yt_dlp/update.py+++ b/yt_dlp/update.py@@ -2,6 +2,7 @@ from __future__ import annotationsimport atexitimport contextlib+import functoolsimport hashlibimport jsonimport os@@ -12,7 +13,6 @@ import sysfrom dataclasses import dataclassfrom zipimport import zipimporter-from .compat import functools # isort: splitfrom .compat import compat_realpathfrom .networking import Requestfrom .networking.exceptions import HTTPError, network_exceptions@@ -135,7 +135,7 @@ def _get_binary_name():def _get_system_deprecation():- MIN_SUPPORTED, MIN_RECOMMENDED = (3, 8), (3, 9)+ MIN_SUPPORTED, MIN_RECOMMENDED = (3, 9), (3, 9)if sys.version_info > MIN_RECOMMENDED:return None@@ -146,18 +146,6 @@ def _get_system_deprecation():if sys.version_info < MIN_SUPPORTED:return f'Python version {major}.{minor} is no longer supported! {PYTHON_MSG}'- EXE_MSG_TMPL = ('Support for {} has been deprecated. '- 'See https://github.com/yt-dlp/yt-dlp/{} for details.\n{}')- STOP_MSG = 'You may stop receiving updates on this version at any time!'- variant = detect_variant()-- # Temporary until Windows builds use 3.9, which will drop support for Win7 and 2008ServerR2- if variant in ('win_exe', 'win_x86_exe'):- platform_name = platform.platform()- if any(platform_name.startswith(f'Windows-{name}') for name in ('7', '2008ServerR2')):- return EXE_MSG_TMPL.format('Windows 7/Server 2008 R2', 'issues/10086', STOP_MSG)- return None-return f'Support for Python version {major}.{minor} has been deprecated. {PYTHON_MSG}'diff --git a/yt_dlp/utils/_utils.py b/yt_dlp/utils/_utils.pyindex ea748898f2..7aff67ddfc 100644--- a/yt_dlp/utils/_utils.py+++ b/yt_dlp/utils/_utils.py@@ -9,6 +9,7 @@ import datetime as dtimport email.headerimport email.utilsimport errno+import functoolsimport hashlibimport hmacimport html.entities@@ -44,7 +45,6 @@ import xml.etree.ElementTreefrom . import traversal-from ..compat import functools # isort: splitfrom ..compat import (compat_etree_fromstring,compat_expanduser,