]> jfr.im git - yt-dlp.git/commitdiff
[cleanup] Misc
authorpukkandan <redacted>
Thu, 22 Jun 2023 04:32:38 +0000 (10:02 +0530)
committerpukkandan <redacted>
Thu, 22 Jun 2023 08:01:07 +0000 (13:31 +0530)
README.md
devscripts/changelog_override.json
devscripts/make_changelog.py
yt_dlp/extractor/testurl.py
yt_dlp/utils/_utils.py

index 8db2d4f067dbf749bf8f881ce12da2994cd09616..4de4ece9699e42498629826a10e56d5c60d6cd91 100644 (file)
--- a/README.md
+++ b/README.md
@@ -76,7 +76,7 @@
 
 # NEW FEATURES
 
-* Merged with **youtube-dl v2021.12.17+ [commit/2dd6c6e](https://github.com/ytdl-org/youtube-dl/commit/2dd6c6e)** ([exceptions](https://github.com/yt-dlp/yt-dlp/issues/21)) and **youtube-dlc v2020.11.11-3+ [commit/f9401f2](https://github.com/blackjack4494/yt-dlc/commit/f9401f2a91987068139c5f757b12fc711d4c0cee)**: You get all the features and patches of [youtube-dlc](https://github.com/blackjack4494/yt-dlc) in addition to the latest [youtube-dl](https://github.com/ytdl-org/youtube-dl)
+* Forked from [**yt-dlc@f9401f2**](https://github.com/blackjack4494/yt-dlc/commit/f9401f2a91987068139c5f757b12fc711d4c0cee) and merged with [**youtube-dl@42f2d4**](https://github.com/yt-dlp/yt-dlp/commit/42f2d4) ([exceptions](https://github.com/yt-dlp/yt-dlp/issues/21))
 
 * **[SponsorBlock Integration](#sponsorblock-options)**: You can mark/remove sponsor sections in YouTube videos by utilizing the [SponsorBlock](https://sponsor.ajay.app) API
 
index 73225bdb90abb7c1e36ba5d2df024df2ae73f2d6..df80f45e0ff1ab26a96830b3da077632d8986f99 100644 (file)
         "when": "8417f26b8a819cd7ffcd4e000ca3e45033e670fb",
         "short": "Add option `--color` (#6904)",
         "authors": ["Grub4K"]
+    },
+    {
+        "action": "change",
+        "when": "7b37e8b23691613f331bd4ebc9d639dd6f93c972",
+        "short": "Improve `--download-sections`\n    - Support negative time-ranges\n    - Add `*from-url` to obey time-ranges in URL"
+    },
+    {
+        "action": "change",
+        "when": "1e75d97db21152acc764b30a688e516f04b8a142",
+        "short": "[extractor/youtube] Add `ios` to default clients used\n        - IOS is affected neither by 403 nor by nsig so helps mitigate them preemptively\n        - IOS also has higher bit-rate 'premium' formats though they are not labeled as such"
+    },
+    {
+        "action": "change",
+        "when": "f2ff0f6f1914b82d4a51681a72cc0828115dcb4a",
+        "short": "[extractor/motherless] Add gallery support, fix groups (#7211)",
+        "authors": ["rexlambert22", "Ti4eeT4e"]
+    },
+    {
+        "action": "change",
+        "when": "a4486bfc1dc7057efca9dd3fe70d7fa25c56f700",
+        "short": "[misc] Revert \"Add automatic duplicate issue detection\""
     }
 ]
index 2fcdc06d770510643304a6b80702c08a70513e0d..0bcfa6ae72efc0ef9637fc485c298e92cafc9d25 100644 (file)
@@ -196,7 +196,7 @@ def _prepare_cleanup_misc_items(self, items):
         for commit_infos in cleanup_misc_items.values():
             sorted_items.append(CommitInfo(
                 'cleanup', ('Miscellaneous',), ', '.join(
-                    self._format_message_link(None, info.commit.hash)
+                    self._format_message_link(None, info.commit.hash).strip()
                     for info in sorted(commit_infos, key=lambda item: item.commit.hash or '')),
                 [], Commit(None, '', commit_infos[0].commit.authors), []))
 
@@ -205,10 +205,10 @@ def _prepare_cleanup_misc_items(self, items):
     def format_single_change(self, info):
         message = self._format_message_link(info.message, info.commit.hash)
         if info.issues:
-            message = f'{message} ({self._format_issues(info.issues)})'
+            message = message.replace('\n', f' ({self._format_issues(info.issues)})\n', 1)
 
         if info.commit.authors:
-            message = f'{message} by {self._format_authors(info.commit.authors)}'
+            message = message.replace('\n', f' by {self._format_authors(info.commit.authors)}\n', 1)
 
         if info.fixes:
             fix_message = ', '.join(f'{self._format_message_link(None, fix.hash)}' for fix in info.fixes)
@@ -217,14 +217,16 @@ def format_single_change(self, info):
             if authors != info.commit.authors:
                 fix_message = f'{fix_message} by {self._format_authors(authors)}'
 
-            message = f'{message} (With fixes in {fix_message})'
+            message = message.replace('\n', f' (With fixes in {fix_message})\n', 1)
 
-        return message
+        return message[:-1]
 
     def _format_message_link(self, message, hash):
         assert message or hash, 'Improperly defined commit message or override'
         message = message if message else hash[:HASH_LENGTH]
-        return f'[{message}]({self.repo_url}/commit/{hash})' if hash else message
+        if not hash:
+            return f'{message}\n'
+        return f'[{message}\n'.replace('\n', f']({self.repo_url}/commit/{hash})\n', 1)
 
     def _format_issues(self, issues):
         return ', '.join(f'[#{issue}]({self.repo_url}/issues/{issue})' for issue in issues)
index 0da01aa53e2b337b25637781f71ac9136acdabfe..3cf00177650262236ed78c8de568330ba923295d 100644 (file)
@@ -8,7 +8,7 @@ class TestURLIE(InfoExtractor):
     """ Allows addressing of the test cases as test:yout.*be_1 """
 
     IE_DESC = False  # Do not list
-    _VALID_URL = r'test(?:url)?:(?P<extractor>.*?)(?:_(?P<num>[0-9]+))?$'
+    _VALID_URL = r'test(?:url)?:(?P<extractor>.*?)(?:_(?P<num>\d+|all))?$'
 
     def _real_extract(self, url):
         from . import gen_extractor_classes
@@ -36,6 +36,10 @@ def _real_extract(self, url):
             extractor = matching_extractors[0]
 
         testcases = tuple(extractor.get_testcases(True))
+        if num == 'all':
+            return self.playlist_result(
+                [self.url_result(tc['url'], extractor) for tc in testcases],
+                url, f'{extractor.IE_NAME} tests')
         try:
             tc = testcases[int(num or 0)]
         except IndexError:
@@ -43,4 +47,4 @@ def _real_extract(self, url):
                 f'Test case {num or 0} not found, got only {len(testcases)} tests', expected=True)
 
         self.to_screen(f'Test URL: {tc["url"]}')
