Skip to content

Instantly share code, notes, and snippets.

@y4my4my4m
Last active October 24, 2022 00:39
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save y4my4my4m/29a17e2807de0c8c4ab4d5ecfc4bb5f8 to your computer and use it in GitHub Desktop.
Save y4my4my4m/29a17e2807de0c8c4ab4d5ecfc4bb5f8 to your computer and use it in GitHub Desktop.
Auto extract youtube description and parse it to relevant area only
#download playlist
youtube-dl -x --audio-format=mp3 -ciw -o "%(title)s.%(ext)s" -v https://www.youtube.com/playlist\?list\=PL06diOotXAJLAAHBY7kIUm5GQwm2ZinOz --add-metadata --write-description
#sed ranged pattern string in a for loop
for i in *.description; do sed '1,/► Music Credit:/d;/––– ♪♫/,$d' "$i" > "$i%.description"_parsed.description; done
#remove original .description files
rm -rf *.description
#rename _parsed
mv *_parsed.description *.description
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment