sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
-from test.helper import gettestcases
-from yt_dlp.utils import compat_urllib_parse_urlparse, compat_urllib_request
+import urllib.parse
+import urllib.request
+
+from test.helper import gettestcases
if len(sys.argv) > 1:
METHOD = 'LIST'
for test in gettestcases():
if METHOD == 'EURISTIC':
try:
- webpage = compat_urllib_request.urlopen(test['url'], timeout=10).read()
+ webpage = urllib.request.urlopen(test['url'], timeout=10).read()
except Exception:
print('\nFail: {}'.format(test['name']))
continue
RESULT = 'porn' in webpage.lower()
elif METHOD == 'LIST':
- domain = compat_urllib_parse_urlparse(test['url']).netloc
+ domain = urllib.parse.urlparse(test['url']).netloc
if not domain:
print('\nFail: {}'.format(test['name']))
continue