#!/usr/bin/env python3
-import json
+
+# Allow direct execution
import os
-import re
import sys
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
-from yt_dlp.compat import compat_urllib_request
+
+import json
+import re
+import urllib.request
# usage: python3 ./devscripts/update-formulae.py <path-to-formulae-rb> <version>
# version can be either 0-aligned (yt-dlp version) or normalized (PyPl version)
normalized_version = '.'.join(str(int(x)) for x in version.split('.'))
-pypi_release = json.loads(compat_urllib_request.urlopen(
+pypi_release = json.loads(urllib.request.urlopen(
'https://pypi.org/pypi/yt-dlp/%s/json' % normalized_version
).read().decode())