Skip to content

Instantly share code, notes, and snippets.

Last active January 6, 2022 09:03
What would you like to do?
Download drawings from
# Run this script to download drawings.
# You can then put all the drawing to the same size with imagemagick.
for f in *.png; do convert $f -gravity CENTER -extent 1920x1080 $f; done;
# And make a video from them with ffmpeg.
ffmpeg -r 25 -f image2 -s 1920x1080 -pattern_type glob -i "*.png" -vcodec libx264 -crf 25 -pix_fmt yuv420p anim.mp4
import urllib.request
http_errors_allowed = 100
i = 0
def dec_to_base(num, base):
base_num = ""
while num>0:
dig = int(num%base)
if dig<10:
base_num += str(dig)
base_num += chr(ord('a')+dig-10)
num //= base
base_num = base_num[::-1]
return base_num
while http_errors_allowed > 0:
url = '{}.png'.format(dec_to_base(i, 36))
path = '{:05d}.png'.format(i)
print('download {} to {}'.format(url, path))
urllib.request.urlretrieve(url, path)
except urllib.error.HTTPError as e:
print('HTTP error', e)
http_errors_allowed -= 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment