Downloading Youtube Shortcuts in Disk!!

Share your own howto's etc. Not for support questions!

Downloading Youtube Shortcuts in Disk!!

Postby bester69 » 2018-06-07 23:46

Hi,

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 ..


Example:
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.:
Imagetemp image upload
-------------------------------------

So, What do you think??, Do you like the idea or do you think there's a better way to do this ? :idea: :o
Last edited by bester69 on 2018-06-09 01:03, edited 1 time in total.
bester69 wrote:There is nothing to install in linux, from time to time i go to google searching for something fresh to install in linux, but, there is nothing
User avatar
bester69
 
Posts: 1143
Joined: 2015-04-02 13:15

Re: Downloading Youtube Shortcuts in Disk??

Postby bester69 » 2018-06-08 01:14

A second version with hard links instead softlinks, and out.sh to regenerate links.
youlnk.sh
Code: Select all
#!/bin/bash
#
THUM="$(youtube-dl --get-thumbnail $1 &)"
TAG=$(youtube-dl --get-filename $1)
#------
TAG="${TAG%.*}"
mkdir ."$TAG"
cd ."$TAG"
rm "$TAG".* out.sh .xzt
wget $THUM -O .xzt
mv .xzt "$TAG".XX.jpg
#------
touch "$TAG".m3u8
touch "$TAG".mp4
echo $1 > ./"$TAG.m3u8"
echo $1 > ./"$TAG.mp4"
#------
#ln -sr ./"$TAG".jpg ../
#ln -sr ./"$TAG".m3u8 ../
ln  *.jpg ../
ln  *.m3u8 ../
##ln  *.mp4 ../
#------
touch out.sh && chmod +x out.sh
echo "ln  *.m3u8 ../" > out.sh
##echo "ln  *.mp4 ../" >> out.sh
echo "ln  *.jpg ../" >> out.sh
cd ..
clear
echo "Fin de Procesamiento"


A second script, to create all from a list.:

youlist.sh
Code: Select all
#!/bin/bash
#
#------#------#------#------#------#------#------#------

for i in `cat $1`;
do
youlnk $i;

done
bester69 wrote:There is nothing to install in linux, from time to time i go to google searching for something fresh to install in linux, but, there is nothing
User avatar
bester69
 
Posts: 1143
Joined: 2015-04-02 13:15

Re: Downloading Youtube Shortcuts in Disk??

Postby bester69 » 2018-06-09 01:02

So then , we apply youlist script to yutubes' list:
youlist ./MyYoutubeVideos.txt

And the result look like this, and we can enjoy all of our youtube videos in streaming with mpv or vlc, by using youtube's shortcuts.:

Image
https://ibb.co/bMDsf8
Last edited by bester69 on 2018-06-09 08:43, edited 1 time in total.
bester69 wrote:There is nothing to install in linux, from time to time i go to google searching for something fresh to install in linux, but, there is nothing
User avatar
bester69
 
Posts: 1143
Joined: 2015-04-02 13:15

Re: Downloading Youtube Shortcuts in Disk!!

Postby debiman » 2018-06-09 04:10

wtf, softporn.
thanks for another glimpse into your personal life.
Image
User avatar
debiman
 
Posts: 2405
Joined: 2013-03-12 07:18

Re: Downloading Youtube Shortcuts in Disk!!

Postby None1975 » 2018-06-09 12:56

bester69 wrote:Hot Girls on Needy Guys

You are at least mellowed ...
OS: Debian 9.4 / WM: Xmonad
Debian Wiki | DontBreakDebian, My config files in github
Linux User #607425
User avatar
None1975
 
Posts: 481
Joined: 2015-11-29 18:23
Location: Lithuania, Vilnius

Re: Downloading Youtube Shortcuts in Disk!!

Postby Hallvor » 2018-06-09 17:49

I suspect we have a master troll in our presence. :lol:
HP Elitebook 2570p, Intel Core i5 3320-M CPU @ 2.60 GHz, 6 GB RAM, Intel HD 4000 graphics, 240 GB SSD, Debian Stretch (KDE)
User avatar
Hallvor
 
Posts: 814
Joined: 2009-04-16 18:35
Location: Norway

Re: Downloading Youtube Shortcuts in Disk!!

Postby sunrat » 2018-06-10 02:38

Ladyboys? The truth is out!

I usually just download online videos I want to watch more than a couple of times. Not especially interested in ladyboys videos though. :shock: :mrgreen:
“ computer users can be divided into 2 categories:
Those who have lost data
...and those who have not lost data YET ”
Remember to BACKUP!
User avatar
sunrat
 
Posts: 2326
Joined: 2006-08-29 09:12
Location: Melbourne, Australia

Re: Downloading Youtube Shortcuts in Disk!!

Postby bester69 » 2018-06-10 06:15

:?
Last edited by bester69 on 2018-06-10 13:54, edited 1 time in total.
bester69 wrote:There is nothing to install in linux, from time to time i go to google searching for something fresh to install in linux, but, there is nothing
User avatar
bester69
 
Posts: 1143
Joined: 2015-04-02 13:15

Re: Downloading Youtube Shortcuts in Disk!!

Postby arochester » 2018-06-10 09:23

Please stick to Debian, Linux, Computers...

If you want to get into a general discussion this is not the place.
arochester
 
Posts: 1253
Joined: 2010-12-07 19:55

Re: Downloading Youtube Shortcuts in Disk!!

Postby bester69 » 2018-06-12 17:22

Getting the playlist .txt from youtube; so we can download the whole playlist shortcuts.:
Code: Select all
$ git clone https://github.com/alexfalcucc/playlist-easy


youget.sh
Code: Select all
###Usar Comillas dobles al pasarle la Playlist
python2 /home/myuser/.local/share/youtube_playlist/youParse.py $1 > Playlist_youtube.txt
echo "Las URL's son.:"
cat ./Playlist_youtube.txt

---------------------------------------

Then, we would run following scripts in order to get all shortcuts videos..:

youget "Url_Playlist" (**Using quotes in order to work)
youlnks ./Playlist_youtube.txt


Ive just downloaded two video Tutorials (Libreoffice and Audacity's Playlists) with 60 videos for just 9Mb in disk. :D 8)
bester69 wrote:There is nothing to install in linux, from time to time i go to google searching for something fresh to install in linux, but, there is nothing
User avatar
bester69
 
Posts: 1143
Joined: 2015-04-02 13:15


Return to Docs, Howtos, Tips & Tricks

Who is online

Users browsing this forum: No registered users and 4 guests

fashionable