Skip to content

Instantly share code, notes, and snippets.

index=0
lines=$(cat $1)
for link in $lines; do
echo $link
(( index++ ))
title=$(yt-dlp --dump-json "$link" | jq -r ".title" | sed -e 's/[\/]/-/g')
file="$index - $title.mp4"
echo $file
@Heshmatkhah
Heshmatkhah / asciinator.py
Created March 16, 2016 10:30 — forked from cdiener/asciinator.py
Convert image to ascii art
import sys; from PIL import Image; import numpy as np
chars = np.asarray(list(' .,:;irsXA253hMHGS#9B&@'))
if len(sys.argv) != 4: print( 'Usage: ./asciinator.py image scale factor' ); sys.exit()
f, SC, GCF, WCF = sys.argv[1], float(sys.argv[2]), float(sys.argv[3]), 7/4
img = Image.open(f)
S = ( round(img.size[0]*SC*WCF), round(img.size[1]*SC) )
img = np.sum( np.asarray( img.resize(S) ), axis=2)