import subprocess, json, base64 # Read token from base64-encoded file with open('.gtb64') as f: b64 = f.read().strip() token = base64.b64decode(b64).decode('utf-8') print(f"Token length: {len(token)}") # Fetch job 473 logs import urllib.request req = urllib.request.Request( "https://gitea.1000co.fr/api/v1/repos/millianlmx/tabatago/actions/jobs/473/logs", headers={"Authorization": f"token {token}"} ) try: with urllib.request.urlopen(req) as resp: logs = resp.read().decode('utf-8') with open('.logs.txt', 'w') as f: f.write(logs) print(f"Logs written: {len(logs)} chars") except urllib.error.HTTPError as e: print(f"HTTP Error: {e.code} {e.reason}") body = e.read().decode('utf-8') print(f"Body: {body[:500]}")