Last active
January 4, 2026 12:50
-
-
Save Vocaned/cd2280d1e7cfb313498766f3b4687d76 to your computer and use it in GitHub Desktop.
My Summer/Winter Car Radio DL Scripts
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
| #!/bin/sh | |
| # ./cd.sh <yt playlist url> | |
| yt-dlp -f bestaudio -x --audio-format vorbis -o "track%(playlist_index)d" "$@" |
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
| #!/bin/sh | |
| count=1 | |
| for file in *.mp3; do | |
| ffmpeg -i "$file" "track$count.ogg" | |
| ((count++)) | |
| done |
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
| def dl(url: str, title: str): | |
| url = url.split('&', 1)[0] | |
| $[yt-dlp @(url) -f bestaudio -x --audio-format mp3 -o @(title).mp3] | |
| artist, songtitle = title.split('-', 1) | |
| set_metadata(title+'.mp3', artist.strip(), songtitle.strip()) | |
| def set_metadata(file: str, artist: str, title: str): | |
| $[ffmpeg -i @(file) -c copy -metadata artist=@(artist) -metadata title=@(title) tmp.mp3] | |
| $[mv tmp.mp3 @(file)] | |
| def _fix_files(): | |
| from pathlib import Path | |
| for path in Path('.').glob('*.mp3'): | |
| artist, songtitle = str(path).split('-', 1) | |
| set_metadata(path, artist.strip(), songtitle.strip().split('.mp3')[0]) | |
| dl(input('Url: '), input('Title: ')) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment