Skip to content

Instantly share code, notes, and snippets.

@Greenscreener
Created April 20, 2026 21:22
Show Gist options
  • Select an option

  • Save Greenscreener/4bac472ba56f679aec79f1fa442c68e6 to your computer and use it in GitHub Desktop.

Select an option

Save Greenscreener/4bac472ba56f679aec79f1fa442c68e6 to your computer and use it in GitHub Desktop.
import requests
import sys
import re
import urllib.parse
link = sys.argv[1]
link = urllib.parse.urlparse(link)
key = link.path.split("/")[-1]
host = urllib.parse.urlunparse((link.scheme, link.netloc, "", "", "", ""))
s = requests.session()
link_info = s.get(f"{host}/api/shared-links/me?key={key}").json()
download_info = s.post(f"{host}/api/download/info?key={key}", json={"albumId": link_info["album"]["id"]}).json()
for i in range(len(download_info["archives"])):
response = s.post(f"{host}/api/download/archive?key={key}", json={"assetIds": download_info["archives"][i]["assetIds"]}, stream=True)
total_size = download_info["archives"][i]["size"]
filename = link_info["album"]["albumName"] + "_" + str(i) + ".zip"
print(filename, end="")
chunks = 0
chunk_size = 4096
with open(filename, "wb") as f:
for chunk in response.iter_content(chunk_size):
f.write(chunk)
chunks += 1
print(f"\r{filename} : {chunks*chunk_size/1024/1024:6.2f}M/{total_size/1024/1024:6.2f}M", end="")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment