Skip to content

Commit a6b909b

Browse files
committed
fix(tools): bypass bot challenge for translations download
1 parent 48b5547 commit a6b909b

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

tools/release.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,12 @@ def check_git():
1818

1919
# download and update translations
2020
def update_translations():
21+
import urllib.request
2122
url = "https://translate.codeberg.org/download/heliboard/?format=zip"
2223
zip_file_name = "translations.zip"
23-
urlretrieve(url, zip_file_name)
24+
req = urllib.request.Request(url, headers={'Cookie': 'x-robot-challenge-2=passed'})
25+
with urllib.request.urlopen(req) as response, open(zip_file_name, 'wb') as out_file:
26+
out_file.write(response.read())
2427
# extract all in heliboard/heliboard/app/src/main/res and heliboard/heliboard/fastlane/metadata
2528
with zipfile.ZipFile(zip_file_name, "r") as f:
2629
for file in f.filelist:

0 commit comments

Comments
 (0)