aboutsummaryrefslogtreecommitdiffstats
path: root/test/test_youtube_signature.py
diff options
context:
space:
mode:
authorJesús <heckyel@hyperbola.info>2022-06-27 01:25:17 +0800
committerJesús <heckyel@hyperbola.info>2022-06-27 01:25:17 +0800
commit16e8548f6a720a78679e417a20a300db2036bf6c (patch)
treeb1247bca3417ce882e4a4d80213f41c20113c1a4 /test/test_youtube_signature.py
parent4bbf329feb5a820ac21269fa426c95ca14d7af25 (diff)
parente08f72e6759fb6b1102521f0bdb9457038ef7c06 (diff)
downloadhypervideo-pre-16e8548f6a720a78679e417a20a300db2036bf6c.tar.lz
hypervideo-pre-16e8548f6a720a78679e417a20a300db2036bf6c.tar.xz
hypervideo-pre-16e8548f6a720a78679e417a20a300db2036bf6c.zip
updated from upstream | 27/06/2022 at 01:25
Diffstat (limited to 'test/test_youtube_signature.py')
-rw-r--r--test/test_youtube_signature.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/test/test_youtube_signature.py b/test/test_youtube_signature.py
index 2c2013295..4fc2917e5 100644
--- a/test/test_youtube_signature.py
+++ b/test/test_youtube_signature.py
@@ -1,18 +1,19 @@
#!/usr/bin/env python3
+
# Allow direct execution
-import contextlib
import os
import sys
import unittest
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+
+import contextlib
import re
import string
import urllib.request
-from test.helper import FakeYDL, is_download_test
-from yt_dlp.compat import compat_str
+from test.helper import FakeYDL, is_download_test
from yt_dlp.extractor import YoutubeIE
from yt_dlp.jsinterp import JSInterpreter
@@ -157,7 +158,7 @@ def t_factory(name, sig_func, url_pattern):
def signature(jscode, sig_input):
func = YoutubeIE(FakeYDL())._parse_sig_js(jscode)
src_sig = (
- compat_str(string.printable[:sig_input])
+ str(string.printable[:sig_input])
if isinstance(sig_input, int) else sig_input)
return func(src_sig)