From 1bb5c00876941c7bcf5f8e04bd3a07a3d7c66bf3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?William=20S=C3=B6derberg?= Date: Wed, 11 Mar 2026 18:41:49 +0100 Subject: [PATCH] small cookie fix --- seedbox.py | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/seedbox.py b/seedbox.py index efe73c3..27e36ed 100644 --- a/seedbox.py +++ b/seedbox.py @@ -2,6 +2,7 @@ import argparse import re +import urllib.error import urllib.parse import urllib.request from pathlib import Path @@ -86,6 +87,7 @@ def parseCookieFile(file: Path, domain: str) -> None: def getSeedboxes(domain: str) -> tuple[list[dict], str]: + global COOKIE_HEADER try: req = urllib.request.Request( f"https://{domain}/users/{parsed_args.username}/seedboxes", @@ -94,6 +96,12 @@ def getSeedboxes(domain: str) -> tuple[list[dict], str]: with urllib.request.urlopen(req) as resp: html = resp.read().decode("utf-8") + for header, value in resp.getheaders(): + if header.lower() == "set-cookie": + cookie_val = value.split(";")[0] + if cookie_val not in COOKIE_HEADER: + COOKIE_HEADER += f"; {cookie_val}" + token_match = re.search( r'