diff options
author | garret1317 <garret@airmail.cc> | 2025-06-22 00:38:07 +0100 |
---|---|---|
committer | garret1317 <garret@airmail.cc> | 2025-06-22 00:38:07 +0100 |
commit | dc4500705cd4d0599a95ba954cc980bfedfe2e53 (patch) | |
tree | 36261b5144ae7cd4b67d2bb7ac06fe061b9a43fa /misc/test_areas.py | |
parent | 73006bef2d0718607fb2926ce1ebd51281e2e7d5 (diff) | |
download | yt-dlp-rajiko-dc4500705cd4d0599a95ba954cc980bfedfe2e53.tar.gz yt-dlp-rajiko-dc4500705cd4d0599a95ba954cc980bfedfe2e53.tar.bz2 yt-dlp-rajiko-dc4500705cd4d0599a95ba954cc980bfedfe2e53.zip |
rename test-tokens script to test_areas
underscore so tab completion is less pain
Diffstat (limited to 'misc/test_areas.py')
-rwxr-xr-x | misc/test_areas.py | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/misc/test_areas.py b/misc/test_areas.py new file mode 100755 index 0000000..ba6475f --- /dev/null +++ b/misc/test_areas.py @@ -0,0 +1,26 @@ +#!/usr/bin/env python3 +import unittest + +from yt_dlp_plugins.extractor import radiko +from yt_dlp import YoutubeDL + + +class test_tokens(unittest.TestCase): + + def setUp(self): + self.ie = radiko._RadikoBaseIE() + ydl = YoutubeDL(auto_init=False) + self.ie.set_downloader(ydl) + + def test_area(self): + # check areas etc work + for i in range(1, 48): + area = "JP" + str(i) + with self.subTest(f"Negotiating token for {area}", area=area): + token = self.ie._negotiate_token(area) + self.assertEqual(token.get("X-Radiko-AreaId"), area) + + +if __name__ == '__main__': + unittest.main() + # may wish to set failfast=True |