aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorbashonly <bashonly@bashonly.com>2023-07-15 15:18:25 -0500
committerbashonly <bashonly@bashonly.com>2023-07-15 15:25:51 -0500
commit42ded0a429c20ec13dc006825e1508d9a02f0ad4 (patch)
treef52cab726165d92b3ef0c108206a0dba99742b9c /test
parent6c5211cebeacfc53ad5d5ddf4a659be76039656f (diff)
downloadhypervideo-pre-42ded0a429c20ec13dc006825e1508d9a02f0ad4.tar.lz
hypervideo-pre-42ded0a429c20ec13dc006825e1508d9a02f0ad4.tar.xz
hypervideo-pre-42ded0a429c20ec13dc006825e1508d9a02f0ad4.zip
[fd/external] Fixes to cookie handling
- Fix bug in `axel` Cookie header arg - Pass cookies to `curl` as strings - Write session cookies for `aria2c` and `wget` Closes #7539 Authored by: bashonly
Diffstat (limited to 'test')
-rw-r--r--test/test_downloader_external.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/test/test_downloader_external.py b/test/test_downloader_external.py
index e5b02ba5a..d3d74df04 100644
--- a/test/test_downloader_external.py
+++ b/test/test_downloader_external.py
@@ -68,7 +68,7 @@ class TestAxelFD(unittest.TestCase):
ydl.cookiejar.set_cookie(http.cookiejar.Cookie(**TEST_COOKIE))
self.assertEqual(
downloader._make_cmd('test', TEST_INFO),
- ['axel', '-o', 'test', 'Cookie: test=ytdlp', '--max-redirect=0', '--', 'http://www.example.com/'])
+ ['axel', '-o', 'test', '-H', 'Cookie: test=ytdlp', '--max-redirect=0', '--', 'http://www.example.com/'])
class TestWgetFD(unittest.TestCase):
@@ -85,10 +85,11 @@ class TestCurlFD(unittest.TestCase):
def test_make_cmd(self):
with FakeYDL() as ydl:
downloader = CurlFD(ydl, {})
- self.assertNotIn('--cookie-jar', downloader._make_cmd('test', TEST_INFO))
- # Test cookiejar tempfile arg is added
+ self.assertNotIn('--cookie', downloader._make_cmd('test', TEST_INFO))
+ # Test cookie header is added
ydl.cookiejar.set_cookie(http.cookiejar.Cookie(**TEST_COOKIE))
- self.assertIn('--cookie-jar', downloader._make_cmd('test', TEST_INFO))
+ self.assertIn('--cookie', downloader._make_cmd('test', TEST_INFO))
+ self.assertIn('test=ytdlp', downloader._make_cmd('test', TEST_INFO))
class TestAria2cFD(unittest.TestCase):