-        return self.url_result(tc['url'])
+        return self.url_result(tc['url'], extractor)
index 56acadd736630c6bc6e8054387295e0c1b69835d..10052009fcc5b3991ba74bbb430f0e73031e6215 100644 (file)
@@ -3507,7 +3507,8 @@ def get_compatible_ext(*, vcodecs, acodecs, vexts, aexts, preferences=None):
         },
     }
 
-    sanitize_codec = functools.partial(try_get, getter=lambda x: x[0].split('.')[0].replace('0', ''))
+    sanitize_codec = functools.partial(
+        try_get, getter=lambda x: x[0].split('.')[0].replace('0', '').lower())
     vcodec, acodec = sanitize_codec(vcodecs), sanitize_codec(acodecs)
 
     for ext in preferences or COMPATIBLE_CODECS.keys():
@@ -5737,9 +5738,9 @@ class FormatSorter:
         'source': {'convert': 'float', 'field': 'source_preference', 'default': -1},
 
         'codec': {'type': 'combined', 'field': ('vcodec', 'acodec')},
-        'br': {'type': 'multiple', 'field': ('tbr', 'vbr', 'abr'),
+        'br': {'type': 'multiple', 'field': ('tbr', 'vbr', 'abr'), 'convert': 'float_none',
                'function': lambda it: next(filter(None, it), None)},
-        'size': {'type': 'multiple', 'field': ('filesize', 'fs_approx'),
+        'size': {'type': 'multiple', 'field': ('filesize', 'fs_approx'), 'convert': 'bytes',
                  'function': lambda it: next(filter(None, it), None)},
         'ext': {'type': 'combined', 'field': ('vext', 'aext')},
         'res': {'type': 'multiple', 'field': ('height', 'width'),