From 61b1d8dd14d1c5e3eeb14af840fb3028f2d36acb Mon Sep 17 00:00:00 2001 From: Ark74 Date: Sun, 22 Feb 2026 21:13:53 -0600 Subject: [PATCH] yt-dlp: remove deprecated patch now fixed upstream --- ..._parsing_more_lentient_on_python3.12.patch | 35 ------------------- 1 file changed, 35 deletions(-) delete mode 100644 helpers/DATA/yt-dlp/patch_changes/002-make_cookies_parsing_more_lentient_on_python3.12.patch diff --git a/helpers/DATA/yt-dlp/patch_changes/002-make_cookies_parsing_more_lentient_on_python3.12.patch b/helpers/DATA/yt-dlp/patch_changes/002-make_cookies_parsing_more_lentient_on_python3.12.patch deleted file mode 100644 index 895c8f1..0000000 --- a/helpers/DATA/yt-dlp/patch_changes/002-make_cookies_parsing_more_lentient_on_python3.12.patch +++ /dev/null @@ -1,35 +0,0 @@ -diff --git a/yt_dlp/cookies.py b/yt_dlp/cookies.py -index 8c05a09f..8b6f6613 100644 ---- a/yt_dlp/cookies.py -+++ b/yt_dlp/cookies.py -@@ -1238,15 +1238,27 @@ def load(self, data): - else: - value, _ = self.value_decode(value) - -- morsel[key] = value -+ try: -+ morsel[key] = value -+ except http.cookies.CookieError: -+ # Lenient mode: ignore invalid attributes -+ pass - - elif is_attribute: - morsel = None - - elif value is not None: -- morsel = self.get(key, http.cookies.Morsel()) -+ morsel = self.get(key) or http.cookies.Morsel() - real_value, coded_value = self.value_decode(value) -- morsel.set(key, real_value, coded_value) -+ try: -+ morsel.set(key, real_value, coded_value) -+ except http.cookies.CookieError: -+ # Python 3.12+ rejects control characters in cookies. -+ # LenientSimpleCookie should accept them (yt-dlp tests expect this), so -+ # bypass Morsel.set() validation, assign underlying fields to read-only props. -+ morsel._key = key -+ morsel._value = real_value -+ morsel._coded_value = coded_value - self[key] = morsel - - else: