From d0ef06593d5e7b7250ebd021bfcf0834745ef81d Mon Sep 17 00:00:00 2001 From: Simon Sawicki Date: Mon, 22 Apr 2024 22:06:33 +0200 Subject: [PATCH 1/6] Use `self.assertWarns` --- test/test_InfoExtractor.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/test_InfoExtractor.py b/test/test_InfoExtractor.py index c633ce3e4..744587e45 100644 --- a/test/test_InfoExtractor.py +++ b/test/test_InfoExtractor.py @@ -1912,7 +1912,7 @@ jwplayer("mediaplayer").setup({"abouttext":"Visit Indie DB","aboutlink":"http:\/ self.assertEqual(self.ie._search_nextjs_data('', None, fatal=False), {}) self.assertEqual(self.ie._search_nextjs_data('', None, default=None), None) self.assertEqual(self.ie._search_nextjs_data('', None, default={}), {}) - with self.assertRaises(DeprecationWarning): + with self.assertWarns(DeprecationWarning): self.assertEqual(self.ie._search_nextjs_data('', None, default='{}'), {}) From c36cac6b546973b7262f658d14a55403e6968ba0 Mon Sep 17 00:00:00 2001 From: bashonly Date: Mon, 29 Apr 2024 18:25:12 -0500 Subject: [PATCH 2/6] [Makefile] Bring `offlinetest` recipe on par with `devscripts.run_tests` Authored by: bashonly --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index cef4bc6cb..fb4af334a 100644 --- a/Makefile +++ b/Makefile @@ -77,7 +77,7 @@ test: $(MAKE) codetest offlinetest: codetest - $(PYTHON) -m pytest -k "not download" + $(PYTHON) -m pytest -Werror -m "not download" CODE_FOLDERS_CMD = find yt_dlp -type f -name '__init__.py' | sed 's,/__init__.py,,' | grep -v '/__' | sort CODE_FOLDERS != $(CODE_FOLDERS_CMD) From b9aeb3e57495d65d27da3c47032a2d2c335347a3 Mon Sep 17 00:00:00 2001 From: bashonly Date: Mon, 29 Apr 2024 18:27:03 -0500 Subject: [PATCH 3/6] [Makefile] Add `-Werror` arg to `test` recipe Authored by: bashonly --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index fb4af334a..ad9fa02ab 100644 --- a/Makefile +++ b/Makefile @@ -73,7 +73,7 @@ codetest: flake8 . test: - $(PYTHON) -m pytest + $(PYTHON) -m pytest -Werror $(MAKE) codetest offlinetest: codetest From adb148358ed49a73e14bc7092259b76cf73dac83 Mon Sep 17 00:00:00 2001 From: bashonly Date: Tue, 30 Apr 2024 17:52:25 -0500 Subject: [PATCH 4/6] [utils] `read_batch_urls`: Fix deprecated `re.split` positional arg (3.13) Authored by: bashonly --- yt_dlp/utils/_utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/yt_dlp/utils/_utils.py b/yt_dlp/utils/_utils.py index b63766912..aa7bf2ce4 100644 --- a/yt_dlp/utils/_utils.py +++ b/yt_dlp/utils/_utils.py @@ -2522,7 +2522,7 @@ def read_batch_urls(batch_fd): return False # "#" cannot be stripped out since it is part of the URI # However, it can be safely stripped out if following a whitespace - return re.split(r'\s#', url, 1)[0].rstrip() + return re.split(r'\s#', url, maxsplit=1)[0].rstrip() with contextlib.closing(batch_fd) as fd: return [url for url in map(fixup, fd) if url] From c91b90520ffb7503a18f3d2c075a0c751a7837e3 Mon Sep 17 00:00:00 2001 From: bashonly Date: Tue, 30 Apr 2024 17:56:00 -0500 Subject: [PATCH 5/6] [ie] Fix deprecated `re.split` positional arg (3.13) Authored by: bashonly --- yt_dlp/extractor/ceskatelevize.py | 2 +- yt_dlp/extractor/common.py | 2 +- yt_dlp/extractor/thisvid.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/yt_dlp/extractor/ceskatelevize.py b/yt_dlp/extractor/ceskatelevize.py index 156b6a324..5d6335729 100644 --- a/yt_dlp/extractor/ceskatelevize.py +++ b/yt_dlp/extractor/ceskatelevize.py @@ -101,7 +101,7 @@ class CeskaTelevizeIE(InfoExtractor): site_name = self._og_search_property('site_name', webpage, fatal=False, default='Česká televize') playlist_title = self._og_search_title(webpage, default=None) if site_name and playlist_title: - playlist_title = re.split(r'\s*[—|]\s*%s' % (site_name, ), playlist_title, 1)[0] + playlist_title = re.split(r'\s*[—|]\s*%s' % (site_name, ), playlist_title, maxsplit=1)[0] playlist_description = self._og_search_description(webpage, default=None) if playlist_description: playlist_description = playlist_description.replace('\xa0', ' ') diff --git a/yt_dlp/extractor/common.py b/yt_dlp/extractor/common.py index bebbc6b43..7e9da7b3b 100644 --- a/yt_dlp/extractor/common.py +++ b/yt_dlp/extractor/common.py @@ -3526,7 +3526,7 @@ class InfoExtractor: # See com/longtailvideo/jwplayer/media/RTMPMediaProvider.as # of jwplayer.flash.swf rtmp_url_parts = re.split( - r'((?:mp4|mp3|flv):)', source_url, 1) + r'((?:mp4|mp3|flv):)', source_url, maxsplit=1) if len(rtmp_url_parts) == 3: rtmp_url, prefix, play_path = rtmp_url_parts a_format.update({ diff --git a/yt_dlp/extractor/thisvid.py b/yt_dlp/extractor/thisvid.py index 9d3368ed7..04b083811 100644 --- a/yt_dlp/extractor/thisvid.py +++ b/yt_dlp/extractor/thisvid.py @@ -134,7 +134,7 @@ class ThisVidPlaylistBaseIE(InfoExtractor): title = re.split( r'(?i)\s*\|\s*ThisVid\.com\s*$', self._og_search_title(webpage, default=None) - or self._html_search_regex(r'(?s)]*>(.+?)]*>(.+?) Date: Tue, 30 Apr 2024 17:59:16 -0500 Subject: [PATCH 6/6] [docs] Remove `yt_dlp_linux.zip` from README Authored by: bashonly --- README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/README.md b/README.md index 37da789cf..dfe51c18b 100644 --- a/README.md +++ b/README.md @@ -108,7 +108,6 @@ File|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_min.exe](https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp_min.exe)|Windows (Win7 SP1+) standalone x64 binary built with `py2exe`
([Not recommended](#standalone-py2exe-builds-windows)) [yt-dlp_linux](https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp_linux)|Linux standalone x64 binary -[yt-dlp_linux.zip](https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp_linux.zip)|Unpackaged Linux executable (no auto-update) [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 [yt-dlp_win.zip](https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp_win.zip)|Unpackaged Windows executable (no auto-update)