Browse code

Minor Improvements, extern Downloader aria2 is an option, script is shellchecked, comment = ## example = #

dewomser authored on22/05/2018 08:27:47
Showing2 changed files

... ...
@@ -1,4 +1,10 @@
1 1
 # FF-auto-youtube-download-
2
-This Bash-script needs a Firefox-Browser, youtube-dl and sqlite3 
3
-The script downloads only fresh Videos to your harddisk.
4
-Source are the URLs from a Bookmarks folder
2
+##Download favourite Videos from an array or Firefox-folder
3
+No need to login
4
+The script downloads only fresh Videos to disk.
5
+
6
+1.option array : only shell and youtube-dl is needed
7
+2.option firefox-folder : shell, firefox, sqlite3, (aria2)
8
+
9
+
10
+
... ...
@@ -9,27 +9,28 @@
9 9
 # sleep 5
10 10
 
11 11
 # Variables #
12
-#firefox manages bookmarks from database. 
13
-#save all your Youtube playlists in $favdir
12
+##firefox manages bookmarks from database. ##
13
+##save all your Youtube playlists in $favdir##
14 14
 favdir="bestof"
15 15
 echo $favdir
16
-#Download folder
16
+##Download folder##
17 17
 dl_folder="/home/foo/Downloads/youtube-dl/"
18 18
 echo  $dl_folder
19
-#Date= yesterday
19
+##Date= yesterday##
20 20
 datum=$(date -d "1 day ago" '+%Y%m%d')
21
-# Videos per day in each playlist
21
+## Videos per day in each playlist##
22 22
 perday=4
23
-#if aria2 is installed example :--external-downloader aria2c  --external-downloader-args "-j 8 -s 8 -x 8 -k 5M"
23
+##if aria2 is installed example :##
24
+#aria2='--external-downloader aria2c  --external-downloader-args "-j 8 -s 8 -x 8 -k 5M"'
24 25
 aria2=''
25 26
 
26
-# from Firefox bookmarks
27
-# switch to the default firefox folder with sqlite databases.
28
-# change *default* if you have other profiles than default.
27
+## from Firefox bookmarks##
28
+## switch to the default firefox folder with sqlite databases.##
29
+## change *default* if you have other profiles than default.##
29 30
 cd ~/.mozilla/firefox/*default* || exit
30 31
 
31
-# uncomment if you  load from an array
32
-# No Firefox no variables needed 
32
+##uncomment if you  load from an array##
33
+##No Firefox no variables needed##
33 34
 #dl_folder="~/Downloads"
34 35
 #perday=4
35 36
 #dbarray=(
... ...
@@ -37,15 +38,15 @@ cd ~/.mozilla/firefox/*default* || exit
37 38
 #"https://www.youtube.com/channel/example-bar/videos?sort=dd&shelf_id=0&view=0"
38 39
 #)
39 40
 
40
-#comment this if you load from array
41
-#firefox manages bookmarks from database. 
42
-#Firefox  bookmarks needs a folder $favdir.
43
-#save all your Youtube playlists in $favdir
41
+##comment this if you load from array##
42
+##firefox manages bookmarks from database.## 
43
+##Firefox  bookmarks needs a folder $favdir.##
44
+##save all your Youtube playlists in $favdir##
44 45
 dbarray=( $(sqlite3 -list places.sqlite 'select url from moz_places where id in (select fk from moz_bookmarks where parent in ( select "id" from moz_bookmarks where title == "'$favdir'"))'; ))
45 46
 
46
-#this  must not be commented
47
+##this  must not be commented##
47 48
 cd  $dl_folder || exit
48
-# let youtube-dl do the work  and download brandnew videos
49
+## let youtube-dl do the work  and download brandnew videos##
49 50
 # 
50 51
 for i in "${dbarray[@]}"; do
51 52
 youtube-dl "$aria2" --dateafter "$datum" --playlist-end "$perday" --max-downloads "$perday" "$i"