dotfiles

regexghost dotfiles and scripts
git clone https://git.regexghost.com/dotfiles.git
Log | Files | Refs | README

commit 91d0c448c235be79249c118fc427ea32a59fa1c3
parent 2765881bbe9b1148707882cabaab379ef33428b3
Author: regexghost <dev@regexghost.com>
Date:   Wed, 17 Jun 2026 12:01:15 +0100

updates to sond tagging scripts

Diffstat:
Mterminal-scripts/Makefile | 2++
Rterminal-scripts/opus_single.sh -> terminal-scripts/opus-single.sh | 0
Rterminal-scripts/opus_soundtracks.sh -> terminal-scripts/opus-soundtrack.sh | 0
Mterminal-scripts/tag-music.py | 7++++---
Mterminal-scripts/tag-song.sh | 27+++++++++++++++++----------
5 files changed, 23 insertions(+), 13 deletions(-)

diff --git a/terminal-scripts/Makefile b/terminal-scripts/Makefile @@ -23,3 +23,5 @@ normal: cp yt-data.sh ${BIN}/yt-data cp tag-music.py ${TERMINAL}/tag-music.py cp stream-check.sh ${BIN}/stream-check + cp opus-soundtrack.sh ${BIN}/opus-soundtrack + cp opus-single.sh ${BIN}/opus-single diff --git a/terminal-scripts/opus_single.sh b/terminal-scripts/opus-single.sh diff --git a/terminal-scripts/opus_soundtracks.sh b/terminal-scripts/opus-soundtrack.sh diff --git a/terminal-scripts/tag-music.py b/terminal-scripts/tag-music.py @@ -30,9 +30,10 @@ file["artist"] = artist file["album"] = album file["genre"] = genre -r = requests.get(albumArt) -with open(art_file, "wb")as out: - out.write(r.content) +if not albumArt == "file.jpg": + r = requests.get(albumArt) + with open(art_file, "wb")as out: + out.write(r.content) with open(art_file, "rb") as img: file["artwork"] = img.read() diff --git a/terminal-scripts/tag-song.sh b/terminal-scripts/tag-song.sh @@ -5,21 +5,28 @@ appleMusicID="$2" shift shift -searchLink="https://itunes.apple.com/lookup?id=${appleMusicID}&entity=song" -json="$(curl "$searchLink")" -if [[ "$(echo "$json" | jq .results[0].collectionName)" == "null" ]]; then - echo null - searchLink="https://itunes.apple.com/lookup?id=${appleMusicID}&entity=album" +if [ "$appleMusicID" = "file.jpg" ]; then + cp file.jpg "$XDG_CACHE_HOME/art.jpg" + art="file.jpg" +else + searchLink="https://itunes.apple.com/lookup?id=${appleMusicID}&entity=song" json="$(curl "$searchLink")" -fi + if [[ "$(echo "$json" | jq .results[0].collectionName)" == "null" ]]; then + echo null + searchLink="https://itunes.apple.com/lookup?id=${appleMusicID}&entity=album" + json="$(curl "$searchLink")" + fi -art="$(echo "$json" | jq -r .results[0].artworkUrl100 | sed 's/100x100bb/1500x1500/g')" -if [ "$art" = "null" ]; then - art="$(echo "$json" | jq -r .results[1].artworkUrl100 | sed 's/100x100bb/1500x1500/g')" + art="$(echo "$json" | jq -r .results[0].artworkUrl100 | sed 's/100x100bb/1500x1500/g')" + if [ "$art" = "null" ]; then + art="$(echo "$json" | jq -r .results[1].artworkUrl100 | sed 's/100x100bb/1500x1500/g')" + fi fi echo $art for arg; do + echo "$arg" "$HOME/.local/share/regexghost/.venv/bin/python3" "${XDG_DATA_HOME}/regexghost/terminal/tag-music.py" "$arg" "$genre" "$art" - rm -f "$XDG_CACHE_HOME/art.jpg" done + +rm -f "$XDG_CACHE_HOME/art.jpg"