Last active
January 28, 2020 08:26
-
-
Save jxu/aac2a9d01f7bd0779af448e0daa7b2d6 to your computer and use it in GitHub Desktop.
rename videos based on youtube-dl JSON info
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for f in *.json | |
do | |
pi=$(jq .playlist_index < "$f") | |
pi=$(printf %03d $pi) | |
d=$(jq -r .upload_date < "$f") | |
b=$(basename "$f" .info.json) | |
for ff in "$b"* | |
do | |
mv -v "$ff" "$pi $d $ff" | |
done | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment