From 31b532a1f261347bd1499968a1de9ed09943e87f Mon Sep 17 00:00:00 2001 From: pukkandan Date: Sun, 31 Jul 2022 03:35:16 +0530 Subject: [PATCH] [cleanup] Misc --- .github/PULL_REQUEST_TEMPLATE.md | 29 +++++++++++++++-------------- CONTRIBUTING.md | 2 +- setup.cfg | 2 +- yt_dlp/dependencies.py | 2 +- yt_dlp/extractor/minds.py | 2 +- yt_dlp/extractor/youtube.py | 3 +-- 6 files changed, 20 insertions(+), 20 deletions(-) diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 915fecb49..ec95903d6 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -1,3 +1,18 @@ +### Description of your *pull request* and other information + + + + + +ADD DESCRIPTION HERE + +Fixes # + +
Template - -DESCRIPTION - -Fixes # diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 03681d30c..6d9546033 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -222,7 +222,7 @@ After you have ensured this site is distributing its content legally, you can fo $ flake8 yt_dlp/extractor/yourextractor.py -1. Make sure your code works under all [Python](https://www.python.org/) versions supported by yt-dlp, namely CPython and PyPy for Python 3.6 and above. 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 and PyPy for Python 3.7 and above. 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: $ git add yt_dlp/extractor/_extractors.py diff --git a/setup.cfg b/setup.cfg index 415cca91a..d33c7d854 100644 --- a/setup.cfg +++ b/setup.cfg @@ -31,7 +31,7 @@ setenv = [isort] -py_version = 36 +py_version = 37 multi_line_output = VERTICAL_HANGING_INDENT line_length = 80 reverse_relative = true diff --git a/yt_dlp/dependencies.py b/yt_dlp/dependencies.py index a68babb31..5a5363adb 100644 --- a/yt_dlp/dependencies.py +++ b/yt_dlp/dependencies.py @@ -28,7 +28,7 @@ try: except ImportError: try: from Crypto.Cipher import AES as Cryptodome_AES - except ImportError: + except (ImportError, SyntaxError): # Old Crypto gives SyntaxError in newer Python Cryptodome_AES = None else: try: diff --git a/yt_dlp/extractor/minds.py b/yt_dlp/extractor/minds.py index 8079bbb39..85dd5fd79 100644 --- a/yt_dlp/extractor/minds.py +++ b/yt_dlp/extractor/minds.py @@ -76,7 +76,7 @@ class MindsIE(MindsBaseIE): else: return self.url_result(entity['perma_url']) else: - assert(entity['subtype'] == 'video') + assert entity['subtype'] == 'video' video_id = entity_id # 1080p and webm formats available only on the sources array video = self._call_api( diff --git a/yt_dlp/extractor/youtube.py b/yt_dlp/extractor/youtube.py index 33c0e0b58..02305c3f9 100644 --- a/yt_dlp/extractor/youtube.py +++ b/yt_dlp/extractor/youtube.py @@ -3562,8 +3562,7 @@ class YoutubeIE(YoutubeBaseInfoExtractor): formats.extend(self._extract_storyboard(player_responses, duration)) - # Source is given priority since formats that throttle are given lower source_preference - # When throttling issue is fully fixed, remove this + # source_preference is lower for throttled/potentially damaged formats self._sort_formats(formats, ('quality', 'res', 'fps', 'hdr:12', 'source', 'codec:vp9.2', 'lang', 'proto')) info = {