I was wondering if there would be a good way to keep in disk shortcuts of youtube videos, so we can save space in disk, keep them in our disk (shortcuts) and being able to open them with mpv/vlc by just clicking on them. Furthermore being able to preview them by attach them a thumbnail...,so we can see what is within the video shortcut.
So I made a small script(youlnk.sh) to create a hidden folder for each youtube's video shortcut, with two file within it, one .m3u file with the youtube's URL,so VLC or MPV can open it by clicking on it, and other image file with the preview thumbanil, and both files link to parent visible folder.
youlnk.sh
Code: Select all
#------
TAG="$(youtube-dl --get-filename $1)"
mkdir ."$TAG"
cd ."$TAG"
#------
THUM="$(youtube-dl --get-thumbnail $1)"
wget $THUM -O .xzt &
touch "$TAG".m3u
echo $1 > ./"$TAG.m3u"
sleep 1
mv .xzt "$TAG".jpg
#------
ln -sr ./"$TAG".jpg ../
ln -sr ./"$TAG".m3u ../
cd ..
youlnk https://www.youtube.com/watch?v=8qZHw60dDqQ
>>ls -l
Hot Girls on Needy Guys-8qZHw60dDqQ.mp4.jpg -> .Hot Girls on Needy Guys-8qZHw60dDqQ.mp4/Hot Girls on Needy Guys-8qZHw60dDqQ.mp4.jpg
Hot Girls on Needy Guys-8qZHw60dDqQ.mp4.m3u -> .Hot Girls on Needy Guys-8qZHw60dDqQ.mp4/Hot Girls on Needy Guys-8qZHw60dDqQ.mp4.m3u
The result, looks like this.:
temp image upload
-------------------------------------
So, What do you think??, Do you like the idea or do you think there's a better way to do this ?