Skip to content

Instantly share code, notes, and snippets.

@Vocaned
Last active January 4, 2026 12:50
Show Gist options
  • Select an option

  • Save Vocaned/cd2280d1e7cfb313498766f3b4687d76 to your computer and use it in GitHub Desktop.

Select an option

Save Vocaned/cd2280d1e7cfb313498766f3b4687d76 to your computer and use it in GitHub Desktop.
My Summer/Winter Car Radio DL Scripts
#!/bin/sh
# ./cd.sh <yt playlist url>
yt-dlp -f bestaudio -x --audio-format vorbis -o "track%(playlist_index)d" "$@"
#!/bin/sh
count=1
for file in *.mp3; do
ffmpeg -i "$file" "track$count.ogg"
((count++))
done
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