Procházet zdrojové kódy

Change item format.

master
rewby před 10 měsíci
rodič
revize
696aa02dfa
1 změnil soubory, kde provedl 4 přidání a 8 odebrání
  1. +4
    -8
      main.py

+ 4
- 8
main.py Zobrazit soubor

@@ -180,14 +180,10 @@ def single_impl(item_directory: pathlib.Path, ia_collection: str, ia_item_title:
except Exception:
logging.exception("Failed to upload")
time.sleep(30)
new_url = copy.deepcopy(parsed_url)
new_url = new_url._replace(path=new_url.path.join(bucket_name))
new_url = urllib.parse.urlunparse(new_url)
logging.info(f"Constructed backfeed url: {new_url}")
nu_part = { "url": new_url }
new_url = json.dumps(nu_part)
new_url = base64.urlsafe_b64encode(str(new_url).encode("UTF-8")).decode("UTF-8")
bf_item = f"{project}:{parsed_url.hostname}:{new_url}"

item_data = { "url": url, "item_name": item_directory.name, "bucket_name": bucket_name }
bf_item_part = base64.urlsafe_b64encode(str(json.dumps(item_data)).encode("UTF-8")).decode("UTF-8")
bf_item = f"{project}:{parsed_url.hostname}:{bf_item_part}"
else:
raise Exception("Unable to upload, don't understand url: {url}")



Načítá se…
Zrušit
Uložit