URL File Gen in ytget.sh

Home, Bangkok, Thailand, 2019-09-24 20:05 +0700

#automation

Often something will popup in YouTube’s omniscent algo that I like the look of and want to snapshot to watch later so I copy-paste the URL and throw it into ytget- e.g just now:

./ytget.sh https://www.youtube.com/watch?v=CqaAs_3azSs

Really nice track.

The problem is later sometimes I want to go back and see what else this creator has published, but if I have only the video file it requires a title search to locate it again.

I’ve now solved this with two lines of code added to ytget.sh:

# Generate shortcut to the video
echo "[InternetShortcut]\r" > "$date - $title.url"
echo "URL=$videoUrl" >> "$date - $title.url"

This generates a double-clickable (at least on Windows) link that opens the video up in your default browser.

This update is now published to the GitHub project.