Skip to content

Instantly share code, notes, and snippets.

View hibikidesu's full-sized avatar
💭
uwu

ひびき hibikidesu

💭
uwu
View GitHub Profile
@hibikidesu
hibikidesu / ugoira_to_gif.py
Created May 17, 2019 10:50
Pixiv Ugora to GIF
def download_ugoira(ugoira_zip: BytesIO, data: dict, filename: str):
if not data.get("ugoira_metadata"):
raise Exception("Not valid ugoira data")
delay = 0
frames = []
raw_frames = data["ugoira_metadata"]["frames"]
with zipfile.ZipFile(ugoira_zip) as file:
for frame in raw_frames:
frames.append(imageio.imread(file.read(frame["file"])))