]> jfr.im git - yt-dlp.git/commitdiff
[cleanup] Misc (#9426)
authorbashonly <redacted>
Tue, 9 Apr 2024 16:12:26 +0000 (11:12 -0500)
committerGitHub <redacted>
Tue, 9 Apr 2024 16:12:26 +0000 (16:12 +0000)
Authored by: bashonly, pukkandan

.github/workflows/quick-test.yml
Makefile
devscripts/changelog_override.json
test/test_traversal.py
yt_dlp/networking/_helper.py
yt_dlp/update.py

index 3114e7bdd6c7cf884f50778e1a64dac3b10bc3fc..24b34911f391b745d960eb58fbf1be6d5eb85ec0 100644 (file)
@@ -27,6 +27,8 @@ jobs:
     steps:
     - uses: actions/checkout@v4
     - uses: actions/setup-python@v5
+      with:
+        python-version: '3.8'
     - name: Install flake8
       run: python3 ./devscripts/install_deps.py -o --include dev
     - name: Make lazy extractors
index 38c6b4f2dcb2094f92d9b9488c0746c993e1d8d6..cef4bc6cb1acbfe9506fbfa15ca4a15b7b5e3834 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -10,9 +10,12 @@ tar: yt-dlp.tar.gz
 # intended use: when building a source distribution,
 # make pypi-files && python3 -m build -sn .
 pypi-files: AUTHORS Changelog.md LICENSE README.md README.txt supportedsites \
-               completions yt-dlp.1 pyproject.toml setup.cfg devscripts/* test/*
+            completions yt-dlp.1 pyproject.toml setup.cfg devscripts/* test/*
 
-.PHONY: all clean install test tar pypi-files completions ot offlinetest codetest supportedsites
+.PHONY: all clean clean-all clean-test clean-dist clean-cache \
+        completions completion-bash completion-fish completion-zsh \
+        doc issuetemplates supportedsites ot offlinetest codetest test \
+        tar pypi-files lazy-extractors install uninstall
 
 clean-test:
        rm -rf test/testdata/sigs/player-*.js tmp/ *.annotations.xml *.aria2 *.description *.dump *.frag \
index eaa348cf2e022d4d584ae0cc74fd53ffc6946c73..52ddf0613dbdc10648d096df88746c58a7f5213a 100644 (file)
         "short": "[ie] Support multi-period MPD streams (#6654)",
         "authors": ["alard", "pukkandan"]
     },
+    {
+        "action": "change",
+        "when": "aa7e9ae4f48276bd5d0173966c77db9484f65a0a",
+        "short": "[ie/xvideos] Support new URL format (#9502)",
+        "authors": ["sta1us"]
+    },
     {
         "action": "remove",
         "when": "22e4dfacb61f62dfbb3eb41b31c7b69ba1059b80"
+    },
+    {
+        "action": "change",
+        "when": "e3a3ed8a981d9395c4859b6ef56cd02bc3148db2",
+        "short": "[cleanup:ie] No `from` stdlib imports in extractors",
+        "authors": ["pukkandan"]
     }
 ]
index ed29d03ad562034069f5b18d9228a35914095f7b..9b2a27b0807feefe83fc3065738c076b86ab0bc4 100644 (file)
@@ -26,27 +26,6 @@ _TEST_DATA = {
 
 
 class TestTraversal:
-    def test_dict_get(self):
-        FALSE_VALUES = {
-            'none': None,
-            'false': False,
-            'zero': 0,
-            'empty_string': '',
-            'empty_list': [],
-        }
-        d = {**FALSE_VALUES, 'a': 42}
-        assert dict_get(d, 'a') == 42
-        assert dict_get(d, 'b') is None
-        assert dict_get(d, 'b', 42) == 42
-        assert dict_get(d, ('a',)) == 42
-        assert dict_get(d, ('b', 'a')) == 42
-        assert dict_get(d, ('b', 'c', 'a', 'd')) == 42
-        assert dict_get(d, ('b', 'c')) is None
-        assert dict_get(d, ('b', 'c'), 42) == 42
-        for key, false_value in FALSE_VALUES.items():
-            assert dict_get(d, ('b', 'c', key)) is None
-            assert dict_get(d, ('b', 'c', key), skip_false_values=False) == false_value
-
     def test_traversal_base(self):
         assert traverse_obj(_TEST_DATA, ('str',)) == 'str', \
             'allow tuple path'
@@ -440,3 +419,26 @@ class TestTraversal:
             'function key should yield all values'
         assert traverse_obj(morsel, [(None,), any]) == morsel, \
             'Morsel should not be implicitly changed to dict on usage'
+
+
+class TestDictGet:
+    def test_dict_get(self):
+        FALSE_VALUES = {
+            'none': None,
+            'false': False,
+            'zero': 0,
+            'empty_string': '',
+            'empty_list': [],
+        }
+        d = {**FALSE_VALUES, 'a': 42}
+        assert dict_get(d, 'a') == 42
+        assert dict_get(d, 'b') is None
+        assert dict_get(d, 'b', 42) == 42
+        assert dict_get(d, ('a',)) == 42
+        assert dict_get(d, ('b', 'a')) == 42
+        assert dict_get(d, ('b', 'c', 'a', 'd')) == 42
+        assert dict_get(d, ('b', 'c')) is None
+        assert dict_get(d, ('b', 'c'), 42) == 42
+        for key, false_value in FALSE_VALUES.items():
+            assert dict_get(d, ('b', 'c', key)) is None
+            assert dict_get(d, ('b', 'c', key), skip_false_values=False) == false_value
index ecaff36e7310611fcffd3fe4e6d8a4acbfc55d24..8e678b26ab721544f743314753a2b081b2df86c1 100644 (file)
@@ -124,7 +124,7 @@ def make_ssl_context(
     context.verify_mode = ssl.CERT_REQUIRED if verify else ssl.CERT_NONE
     # OpenSSL 1.1.1+ Python 3.8+ keylog file
     if hasattr(context, 'keylog_filename'):
-        context.keylog_filename = os.environ.get('SSLKEYLOGFILE')
+        context.keylog_filename = os.environ.get('SSLKEYLOGFILE') or None
 
     # Some servers may reject requests if ALPN extension is not sent. See:
     # https://github.com/python/cpython/issues/85140
index db50cfa6b44259a1ae32de7421e6d2cf0835ef5c..f47cbc5b29f954d6205894d0a63e1face39b860f 100644 (file)
@@ -114,7 +114,7 @@ _NON_UPDATEABLE_REASONS = {
     **{variant: f'Auto-update is not supported for unpackaged {name} executable; Re-download the latest release'
        for variant, name in {'win32_dir': 'Windows', 'darwin_dir': 'MacOS', 'linux_dir': 'Linux'}.items()},
     'source': 'You cannot update when running from source code; Use git to pull the latest changes',
-    'unknown': 'You installed yt-dlp with a package manager or setup.py; Use that to update',
+    'unknown': 'You installed yt-dlp from a manual build or with a package manager; Use that to update',
     'other': 'You are using an unofficial build of yt-dlp; Build the executable again',
 }