Last active
October 24, 2022 00:39
-
-
Save y4my4my4m/29a17e2807de0c8c4ab4d5ecfc4bb5f8 to your computer and use it in GitHub Desktop.
Auto extract youtube description and parse it to relevant area only
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
#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