A feature-rich command-line audio/video downloader
Update to ytdl-commit-78ce962
pukkandand5a398988bb4
diff --git a/.gitignore b/.gitignoreindex ff00620f57..5dc82ccbe5 100644--- a/.gitignore+++ b/.gitignore@@ -92,7 +92,7 @@ README.txt*.tar.gz*.zsh*.spec-test/testdata/player-*.js+test/testdata/sigs/player-*.js# Binary/youtube-dldiff --git a/Makefile b/Makefileindex 32aabfbe67..b65ec9515e 100644--- a/Makefile+++ b/Makefile@@ -14,7 +14,7 @@ pypi-files: AUTHORS Changelog.md LICENSE README.md README.txt supportedsites com.PHONY: all clean install test tar pypi-files completions ot offlinetest codetest supportedsitesclean-test:- rm -rf test/testdata/player-*.js tmp/ *.annotations.xml *.aria2 *.description *.dump *.frag \+ rm -rf test/testdata/sigs/player-*.js tmp/ *.annotations.xml *.aria2 *.description *.dump *.frag \*.frag.aria2 *.frag.urls *.info.json *.live_chat.json *.meta *.part* *.tmp *.temp *.unknown_video *.ytdl \*.3gp *.ape *.avi *.desktop *.flac *.flv *.jpeg *.jpg *.m4a *.m4v *.mhtml *.mkv *.mov *.mp3 \*.mp4 *.ogg *.opus *.png *.sbv *.srt *.swf *.swp *.ttml *.url *.vtt *.wav *.webloc *.webm *.webpdiff --git a/README.md b/README.mdindex a3cd9ba7b6..5644a63675 100644--- a/README.md+++ b/README.md@@ -71,7 +71,7 @@ yt-dlp is a [youtube-dl](https://github.com/ytdl-org/youtube-dl) fork based on t# NEW FEATURES-* Based on **youtube-dl 2021.12.17 [commit/5014bd6](https://github.com/ytdl-org/youtube-dl/commit/5014bd67c22b421207b2650d4dc874b95b36dda1)** and **youtube-dlc 2020.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)+* Based on **youtube-dl 2021.12.17 [commit/78ce962](https://github.com/ytdl-org/youtube-dl/commit/78ce962f4fe020994c216dd2671546fbe58a5c67)** and **youtube-dlc 2020.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)* **[SponsorBlock Integration](#sponsorblock-options)**: You can mark/remove sponsor sections in youtube videos by utilizing the [SponsorBlock](https://sponsor.ajay.app) APIdiff --git a/test/test_youtube_lists.py b/test/test_youtube_lists.pyindex d9638658dd..455192b1f2 100644--- a/test/test_youtube_lists.py+++ b/test/test_youtube_lists.py@@ -9,11 +9,9 @@ sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))from test.helper import FakeYDL, is_download_test-from yt_dlp.extractor import (- YoutubePlaylistIE,- YoutubeTabIE,YoutubeIE,+ YoutubeTabIE,)@@ -27,21 +25,10 @@ class TestYoutubeLists(unittest.TestCase):dl = FakeYDL()dl.params['noplaylist'] = Trueie = YoutubeTabIE(dl)- result = ie.extract('https://www.youtube.com/watch?v=FXxLjLQi3Fg&list=PLwiyx1dc3P2JR9N8gQaQN_BCvlSlap7re')+ result = ie.extract('https://www.youtube.com/watch?v=OmJ-4B-mS-Y&list=PLydZ2Hrp_gPRJViZjLFKaBMgCQOYEEkyp&index=2')self.assertEqual(result['_type'], 'url')- self.assertEqual(YoutubeIE.extract_id(result['url']), 'FXxLjLQi3Fg')-- def test_youtube_course(self):- print('Skipping: Course URLs no longer exists')- return- dl = FakeYDL()- ie = YoutubePlaylistIE(dl)- # TODO find a > 100 (paginating?) videos course- result = ie.extract('https://www.youtube.com/course?list=ECUl4u3cNGP61MdtwGTqZA0MreSaDybji8')- entries = list(result['entries'])- self.assertEqual(YoutubeIE.extract_id(entries[0]['url']), 'j9WZyLZCBzs')- self.assertEqual(len(entries), 25)- self.assertEqual(YoutubeIE.extract_id(entries[-1]['url']), 'rYefUsYuEp0')+ self.assertEqual(result['ie_key'], YoutubeIE.ie_key())+ self.assertEqual(YoutubeIE.extract_id(result['url']), 'OmJ-4B-mS-Y')def test_youtube_mix(self):dl = FakeYDL()@@ -52,15 +39,6 @@ class TestYoutubeLists(unittest.TestCase):original_video = entries[0]self.assertEqual(original_video['id'], 'tyITL_exICo')- def test_youtube_toptracks(self):- print('Skipping: The playlist page gives error 500')- return- dl = FakeYDL()- ie = YoutubePlaylistIE(dl)- result = ie.extract('https://www.youtube.com/playlist?list=MCUS')- entries = result['entries']- self.assertEqual(len(entries), 100)-def test_youtube_flat_playlist_extraction(self):dl = FakeYDL()dl.params['extract_flat'] = Truediff --git a/test/test_youtube_signature.py b/test/test_youtube_signature.pyindex 537eb8ba26..cb07d3e23d 100644--- a/test/test_youtube_signature.py+++ b/test/test_youtube_signature.py@@ -120,10 +120,17 @@ class TestPlayerInfo(unittest.TestCase):class TestSignature(unittest.TestCase):def setUp(self):TEST_DIR = os.path.dirname(os.path.abspath(__file__))- self.TESTDATA_DIR = os.path.join(TEST_DIR, 'testdata')+ self.TESTDATA_DIR = os.path.join(TEST_DIR, 'testdata/sigs')if not os.path.exists(self.TESTDATA_DIR):os.mkdir(self.TESTDATA_DIR)+ def tearDown(self):+ try:+ for f in os.listdir(self.TESTDATA_DIR):+ os.remove(f)+ except OSError:+ pass+def t_factory(name, sig_func, url_pattern):def make_tfunc(url, sig_input, expected_sig):diff --git a/yt_dlp/compat.py b/yt_dlp/compat.pyindex 79c8e34946..b97d4512e1 100644--- a/yt_dlp/compat.py+++ b/yt_dlp/compat.py@@ -2,6 +2,7 @@import asyncioimport base64+import collectionsimport ctypesimport getpassimport html@@ -180,14 +181,17 @@ def windows_enable_vt_mode(): # TODO: Do this the proper way https://bugs.pythocompat_basestring = strcompat_chr = chr+compat_filter = filtercompat_input = inputcompat_integer_types = (int, )compat_kwargs = lambda kwargs: kwargs+compat_map = mapcompat_numeric_types = (int, float, complex)compat_str = strcompat_xpath = lambda xpath: xpathcompat_zip = zip+compat_collections_abc = collections.abccompat_HTMLParser = html.parser.HTMLParsercompat_HTTPError = urllib.error.HTTPErrorcompat_Struct = struct.Struct@@ -245,6 +249,7 @@ __all__ = ['compat_b64decode','compat_basestring','compat_chr',+ 'compat_collections_abc','compat_cookiejar','compat_cookiejar_Cookie','compat_cookies',@@ -254,6 +259,7 @@ __all__ = ['compat_etree_fromstring','compat_etree_register_namespace','compat_expanduser',+ 'compat_filter','compat_get_terminal_size','compat_getenv','compat_getpass',@@ -265,6 +271,7 @@ __all__ = ['compat_integer_types','compat_itertools_count','compat_kwargs',+ 'compat_map','compat_numeric_types','compat_ord','compat_os_name',