Browse code

Exception if we cannot find other then 1 Firefox profile

dewomser authored on02/05/2020 08:46:12
Showing1 changed files
... ...
@@ -37,15 +37,34 @@ $yot_dl_p -U
37 37
 
38 38
 
39 39
 ## Start ##
40
-# there should only be one default , if not change cd #
41
-cd ~/.mozilla/firefox/*default* || exit
40
+
41
+if [ $loadfrom == database ]
42
+then
43
+cd ~/.mozilla/firefox || exit
44
+#find ./ -maxdepth 1 -name "*default*" -type d
45
+ffdefault=$(find ./ -maxdepth 1 -name "*default*" -type d | wc -l)
46
+if [ "$ffdefault" -gt 1 ]
47
+then
48
+echo "There is more then 1 default Firefox profile ! You have to choose one at ~/.mozilla/firefox and edit this script for your need"
49
+find ./ -maxdepth 1 -name "*default*" -type d 
50
+exit
51
+elif [ "$ffdefault" == 0 ]
52
+then
53
+echo " There is no Firefox profile in your ~/.mozilla/firefox but it should. Script can't continue !"
54
+exit
55
+fi
56
+
57
+# If more then 1 FF profile  Edit here ! 
58
+# change *default*  to your profile. Example fdgsfdgfs43543.default.fdsgf 
59
+cd ./*default* || exit
60
+
42 61
 # you cannot read from a running sqlite, but to copy is allowed#
43
-if [ $ffon == 1 ] && [ $loadfrom == database ]
62
+if [ $ffon == 1 ]
44 63
 then
45 64
 cp $sqltdata places2.sqlite
46 65
 sqltdata=places2.sqlite
47 66
 fi
48
-
67
+fi
49 68
 ## only edit dbarray test-content if you want to use it
50 69
 
51 70
 if [ $loadfrom == array ]
... ...
@@ -61,9 +80,9 @@ then
61 80
  
62 81
 else
63 82
  ## This line puts FF bookmarks from sqlite3 to an array ##
64
-
83
+#oldschool#
65 84
 #dbarray=( $(sqlite3 -list $sqltdata 'select url from moz_places where id in (select fk from moz_bookmarks where parent in ( select "id" from moz_bookmarks where title == "'$favdir'"))'; ))
66
-
85
+#new V.bash4.0#
67 86
 readarray -t dbarray < <(sqlite3 -list $sqltdata 'select url from moz_places where id in (select fk from moz_bookmarks where parent in ( select "id" from moz_bookmarks where title == "'$favdir'"))')
68 87
 fi
69 88
 cd  $dl_folder || exit
... ...
@@ -76,5 +95,4 @@ $yot_dl_p $aria2 --download-archive $dl_folder/archive/archive-$zaehl.txt --date
76 95
 # echo $i
77 96
 done
78 97
 
79
-## -----------push notification is now an extra script ----+##
80 98
 
Browse code

minor things Kommentar entfernt

dewomser authored on24/03/2020 06:09:04
Showing1 changed files
... ...
@@ -75,23 +75,6 @@ for i in "${dbarray[@]}"; do
75 75
 $yot_dl_p $aria2 --download-archive $dl_folder/archive/archive-$zaehl.txt --dateafter "$datum" --playlist-end "$perday" --max-downloads "$perday" "$i"
76 76
 # echo $i
77 77
 done
78
-##
79
-##--------------------Do not edit above this line ! -----------------------
80
-##
81 78
 
82
-## optional after all Downloads ##
83
-
84
-## Feedback if this script is started from crontab
85
-#export HOME=/home/karl
86
-#export DISPLAY=:0.0
87
-## Open folder in dolphin KDE
88
-#dolphin $dl_folder
89
-## Notifier KDE
90
-#f=$(find $dl_folder -mtime 0,2 -type f -regex '.*\.\(mkv\|mp4\|wmv\|flv\|webm\|mov\)') && notify-send "Neue Videos": "$f" --icon=video-x-generic
91
-
92
- ## Notifier KDE in nice
93
-#f=$(find $dl_folder -mtime 0 -type f -regex '.*\.\(mkv\|mp4\|wmv\|flv\|webm\|mov\)')
94
-#folder1=$(echo $dl_folder|sed "s/\//\\\\\//g")
95
-#f1=$(echo $f|sed "s/$folder1/\n /g")
96
-#notify-send "Neue Videos": "$f1" --icon=video-x-generic
79
+## -----------push notification is now an extra script ----+##
97 80
 
Browse code

Variablen neu sortiert. readarray commando gefixt .

dewomser authored on20/03/2020 07:10:32
Showing1 changed files
... ...
@@ -1,37 +1,45 @@
1 1
 #!/bin/bash
2 2
 ## This Shellscript downloads all fresh videos from a firefox bookmark folder. ##
3 3
 
4
-## Update your youtube-dl ! ##
5
-#youtube-dl -U 
6
-## or 
7
-# pip install --upgrade youtube-dl
8
-sleep 1
9
-zaehl=0
10
-## Variables ##
4
+##Variables to edit from the user##
11 5
 
12
-## Save all your Youtube playlists in favdir Example amp3 ##
6
+#path to youtube-dl. If you dont know, use cli: "which youtube"#
7
+yot_dl_p="$HOME/bin/youtube-dl"
8
+# folder for the downkoaded Videos #
9
+dl_folder=~/Downloads/youtube-dl
10
+# load from "database" or "array".#
11
+loadfrom=database
12
+# If Loadfrom=database, save all your Youtube playlists in favdir example (amp3) #
13 13
 favdir="amp3"
14
-## Firefox running ? 
15
-# ffon=0; ps -ef|grep firefox|grep -v grep && ffon=1
14
+
15
+## Variables to edit carefully ##
16
+sleep 1
17
+zaehl=0
18
+# Firefox running ?#
16 19
 ffon=0; pgrep firefox && ffon=1
17
-## Download folder ##
18
-dl_folder=~/Downloads/youtube-dl
19
-## Date= yesterday ##
20
+# Date= yesterday #
20 21
 datum=$(date -d "1 day ago" '+%Y%m%d')
21
-## Max. videos / datum to each playlist ##
22
+# Max. videos / datum to each playlist #
22 23
 perday=4
23
-## if aria2 is installed example : ##
24
+# if aria2 is installed example : #
24 25
 # aria2='--external-downloader aria2c  --external-downloader-args "-j 8 -s 8 -x 8 -k 5M"'
25 26
 aria2=''
26
-## load from "database" or "array".
27
-loadfrom=database
28
-## firefox database
27
+# firefox database#
29 28
 sqltdata=places.sqlite
30 29
 
31
-## Start ##
32 30
 
33
-cd ~/.mozilla/firefox/*default* || exit
34 31
 
32
+## Update your youtube-dl ! ##
33
+$yot_dl_p -U 
34
+## or 
35
+# pip install --upgrade youtube-dl
36
+
37
+
38
+
39
+## Start ##
40
+# there should only be one default , if not change cd #
41
+cd ~/.mozilla/firefox/*default* || exit
42
+# you cannot read from a running sqlite, but to copy is allowed#
35 43
 if [ $ffon == 1 ] && [ $loadfrom == database ]
36 44
 then
37 45
 cp $sqltdata places2.sqlite
... ...
@@ -54,8 +62,9 @@ then
54 62
 else
55 63
  ## This line puts FF bookmarks from sqlite3 to an array ##
56 64
 
57
-# dbarray=( $(sqlite3 -list $sqltdata 'select url from moz_places where id in (select fk from moz_bookmarks where parent in ( select "id" from moz_bookmarks where title == "'$favdir'"))'; ))
58
-readarray -t dbarray < "$(sqlite3 -list $sqltdata 'select url from moz_places where id in (select fk from moz_bookmarks where parent in ( select "id" from moz_bookmarks where title == "'$favdir'"))'; )"
65
+#dbarray=( $(sqlite3 -list $sqltdata 'select url from moz_places where id in (select fk from moz_bookmarks where parent in ( select "id" from moz_bookmarks where title == "'$favdir'"))'; ))
66
+
67
+readarray -t dbarray < <(sqlite3 -list $sqltdata 'select url from moz_places where id in (select fk from moz_bookmarks where parent in ( select "id" from moz_bookmarks where title == "'$favdir'"))')
59 68
 fi
60 69
 cd  $dl_folder || exit
61 70
 
... ...
@@ -63,9 +72,26 @@ cd  $dl_folder || exit
63 72
 
64 73
 for i in "${dbarray[@]}"; do
65 74
 ((zaehl++))
66
-youtube-dl $aria2 --download-archive $dl_folder/archive/archive-$zaehl.txt --dateafter "$datum" --playlist-end "$perday" --max-downloads "$perday" "$i"
75
+$yot_dl_p $aria2 --download-archive $dl_folder/archive/archive-$zaehl.txt --dateafter "$datum" --playlist-end "$perday" --max-downloads "$perday" "$i"
67 76
 # echo $i
68 77
 done
69 78
 ##
70
-##--------------------The notifier for KDE is now an extra script : yt-dl-send-notify.sh ! -----------------------
79
+##--------------------Do not edit above this line ! -----------------------
80
+##
81
+
82
+## optional after all Downloads ##
83
+
84
+## Feedback if this script is started from crontab
85
+#export HOME=/home/karl
86
+#export DISPLAY=:0.0
87
+## Open folder in dolphin KDE
88
+#dolphin $dl_folder
89
+## Notifier KDE
90
+#f=$(find $dl_folder -mtime 0,2 -type f -regex '.*\.\(mkv\|mp4\|wmv\|flv\|webm\|mov\)') && notify-send "Neue Videos": "$f" --icon=video-x-generic
91
+
92
+ ## Notifier KDE in nice
93
+#f=$(find $dl_folder -mtime 0 -type f -regex '.*\.\(mkv\|mp4\|wmv\|flv\|webm\|mov\)')
94
+#folder1=$(echo $dl_folder|sed "s/\//\\\\\//g")
95
+#f1=$(echo $f|sed "s/$folder1/\n /g")
96
+#notify-send "Neue Videos": "$f1" --icon=video-x-generic
71 97
 
Browse code

Kommentare geändert

dewomser authored on19/03/2020 14:18:44
Showing1 changed files
... ...
@@ -2,16 +2,16 @@
2 2
 ## This Shellscript downloads all fresh videos from a firefox bookmark folder. ##
3 3
 
4 4
 ## Update your youtube-dl ! ##
5
-youtube-dl -U 
5
+#youtube-dl -U 
6 6
 ## or 
7 7
 # pip install --upgrade youtube-dl
8 8
 sleep 1
9 9
 zaehl=0
10 10
 ## Variables ##
11 11
 
12
-## Save all your Youtube playlists in favdir (amp3) ##
12
+## Save all your Youtube playlists in favdir Example amp3 ##
13 13
 favdir="amp3"
14
-## Firefox running ?
14
+## Firefox running ? 
15 15
 # ffon=0; ps -ef|grep firefox|grep -v grep && ffon=1
16 16
 ffon=0; pgrep firefox && ffon=1
17 17
 ## Download folder ##
... ...
@@ -67,22 +67,5 @@ youtube-dl $aria2 --download-archive $dl_folder/archive/archive-$zaehl.txt --dat
67 67
 # echo $i
68 68
 done
69 69
 ##
70
-##--------------------Do not edit above this line ! -----------------------
71
-##
72
-
73
-## optional after all Downloads ##
74
-
75
-## Feedback if this script is started from crontab
76
-#export HOME=/home/karl
77
-#export DISPLAY=:0.0
78
-## Open folder in dolphin KDE
79
-#dolphin $dl_folder
80
-## Notifier KDE
81
-#f=$(find $dl_folder -mtime 0,2 -type f -regex '.*\.\(mkv\|mp4\|wmv\|flv\|webm\|mov\)') && notify-send "Neue Videos": "$f" --icon=video-x-generic
82
-
83
- ## Notifier KDE in nice
84
-#f=$(find $dl_folder -mtime 0 -type f -regex '.*\.\(mkv\|mp4\|wmv\|flv\|webm\|mov\)')
85
-#folder1=$(echo $dl_folder|sed "s/\//\\\\\//g")
86
-#f1=$(echo $f|sed "s/$folder1/\n /g")
87
-#notify-send "Neue Videos": "$f1" --icon=video-x-generic
70
+##--------------------The notifier for KDE is now an extra script : yt-dl-send-notify.sh ! -----------------------
88 71
 
Browse code

array noch mal

dewomser authored on30/12/2019 21:33:43
Showing1 changed files
... ...
@@ -54,7 +54,8 @@ then
54 54
 else
55 55
  ## This line puts FF bookmarks from sqlite3 to an array ##
56 56
 
57
- dbarray=( $(sqlite3 -list $sqltdata 'select url from moz_places where id in (select fk from moz_bookmarks where parent in ( select "id" from moz_bookmarks where title == "'$favdir'"))'; ))
57
+# dbarray=( $(sqlite3 -list $sqltdata 'select url from moz_places where id in (select fk from moz_bookmarks where parent in ( select "id" from moz_bookmarks where title == "'$favdir'"))'; ))
58
+readarray -t dbarray < "$(sqlite3 -list $sqltdata 'select url from moz_places where id in (select fk from moz_bookmarks where parent in ( select "id" from moz_bookmarks where title == "'$favdir'"))'; )"
58 59
 fi
59 60
 cd  $dl_folder || exit
60 61
 
... ...
@@ -72,16 +73,16 @@ done
72 73
 ## optional after all Downloads ##
73 74
 
74 75
 ## Feedback if this script is started from crontab
75
-export HOME=/home/karl
76
-export DISPLAY=:0.0
76
+#export HOME=/home/karl
77
+#export DISPLAY=:0.0
77 78
 ## Open folder in dolphin KDE
78 79
 #dolphin $dl_folder
79 80
 ## Notifier KDE
80 81
 #f=$(find $dl_folder -mtime 0,2 -type f -regex '.*\.\(mkv\|mp4\|wmv\|flv\|webm\|mov\)') && notify-send "Neue Videos": "$f" --icon=video-x-generic
81 82
 
82 83
  ## Notifier KDE in nice
83
-f=$(find $dl_folder -mtime 0 -type f -regex '.*\.\(mkv\|mp4\|wmv\|flv\|webm\|mov\)')
84
-folder1=$(echo $dl_folder|sed "s/\//\\\\\//g")
85
-f1=$(echo $f|sed "s/$folder1/\n /g")
86
-notify-send "Neue Videos": "$f1" --icon=video-x-generic
84
+#f=$(find $dl_folder -mtime 0 -type f -regex '.*\.\(mkv\|mp4\|wmv\|flv\|webm\|mov\)')
85
+#folder1=$(echo $dl_folder|sed "s/\//\\\\\//g")
86
+#f1=$(echo $f|sed "s/$folder1/\n /g")
87
+#notify-send "Neue Videos": "$f1" --icon=video-x-generic
87 88
 
Browse code

array syntax auf bash 4

dewomser authored on30/12/2019 21:23:26
Showing1 changed files
... ...
@@ -72,17 +72,16 @@ done
72 72
 ## optional after all Downloads ##
73 73
 
74 74
 ## Feedback if this script is started from crontab
75
-
75
+export HOME=/home/karl
76
+export DISPLAY=:0.0
76 77
 ## Open folder in dolphin KDE
77 78
 #dolphin $dl_folder
78 79
 ## Notifier KDE
79 80
 #f=$(find $dl_folder -mtime 0,2 -type f -regex '.*\.\(mkv\|mp4\|wmv\|flv\|webm\|mov\)') && notify-send "Neue Videos": "$f" --icon=video-x-generic
80 81
 
81
-## Notifier KDE in nice
82
-# This part of the is from now on a separated script. To get in this repository
83
-
84
-# f=$(find $dl_folder -mtime 0 -type f -regex '.*\.\(mkv\|mp4\|wmv\|flv\|webm\|mov\)')
85
-# folder1=$(echo $dl_folder|sed "s/\//\\\\\//g")
86
-# f1=$(echo $f|sed "s/$folder1/\n /g")
87
-# notify-send "Neue Videos": "$f1" --icon=video-x-generic
82
+ ## Notifier KDE in nice
83
+f=$(find $dl_folder -mtime 0 -type f -regex '.*\.\(mkv\|mp4\|wmv\|flv\|webm\|mov\)')
84
+folder1=$(echo $dl_folder|sed "s/\//\\\\\//g")
85
+f1=$(echo $f|sed "s/$folder1/\n /g")
86
+notify-send "Neue Videos": "$f1" --icon=video-x-generic
88 87
 
Browse code

A notifier for KDE/Plasma. Shows newly downloaded videoclips and examples for crontab

dewomser authored on30/12/2019 13:13:16
Showing1 changed files
... ...
@@ -1,39 +1,35 @@
1 1
 #!/bin/bash
2
-
3
-## This Shellscript downloads all fresh videos from array or firefox bookmark folder with youtube playlists. ##
2
+## This Shellscript downloads all fresh videos from a firefox bookmark folder. ##
4 3
 
5 4
 ## Update your youtube-dl ! ##
6
-# "youtube-dl -U" 
5
+youtube-dl -U 
7 6
 ## or 
8 7
 # pip install --upgrade youtube-dl
9 8
 sleep 1
10
-#zaehl=0
11
-
9
+zaehl=0
12 10
 ## Variables ##
13
-## ----------important-------------
14
-## Download folder make it. mkdir ~/Downloads/youtube-dl ##
15
-dl_folder=~/Downloads/youtube-dl
16
-## Save all your Youtube playlists in FF bookmark (bestof) ##
17
-favdir="bestof"
18
-## ------------ may help----------
11
+
12
+## Save all your Youtube playlists in favdir (amp3) ##
13
+favdir="amp3"
19 14
 ## Firefox running ?
15
+# ffon=0; ps -ef|grep firefox|grep -v grep && ffon=1
20 16
 ffon=0; pgrep firefox && ffon=1
21
-## Firefox default Profil
22
-## only if you not using the default FF-profile, this line must be edited ## 
23
-# ffprofile=$(grep 'Path=' ~/.mozilla/firefox/profiles.ini | sed s/^Path=//)
17
+## Download folder ##
18
+dl_folder=~/Downloads/youtube-dl
24 19
 ## Date= yesterday ##
25 20
 datum=$(date -d "1 day ago" '+%Y%m%d')
26
-## Max. videos download in each playlist ##
21
+## Max. videos / datum to each playlist ##
27 22
 perday=4
28 23
 ## if aria2 is installed example : ##
29 24
 # aria2='--external-downloader aria2c  --external-downloader-args "-j 8 -s 8 -x 8 -k 5M"'
30 25
 aria2=''
31
-## load from "database" or "array". database == firefox SQLITE 
26
+## load from "database" or "array".
32 27
 loadfrom=database
33 28
 ## firefox database
34 29
 sqltdata=places.sqlite
35 30
 
36 31
 ## Start ##
32
+
37 33
 cd ~/.mozilla/firefox/*default* || exit
38 34
 
39 35
 if [ $ffon == 1 ] && [ $loadfrom == database ]
... ...
@@ -41,6 +37,7 @@ then
41 37
 cp $sqltdata places2.sqlite
42 38
 sqltdata=places2.sqlite
43 39
 fi
40
+
44 41
 ## only edit dbarray test-content if you want to use it
45 42
 
46 43
 if [ $loadfrom == array ]
... ...
@@ -49,8 +46,8 @@ then
49 46
  "https://www.youtube.com/user/GalileoOffiziell/videos"
50 47
  "https://www.youtube.com/user/BibisBeautyPalace/videos?sort=dd&shelf_id=1&view=0"
51 48
  "https://www.youtube.com/channel/UC53bIpnef1pwAx69ERmmOLA"
52
-)
53
- ##
49
+ )
50
+##
54 51
 ##--------------------Do not edit below this line ! -----------------------
55 52
 ##
56 53
  
... ...
@@ -62,18 +59,30 @@ fi
62 59
 cd  $dl_folder || exit
63 60
 
64 61
 ## Let youtube-dl do the work  and download brandnew videos ##
65
-## Wenn die Variable zaehl aktiviert ist, kann der parameter eingebaut werden.
66
-##--download-archive $dl_folder/archive/archive-$zaehl.txt und ((zaehl++))
67 62
 
68 63
 for i in "${dbarray[@]}"; do
69
-youtube-dl $aria2 --dateafter "$datum" --playlist-end "$perday" --max-downloads "$perday" "$i"
64
+((zaehl++))
65
+youtube-dl $aria2 --download-archive $dl_folder/archive/archive-$zaehl.txt --dateafter "$datum" --playlist-end "$perday" --max-downloads "$perday" "$i"
70 66
 # echo $i
71 67
 done
68
+##
69
+##--------------------Do not edit above this line ! -----------------------
70
+##
71
+
72
+## optional after all Downloads ##
73
+
74
+## Feedback if this script is started from crontab
72 75
 
76
+## Open folder in dolphin KDE
77
+#dolphin $dl_folder
78
+## Notifier KDE
79
+#f=$(find $dl_folder -mtime 0,2 -type f -regex '.*\.\(mkv\|mp4\|wmv\|flv\|webm\|mov\)') && notify-send "Neue Videos": "$f" --icon=video-x-generic
73 80
 
74
-## optional ##
81
+## Notifier KDE in nice
82
+# This part of the is from now on a separated script. To get in this repository
75 83
 
76
-# dolphin $dl_folder
77
-## send-notify ##
78
-# f=$(find $dl_folder -mtime 0,2 -type f -regex '.*\.\(mkv\|mp4\|wmv\|flv\|webm\|mov\)') && notify-send "Neue Videos": "$f" --icon=video-x-generic
84
+# f=$(find $dl_folder -mtime 0 -type f -regex '.*\.\(mkv\|mp4\|wmv\|flv\|webm\|mov\)')
85
+# folder1=$(echo $dl_folder|sed "s/\//\\\\\//g")
86
+# f1=$(echo $f|sed "s/$folder1/\n /g")
87
+# notify-send "Neue Videos": "$f1" --icon=video-x-generic
79 88
 
Browse code

aria2 Variable Kommentar

Stefan Höhn authored on11/06/2019 13:30:53 • GitHub committed on11/06/2019 13:30:53
Showing1 changed files
... ...
@@ -25,7 +25,8 @@ ffon=0; pgrep firefox && ffon=1
25 25
 datum=$(date -d "1 day ago" '+%Y%m%d')
26 26
 ## Max. videos download in each playlist ##
27 27
 perday=4
28
-## if aria2 downloader is installed and you want to use it, change from 0 to 1  ##
28
+## if aria2 is installed example : ##
29
+# aria2='--external-downloader aria2c  --external-downloader-args "-j 8 -s 8 -x 8 -k 5M"'
29 30
 aria2=''
30 31
 ## load from "database" or "array". database == firefox SQLITE 
31 32
 loadfrom=database
Browse code

Upps! zaehl entfernt

Stefan Höhn authored on11/06/2019 13:27:30 • GitHub committed on11/06/2019 13:27:30
Showing1 changed files
... ...
@@ -62,10 +62,9 @@ cd  $dl_folder || exit
62 62
 
63 63
 ## Let youtube-dl do the work  and download brandnew videos ##
64 64
 ## Wenn die Variable zaehl aktiviert ist, kann der parameter eingebaut werden.
65
-##--download-archive $dl_folder/archive/archive-$zaehl.txt
65
+##--download-archive $dl_folder/archive/archive-$zaehl.txt und ((zaehl++))
66 66
 
67 67
 for i in "${dbarray[@]}"; do
68
-((zaehl++))
69 68
 youtube-dl $aria2 --dateafter "$datum" --playlist-end "$perday" --max-downloads "$perday" "$i"
70 69
 # echo $i
71 70
 done
Browse code

rewrite code is shorter now

Stefan Höhn authored on11/06/2019 13:24:41 • GitHub committed on11/06/2019 13:24:41
Showing1 changed files
... ...
@@ -6,7 +6,8 @@
6 6
 # "youtube-dl -U" 
7 7
 ## or 
8 8
 # pip install --upgrade youtube-dl
9
-# sleep 3
9
+sleep 1
10
+#zaehl=0
10 11
 
11 12
 ## Variables ##
12 13
 ## ----------important-------------
... ...
@@ -19,21 +20,28 @@ favdir="bestof"
19 20
 ffon=0; pgrep firefox && ffon=1
20 21
 ## Firefox default Profil
21 22
 ## only if you not using the default FF-profile, this line must be edited ## 
22
-ffprofile=$(grep 'Path=' ~/.mozilla/firefox/profiles.ini | sed s/^Path=//)
23
+# ffprofile=$(grep 'Path=' ~/.mozilla/firefox/profiles.ini | sed s/^Path=//)
23 24
 ## Date= yesterday ##
24 25
 datum=$(date -d "1 day ago" '+%Y%m%d')
25 26
 ## Max. videos download in each playlist ##
26 27
 perday=4
27 28
 ## if aria2 downloader is installed and you want to use it, change from 0 to 1  ##
28
-aria=0
29
+aria2=''
29 30
 ## load from "database" or "array". database == firefox SQLITE 
30 31
 loadfrom=database
31 32
 ## firefox database
32 33
 sqltdata=places.sqlite
33 34
 
34 35
 ## Start ##
36
+cd ~/.mozilla/firefox/*default* || exit
37
+
38
+if [ $ffon == 1 ] && [ $loadfrom == database ]
39
+then
40
+cp $sqltdata places2.sqlite
41
+sqltdata=places2.sqlite
42
+fi
43
+## only edit dbarray test-content if you want to use it
35 44
 
36
-##  Use array, edit dbarray for your needs else this is ignored. ##
37 45
 if [ $loadfrom == array ]
38 46
 then
39 47
  dbarray=(
... ...
@@ -41,33 +49,31 @@ then
41 49
  "https://www.youtube.com/user/BibisBeautyPalace/videos?sort=dd&shelf_id=1&view=0"
42 50
  "https://www.youtube.com/channel/UC53bIpnef1pwAx69ERmmOLA"
43 51
 )
44
- ##-----carefully edit below this line ! ---------
45
- else
46
- # cd ~/.mozilla/firefox/*default* || exit
47
- cd "$HOME/.mozilla/firefox/$ffprofile" || exit
48
- ## If Firefox is running, db is locked. need a copy ##
49
- if [ $ffon == 1 ] && [ $loadfrom == database ]
50
-  then
51
-  cp $sqltdata places2.sqlite
52
-  sqltdata=places2.sqlite
53
- fi
52
+ ##
53
+##--------------------Do not edit below this line ! -----------------------
54
+##
55
+ 
56
+else
54 57
  ## This line puts FF bookmarks from sqlite3 to an array ##
55
- readarray -t dbarray < "$(sqlite3 -list $sqltdata 'select url from moz_places where id in (select fk from moz_bookmarks where parent in ( select "id" from moz_bookmarks where title == "'$favdir'"))'; )"
58
+
59
+ dbarray=( $(sqlite3 -list $sqltdata 'select url from moz_places where id in (select fk from moz_bookmarks where parent in ( select "id" from moz_bookmarks where title == "'$favdir'"))'; ))
56 60
 fi
61
+cd  $dl_folder || exit
57 62
 
58 63
 ## Let youtube-dl do the work  and download brandnew videos ##
59
-cd $dl_folder || exit
60
-if [ $aria == 1 ]
61
-then
62
- for i in "${dbarray[@]}"; do
63
-youtube-dl --dateafter "$datum" --playlist-end "$perday" --max-downloads "$perday" --external-downloader aria2c --external-downloader-args '-c -j 3 -x 3 -s 3 -k 1M' "$i"
64
- done
65
- else
66
- for i in "${dbarray[@]}"; do
67
-youtube-dl --dateafter "$datum" --playlist-end "$perday" --max-downloads "$perday" "$i"
68
- done
69
-fi
64
+## Wenn die Variable zaehl aktiviert ist, kann der parameter eingebaut werden.
65
+##--download-archive $dl_folder/archive/archive-$zaehl.txt
66
+
67
+for i in "${dbarray[@]}"; do
68
+((zaehl++))
69
+youtube-dl $aria2 --dateafter "$datum" --playlist-end "$perday" --max-downloads "$perday" "$i"
70
+# echo $i
71
+done
72
+
73
+
74
+## optional ##
70 75
 
71
-## optional show downloadfolder ##
72 76
 # dolphin $dl_folder
73
-# f=$(find -ctime 1) ; notify-send "New vidoclips": "$f" --icon=video-x-generic
77
+## send-notify ##
78
+# f=$(find $dl_folder -mtime 0,2 -type f -regex '.*\.\(mkv\|mp4\|wmv\|flv\|webm\|mov\)') && notify-send "Neue Videos": "$f" --icon=video-x-generic
79
+
Browse code

optional send-notify

Stefan Höhn authored on11/06/2019 05:50:19 • GitHub committed on11/06/2019 05:50:19
Showing1 changed files
... ...
@@ -69,4 +69,5 @@ youtube-dl --dateafter "$datum" --playlist-end "$perday" --max-downloads "$perda
69 69
 fi
70 70
 
71 71
 ## optional show downloadfolder ##
72
-#dolphin $dl_folder
72
+# dolphin $dl_folder
73
+# f=$(find -ctime 1) ; notify-send "New vidoclips": "$f" --icon=video-x-generic
Browse code

check.sh & youtube-dl.sh now Shellcheck approved

dewomser authored on19/02/2019 17:24:57
Showing1 changed files
... ...
@@ -40,10 +40,11 @@ then
40 40
  "https://www.youtube.com/user/GalileoOffiziell/videos"
41 41
  "https://www.youtube.com/user/BibisBeautyPalace/videos?sort=dd&shelf_id=1&view=0"
42 42
  "https://www.youtube.com/channel/UC53bIpnef1pwAx69ERmmOLA"
43
-##-----carefully edit below this line ! ---------
43
+)
44
+ ##-----carefully edit below this line ! ---------
44 45
  else
45 46
  # cd ~/.mozilla/firefox/*default* || exit
46
- cd ~/.mozilla/firefox/$ffprofile || exit
47
+ cd "$HOME/.mozilla/firefox/$ffprofile" || exit
47 48
  ## If Firefox is running, db is locked. need a copy ##
48 49
  if [ $ffon == 1 ] && [ $loadfrom == database ]
49 50
   then
... ...
@@ -51,7 +52,7 @@ then
51 52
   sqltdata=places2.sqlite
52 53
  fi
53 54
  ## This line puts FF bookmarks from sqlite3 to an array ##
54
- dbarray=( $(sqlite3 -list $sqltdata 'select url from moz_places where id in (select fk from moz_bookmarks where parent in ( select "id" from moz_bookmarks where title == "'$favdir'"))'; ))
55
+ readarray -t dbarray < "$(sqlite3 -list $sqltdata 'select url from moz_places where id in (select fk from moz_bookmarks where parent in ( select "id" from moz_bookmarks where title == "'$favdir'"))'; )"
55 56
 fi
56 57
 
57 58
 ## Let youtube-dl do the work  and download brandnew videos ##
Browse code

Aria2 downloader can be used now.

dewomser authored on25/11/2018 09:50:54
Showing1 changed files
... ...
@@ -1,5 +1,6 @@
1 1
 #!/bin/bash
2
-## This Shellscript downloads all fresh videos from a firefox bookmark folder. ##
2
+
3
+## This Shellscript downloads all fresh videos from array or firefox bookmark folder with youtube playlists. ##
3 4
 
4 5
 ## Update your youtube-dl ! ##
5 6
 # "youtube-dl -U" 
... ...
@@ -8,67 +9,63 @@
8 9
 # sleep 3
9 10
 
10 11
 ## Variables ##
11
-
12
-## Save all your Youtube playlists in favdir ##
12
+## ----------important-------------
13
+## Download folder make it. mkdir ~/Downloads/youtube-dl ##
14
+dl_folder=~/Downloads/youtube-dl
15
+## Save all your Youtube playlists in FF bookmark (bestof) ##
13 16
 favdir="bestof"
17
+## ------------ may help----------
14 18
 ## Firefox running ?
15
-# ffon=0; ps -ef|grep firefox|grep -v grep && ffon=1
16 19
 ffon=0; pgrep firefox && ffon=1
17 20
 ## Firefox default Profil
21
+## only if you not using the default FF-profile, this line must be edited ## 
18 22
 ffprofile=$(grep 'Path=' ~/.mozilla/firefox/profiles.ini | sed s/^Path=//)
19
-## Download folder ##
20
-dl_folder=~/Downloads/youtube-dl
21 23
 ## Date= yesterday ##
22 24
 datum=$(date -d "1 day ago" '+%Y%m%d')
23
-## Max. videos / datum to each playlist ##
25
+## Max. videos download in each playlist ##
24 26
 perday=4
25
-## if aria2 is installed example : ##
26
-# aria2='--external-downloader aria2c  --external-downloader-args "-j 8 -s 8 -x 8 -k 5M"'
27
-aria2=''
28
-## load from "database" or "array".
27
+## if aria2 downloader is installed and you want to use it, change from 0 to 1  ##
28
+aria=0
29
+## load from "database" or "array". database == firefox SQLITE 
29 30
 loadfrom=database
30 31
 ## firefox database
31 32
 sqltdata=places.sqlite
32 33
 
33 34
 ## Start ##
34 35
 
35
-## only edit dbarray test-content if you want to use it
36
-
36
+##  Use array, edit dbarray for your needs else this is ignored. ##
37 37
 if [ $loadfrom == array ]
38 38
 then
39 39
  dbarray=(
40 40
  "https://www.youtube.com/user/GalileoOffiziell/videos"
41 41
  "https://www.youtube.com/user/BibisBeautyPalace/videos?sort=dd&shelf_id=1&view=0"
42 42
  "https://www.youtube.com/channel/UC53bIpnef1pwAx69ERmmOLA"
43
- )
44
-##
45
-##--------------------Do not edit below this line ! -----------------------
46
-##
47
- 
48
-else
49
-
50
-# cd ~/.mozilla/firefox/*default* || exit
51
-cd ~/.mozilla/firefox/$ffprofile || exit
52
-
53
-
54
-if [ $ffon == 1 ] && [ $loadfrom == database ]
55
-then
56
-cp $sqltdata places2.sqlite
57
-sqltdata=places2.sqlite
58
-fi
59
-
43
+##-----carefully edit below this line ! ---------
44
+ else
45
+ # cd ~/.mozilla/firefox/*default* || exit
46
+ cd ~/.mozilla/firefox/$ffprofile || exit
47
+ ## If Firefox is running, db is locked. need a copy ##
48
+ if [ $ffon == 1 ] && [ $loadfrom == database ]
49
+  then
50
+  cp $sqltdata places2.sqlite
51
+  sqltdata=places2.sqlite
52
+ fi
60 53
  ## This line puts FF bookmarks from sqlite3 to an array ##
61
-
62 54
  dbarray=( $(sqlite3 -list $sqltdata 'select url from moz_places where id in (select fk from moz_bookmarks where parent in ( select "id" from moz_bookmarks where title == "'$favdir'"))'; ))
63 55
 fi
64
-cd  $dl_folder || exit
65 56
 
66 57
 ## Let youtube-dl do the work  and download brandnew videos ##
58
+cd $dl_folder || exit
59
+if [ $aria == 1 ]
60
+then
61
+ for i in "${dbarray[@]}"; do
62
+youtube-dl --dateafter "$datum" --playlist-end "$perday" --max-downloads "$perday" --external-downloader aria2c --external-downloader-args '-c -j 3 -x 3 -s 3 -k 1M' "$i"
63
+ done
64
+ else
65
+ for i in "${dbarray[@]}"; do
66
+youtube-dl --dateafter "$datum" --playlist-end "$perday" --max-downloads "$perday" "$i"
67
+ done
68
+fi
67 69
 
68
-for i in "${dbarray[@]}"; do
69
-youtube-dl $aria2 --dateafter "$datum" --playlist-end "$perday" --max-downloads "$perday" "$i"
70
-# echo $i
71
-done
72
-
73
-## optional ##
70
+## optional show downloadfolder ##
74 71
 #dolphin $dl_folder
Browse code

profile automatisch. if array else mehr firefox spezifikation hinzugefügt

dewomser authored on24/11/2018 11:09:03
Showing1 changed files
... ...
@@ -14,6 +14,8 @@ favdir="bestof"
14 14
 ## Firefox running ?
15 15
 # ffon=0; ps -ef|grep firefox|grep -v grep && ffon=1
16 16
 ffon=0; pgrep firefox && ffon=1
17
+## Firefox default Profil
18
+ffprofile=$(grep 'Path=' ~/.mozilla/firefox/profiles.ini | sed s/^Path=//)
17 19
 ## Download folder ##
18 20
 dl_folder=~/Downloads/youtube-dl
19 21
 ## Date= yesterday ##
... ...
@@ -30,14 +32,6 @@ sqltdata=places.sqlite
30 32
 
31 33
 ## Start ##
32 34
 
33
-cd ~/.mozilla/firefox/*default* || exit
34
-
35
-if [ $ffon == 1 ] && [ $loadfrom == database ]
36
-then
37
-cp $sqltdata places2.sqlite
38
-sqltdata=places2.sqlite
39
-fi
40
-
41 35
 ## only edit dbarray test-content if you want to use it
42 36
 
43 37
 if [ $loadfrom == array ]
... ...
@@ -52,6 +46,17 @@ then
52 46
 ##
53 47
  
54 48
 else
49
+
50
+# cd ~/.mozilla/firefox/*default* || exit
51
+cd ~/.mozilla/firefox/$ffprofile || exit
52
+
53
+
54
+if [ $ffon == 1 ] && [ $loadfrom == database ]
55
+then
56
+cp $sqltdata places2.sqlite
57
+sqltdata=places2.sqlite
58
+fi
59
+
55 60
  ## This line puts FF bookmarks from sqlite3 to an array ##
56 61
 
57 62
  dbarray=( $(sqlite3 -list $sqltdata 'select url from moz_places where id in (select fk from moz_bookmarks where parent in ( select "id" from moz_bookmarks where title == "'$favdir'"))'; ))
Browse code

after shellcheck

dewomser authored on31/10/2018 23:30:01
Showing1 changed files
... ...
@@ -12,9 +12,10 @@
12 12
 ## Save all your Youtube playlists in favdir ##
13 13
 favdir="bestof"
14 14
 ## Firefox running ?
15
-ffon=0; ps -ef|grep firefox|grep -v grep && ffon=1
15
+# ffon=0; ps -ef|grep firefox|grep -v grep && ffon=1
16
+ffon=0; pgrep firefox && ffon=1
16 17
 ## Download folder ##
17
-dl_folder="/home/foo/Downloads/youtube-dl/"
18
+dl_folder=~/Downloads/youtube-dl
18 19
 ## Date= yesterday ##
19 20
 datum=$(date -d "1 day ago" '+%Y%m%d')
20 21
 ## Max. videos / datum to each playlist ##
... ...
@@ -31,7 +32,7 @@ sqltdata=places.sqlite
31 32
 
32 33
 cd ~/.mozilla/firefox/*default* || exit
33 34
 
34
-if (( ffon == 1 && loadfrom == database ))
35
+if [ $ffon == 1 ] && [ $loadfrom == database ]
35 36
 then
36 37
 cp $sqltdata places2.sqlite
37 38
 sqltdata=places2.sqlite
Browse code

documentation and garbage collection

dewomser authored on30/10/2018 21:40:25
Showing1 changed files
... ...
@@ -1,7 +1,7 @@
1 1
 #!/bin/bash
2
-## This Shellscript downloads all fresh videos from afirefox favorite folder. ##
2
+## This Shellscript downloads all fresh videos from a firefox bookmark folder. ##
3 3
 
4
-## update your youtube-dl ##
4
+## Update your youtube-dl ! ##
5 5
 # "youtube-dl -U" 
6 6
 ## or 
7 7
 # pip install --upgrade youtube-dl
... ...
@@ -9,20 +9,20 @@
9 9
 
10 10
 ## Variables ##
11 11
 
12
-## save all your Youtube playlists in $favdir ##
12
+## Save all your Youtube playlists in favdir ##
13 13
 favdir="bestof"
14
-## firefox running ?
14
+## Firefox running ?
15 15
 ffon=0; ps -ef|grep firefox|grep -v grep && ffon=1
16 16
 ## Download folder ##
17 17
 dl_folder="/home/foo/Downloads/youtube-dl/"
18 18
 ## Date= yesterday ##
19 19
 datum=$(date -d "1 day ago" '+%Y%m%d')
20
-## Videos per day on each playlist##
20
+## Max. videos / datum to each playlist ##
21 21
 perday=4
22 22
 ## if aria2 is installed example : ##
23 23
 # aria2='--external-downloader aria2c  --external-downloader-args "-j 8 -s 8 -x 8 -k 5M"'
24 24
 aria2=''
25
-## load from database or array
25
+## load from "database" or "array".
26 26
 loadfrom=database
27 27
 ## firefox database
28 28
 sqltdata=places.sqlite
... ...
@@ -37,7 +37,7 @@ cp $sqltdata places2.sqlite
37 37
 sqltdata=places2.sqlite
38 38
 fi
39 39
 
40
-## only edit dbarray content if you want to use it
40
+## only edit dbarray test-content if you want to use it
41 41
 
42 42
 if [ $loadfrom == array ]
43 43
 then
... ...
@@ -51,8 +51,8 @@ then
51 51
 ##
52 52
  
53 53
 else
54
- ## This line puts FF favourites from sqlite3 to an array ##
55
- ## Only if 2.) Next line edit "places" to "places2"
54
+ ## This line puts FF bookmarks from sqlite3 to an array ##
55
+
56 56
  dbarray=( $(sqlite3 -list $sqltdata 'select url from moz_places where id in (select fk from moz_bookmarks where parent in ( select "id" from moz_bookmarks where title == "'$favdir'"))'; ))
57 57
 fi
58 58
 cd  $dl_folder || exit
Browse code

firefox auto detect and sqlite management

dewomser authored on30/10/2018 21:16:42
Showing1 changed files
... ...
@@ -1,46 +1,41 @@
1 1
 #!/bin/bash
2 2
 ## This Shellscript downloads all fresh videos from afirefox favorite folder. ##
3 3
 
4
-## Config ##
5
-
6
-## update youtube-dl ##
7
-## "youtube-dl -U" or "pip youtube-dl install" ##
4
+## update your youtube-dl ##
5
+# "youtube-dl -U" 
6
+## or 
8 7
 # pip install --upgrade youtube-dl
9 8
 # sleep 3
10 9
 
11
-## If Firefox is already running AND Sqlite bookmarks are used, this script will not do without action: ##
12
-## Firefox manages bookmarks from a locked database.
13
-
14
-## 1.) All Firefox instances must be killed. Manualy or uncomment next Line
15
-# killall -9 firefox; sleep 3
16
-## OR
17
-## 2.) copy database and query there. Uncomment line 22 ; read line 60  
18
-
19
-## from Firefox bookmarks ##
20
-## change *default* if you have other profiles than default. ##
21
-cd ~/.mozilla/firefox/*default* || exit
22
-# cp places.sqlite places2.sqlite
23
-
24 10
 ## Variables ##
25 11
 
26 12
 ## save all your Youtube playlists in $favdir ##
27 13
 favdir="bestof"
14
+## firefox running ?
15
+ffon=0; ps -ef|grep firefox|grep -v grep && ffon=1
28 16
 ## Download folder ##
29 17
 dl_folder="/home/foo/Downloads/youtube-dl/"
30 18
 ## Date= yesterday ##
31 19
 datum=$(date -d "1 day ago" '+%Y%m%d')
32
-## Videos per day in each playlist##
20
+## Videos per day on each playlist##
33 21
 perday=4
34 22
 ## if aria2 is installed example : ##
35 23
 # aria2='--external-downloader aria2c  --external-downloader-args "-j 8 -s 8 -x 8 -k 5M"'
36 24
 aria2=''
37 25
 ## load from database or array
38 26
 loadfrom=database
27
+## firefox database
28
+sqltdata=places.sqlite
39 29
 
40 30
 ## Start ##
41 31
 
42
-# echo $favdir
43
-# echo  $dl_folder
32
+cd ~/.mozilla/firefox/*default* || exit
33
+
34
+if (( ffon == 1 && loadfrom == database ))
35
+then
36
+cp $sqltdata places2.sqlite
37
+sqltdata=places2.sqlite
38
+fi
44 39
 
45 40
 ## only edit dbarray content if you want to use it
46 41
 
... ...
@@ -56,13 +51,14 @@ then
56 51
 ##
57 52
  
58 53
 else
59
- ## this line puts FF favourites from sqlite3 to an array ##
60
- ## edit "places" to "places2 in next line"
61
- 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'"))'; ))
54
+ ## This line puts FF favourites from sqlite3 to an array ##
55
+ ## Only if 2.) Next line edit "places" to "places2"
56
+ dbarray=( $(sqlite3 -list $sqltdata 'select url from moz_places where id in (select fk from moz_bookmarks where parent in ( select "id" from moz_bookmarks where title == "'$favdir'"))'; ))
62 57
 fi
63 58
 cd  $dl_folder || exit
64
-## let youtube-dl do the work  and download brandnew videos##
65
-# 
59
+
60
+## Let youtube-dl do the work  and download brandnew videos ##
61
+
66 62
 for i in "${dbarray[@]}"; do
67 63
 youtube-dl $aria2 --dateafter "$datum" --playlist-end "$perday" --max-downloads "$perday" "$i"
68 64
 # echo $i
Browse code

if firefox is already started …

dewomser authored on30/10/2018 18:27:50
Showing1 changed files
... ...
@@ -8,14 +8,18 @@
8 8
 # pip install --upgrade youtube-dl
9 9
 # sleep 3
10 10
 
11
-## Firefox manages bookmarks from database. ##
12
-## All firefox instances must be killed.
13
-## Reason is: Error: database is locked
14
-killall -9 firefox; sleep 3
11
+## If Firefox is already running AND Sqlite bookmarks are used, this script will not do without action: ##
12
+## Firefox manages bookmarks from a locked database.
13
+
14
+## 1.) All Firefox instances must be killed. Manualy or uncomment next Line
15
+# killall -9 firefox; sleep 3
16
+## OR
17
+## 2.) copy database and query there. Uncomment line 22 ; read line 60  
15 18
 
16 19
 ## from Firefox bookmarks ##
17 20
 ## change *default* if you have other profiles than default. ##
18 21
 cd ~/.mozilla/firefox/*default* || exit
22
+# cp places.sqlite places2.sqlite
19 23
 
20 24
 ## Variables ##
21 25
 
... ...
@@ -33,7 +37,7 @@ aria2=''
33 37
 ## load from database or array
34 38
 loadfrom=database
35 39
 
36
-## Start 
40
+## Start ##
37 41
 
38 42
 # echo $favdir
39 43
 # echo  $dl_folder
... ...
@@ -53,6 +57,7 @@ then
53 57
  
54 58
 else
55 59
  ## this line puts FF favourites from sqlite3 to an array ##
60
+ ## edit "places" to "places2 in next line"
56 61
  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'"))'; ))
57 62
 fi
58 63
 cd  $dl_folder || exit
Browse code

change source by variable: array or db

dewomser authored on30/10/2018 09:27:15
Showing1 changed files
... ...
@@ -1,25 +1,28 @@
1 1
 #!/bin/bash
2 2
 ## This Shellscript downloads all fresh videos from afirefox favorite folder. ##
3 3
 
4
+## Config ##
5
+
4 6
 ## update youtube-dl ##
5 7
 ## "youtube-dl -U" or "pip youtube-dl install" ##
6 8
 # pip install --upgrade youtube-dl
7
-# sleep 5
9
+# sleep 3
8 10
 
9
-## Variables ##
10 11
 ## Firefox manages bookmarks from database. ##
12
+## All firefox instances must be killed.
13
+## Reason is: Error: database is locked
14
+killall -9 firefox; sleep 3
11 15
 
12
-# All firefox intances must be killed.
13
-# Reason is: Error: database is locked
16
+## from Firefox bookmarks ##
17
+## change *default* if you have other profiles than default. ##
18
+cd ~/.mozilla/firefox/*default* || exit
14 19
 
15
-killall -9 firefox; sleep 3
20
+## Variables ##
16 21
 
17
-# #save all your Youtube playlists in $favdir ##
22
+## save all your Youtube playlists in $favdir ##
18 23
 favdir="bestof"
19
-echo $favdir
20 24
 ## Download folder ##
21 25
 dl_folder="/home/foo/Downloads/youtube-dl/"
22
-echo  $dl_folder
23 26
 ## Date= yesterday ##
24 27
 datum=$(date -d "1 day ago" '+%Y%m%d')
25 28
 ## Videos per day in each playlist##
... ...
@@ -27,26 +30,31 @@ perday=4
27 30
 ## if aria2 is installed example : ##
28 31
 # aria2='--external-downloader aria2c  --external-downloader-args "-j 8 -s 8 -x 8 -k 5M"'
29 32
 aria2=''
33
+## load from database or array
34
+loadfrom=database
30 35
 
31
-## from Firefox bookmarks ##
32
-## change *default* if you have other profiles than default. ##
33
-## comment if you load from array ##
34
-cd ~/.mozilla/firefox/*default* || exit
36
+## Start 
35 37
 
36
-## uncomment if you  load from an array ##
37
-## No Firefox no variables needed ##
38
-# dl_folder="~/Downloads"
39
-# perday=4
40
-# dbarray=(
41
-# "https://www.youtube.com/user/example-foo"
42
-# "https://www.youtube.com/channel/example-bar/videos?sort=dd&shelf_id=0&view=0"
43
-# )
38
+# echo $favdir
39
+# echo  $dl_folder
44 40
 
45
-## comment this if you load from array ##
46
-## this line puts FF favourites from sqlite3 to an array ##
47
-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'"))'; ))
41
+## only edit dbarray content if you want to use it
48 42
 
49
-## this  must not be commented ##
43
+if [ $loadfrom == array ]
44
+then
45
+ dbarray=(
46
+ "https://www.youtube.com/user/GalileoOffiziell/videos"
47
+ "https://www.youtube.com/user/BibisBeautyPalace/videos?sort=dd&shelf_id=1&view=0"
48
+ "https://www.youtube.com/channel/UC53bIpnef1pwAx69ERmmOLA"
49
+ )
50
+##
51
+##--------------------Do not edit below this line ! -----------------------
52
+##
53
+ 
54
+else
55
+ ## this line puts FF favourites from sqlite3 to an array ##
56
+ 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'"))'; ))
57
+fi
50 58
 cd  $dl_folder || exit
51 59
 ## let youtube-dl do the work  and download brandnew videos##
52 60
 # 
... ...
@@ -55,5 +63,5 @@ youtube-dl $aria2 --dateafter "$datum" --playlist-end "$perday" --max-downloads
55 63
 # echo $i
56 64
 done
57 65
 
58
-## optional ###
66
+## optional ##
59 67
 #dolphin $dl_folder
Browse code

kill firefox

dewomser authored on30/10/2018 07:57:01
Showing1 changed files
... ...
@@ -8,6 +8,12 @@
8 8
 
9 9
 ## Variables ##
10 10
 ## Firefox manages bookmarks from database. ##
11
+
12
+# All firefox intances must be killed.
13
+# Reason is: Error: database is locked
14
+
15
+killall -9 firefox; sleep 3
16
+
11 17
 # #save all your Youtube playlists in $favdir ##
12 18
 favdir="bestof"
13 19
 echo $favdir
Browse code

das ist ei test mit git-cola

dewomser authored on24/05/2018 07:45:54
Showing1 changed files
... ...
@@ -49,5 +49,5 @@ youtube-dl $aria2 --dateafter "$datum" --playlist-end "$perday" --max-downloads
49 49
 # echo $i
50 50
 done
51 51
 
52
-## optional ##
52
+## optional ###
53 53
 #dolphin $dl_folder
Browse code

aria2 disabled

dewomser authored on23/05/2018 19:08:52
Showing1 changed files
... ...
@@ -23,7 +23,6 @@ perday=4
23 23
 aria2=''
24 24
 
25 25
 ## from Firefox bookmarks ##
26
-## switch to the default firefox folder with sqlite databases. ##
27 26
 ## change *default* if you have other profiles than default. ##
28 27
 ## comment if you load from array ##
29 28
 cd ~/.mozilla/firefox/*default* || exit
... ...
@@ -46,7 +45,7 @@ cd  $dl_folder || exit
46 45
 ## let youtube-dl do the work  and download brandnew videos##
47 46
 # 
48 47
 for i in "${dbarray[@]}"; do
49
-youtube-dl "$aria2" --dateafter "$datum" --playlist-end "$perday" --max-downloads "$perday" "$i"
48
+youtube-dl $aria2 --dateafter "$datum" --playlist-end "$perday" --max-downloads "$perday" "$i"
50 49
 # echo $i
51 50
 done
52 51
 
Browse code

small things getting better

dewomser authored on22/05/2018 08:52:55
Showing1 changed files
... ...
@@ -1,50 +1,47 @@
1 1
 #!/bin/bash
2
-#
3
-# This Shellscript downloads all fresh videos from afirefox favorite folder.
4
-# sqlite3 and youtube-dl must  be installed
5
-# 
6
-#update youtube-dl
7
-# "youtube-dl -U" or "pip youtube-dl install"
2
+## This Shellscript downloads all fresh videos from afirefox favorite folder. ##
3
+
4
+## update youtube-dl ##
5
+## "youtube-dl -U" or "pip youtube-dl install" ##
8 6
 # pip install --upgrade youtube-dl
9 7
 # sleep 5
10 8
 
11
-# Variables #
12
-##firefox manages bookmarks from database. ##
13
-##save all your Youtube playlists in $favdir##
9
+## Variables ##
10
+## Firefox manages bookmarks from database. ##
11
+# #save all your Youtube playlists in $favdir ##
14 12
 favdir="bestof"
15 13
 echo $favdir
16
-##Download folder##
14
+## Download folder ##
17 15
 dl_folder="/home/foo/Downloads/youtube-dl/"
18 16
 echo  $dl_folder
19
-##Date= yesterday##
17
+## Date= yesterday ##
20 18
 datum=$(date -d "1 day ago" '+%Y%m%d')
21 19
 ## Videos per day in each playlist##
22 20
 perday=4
23
-##if aria2 is installed example :##
24
-#aria2='--external-downloader aria2c  --external-downloader-args "-j 8 -s 8 -x 8 -k 5M"'
21
+## if aria2 is installed example : ##
22
+# aria2='--external-downloader aria2c  --external-downloader-args "-j 8 -s 8 -x 8 -k 5M"'
25 23
 aria2=''
26 24
 
27
-## from Firefox bookmarks##
28
-## switch to the default firefox folder with sqlite databases.##
29
-## change *default* if you have other profiles than default.##
25
+## from Firefox bookmarks ##
26
+## switch to the default firefox folder with sqlite databases. ##
27
+## change *default* if you have other profiles than default. ##
28
+## comment if you load from array ##
30 29
 cd ~/.mozilla/firefox/*default* || exit
31 30
 
32
-##uncomment if you  load from an array##
33
-##No Firefox no variables needed##
34
-#dl_folder="~/Downloads"
35
-#perday=4
36
-#dbarray=(
37
-#"https://www.youtube.com/user/example-foo"
38
-#"https://www.youtube.com/channel/example-bar/videos?sort=dd&shelf_id=0&view=0"
39
-#)
31
+## uncomment if you  load from an array ##
32
+## No Firefox no variables needed ##
33
+# dl_folder="~/Downloads"
34
+# perday=4
35
+# dbarray=(
36
+# "https://www.youtube.com/user/example-foo"
37
+# "https://www.youtube.com/channel/example-bar/videos?sort=dd&shelf_id=0&view=0"
38
+# )
40 39
 
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##
40
+## comment this if you load from array ##
41
+## this line puts FF favourites from sqlite3 to an array ##
45 42
 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'"))'; ))
46 43
 
47
-##this  must not be commented##
44
+## this  must not be commented ##
48 45
 cd  $dl_folder || exit
49 46
 ## let youtube-dl do the work  and download brandnew videos##
50 47
 # 
... ...
@@ -53,4 +50,5 @@ youtube-dl "$aria2" --dateafter "$datum" --playlist-end "$perday" --max-download
53 50
 # echo $i
54 51
 done
55 52
 
53
+## optional ##
56 54
 #dolphin $dl_folder
Browse code

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

dewomser authored on22/05/2018 08:27:47
Showing1 changed files
... ...
@@ -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"
Browse code

minor improvements, aria2 extern Download tested , script is shellchecked now

dewomser authored on22/05/2018 08:00:10
Showing1 changed files
... ...
@@ -11,7 +11,7 @@
11 11
 # Variables #
12 12
 #firefox manages bookmarks from database. 
13 13
 #save all your Youtube playlists in $favdir
14
-favdir="gestof"
14
+favdir="bestof"
15 15
 echo $favdir
16 16
 #Download folder
17 17
 dl_folder="/home/foo/Downloads/youtube-dl/"
... ...
@@ -20,6 +20,8 @@ echo  $dl_folder
20 20
 datum=$(date -d "1 day ago" '+%Y%m%d')
21 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"
24
+aria2=''
23 25
 
24 26
 # from Firefox bookmarks
25 27
 # switch to the default firefox folder with sqlite databases.
... ...
@@ -46,7 +48,7 @@ cd  $dl_folder || exit
46 48
 # let youtube-dl do the work  and download brandnew videos
47 49
 # 
48 50
 for i in "${dbarray[@]}"; do
49
-youtube-dl --external-downloader aria2c  --external-downloader-args "-j 8 -s 8 -x 8 -k 5M" --dateafter "$datum" --playlist-end "$perday" --max-downloads "$perday" "$i"
51
+youtube-dl "$aria2" --dateafter "$datum" --playlist-end "$perday" --max-downloads "$perday" "$i"
50 52
 # echo $i
51 53
 done
52 54
 
Browse code

small improvements, aria2c build in , shellchecked

dewomser authored on22/05/2018 07:41:49
Showing1 changed files
... ...
@@ -1,34 +1,53 @@
1
-#! /bin/bash
2
-#This Bash-script should be executed every day (crontab -e) 
1
+#!/bin/bash
2
+#
3
+# This Shellscript downloads all fresh videos from afirefox favorite folder.
4
+# sqlite3 and youtube-dl must  be installed
5
+# 
6
+#update youtube-dl
7
+# "youtube-dl -U" or "pip youtube-dl install"
8
+# pip install --upgrade youtube-dl
9
+# sleep 5
3 10
 
4
-update youtube-dl
5
-youtube-dl -U
6
-sleep 5
7
-# fav dir
8
-# put in your favorite path
9
-favdir="auto-yt"
10
-#echo $favdir
11
+# Variables #
12
+#firefox manages bookmarks from database. 
13
+#save all your Youtube playlists in $favdir
14
+favdir="gestof"
15
+echo $favdir
16
+#Download folder
17
+dl_folder="/home/foo/Downloads/youtube-dl/"
18
+echo  $dl_folder
11 19
 #Date= yesterday
12 20
 datum=$(date -d "1 day ago" '+%Y%m%d')
21
+# Videos per day in each playlist
22
+perday=4
23
+
24
+# from Firefox bookmarks
25
+# switch to the default firefox folder with sqlite databases.
26
+# change *default* if you have other profiles than default.
27
+cd ~/.mozilla/firefox/*default* || exit
13 28
 
14
-# from array. No Firefox needed
29
+# uncomment if you  load from an array
30
+# No Firefox no variables needed 
31
+#dl_folder="~/Downloads"
32
+#perday=4
15 33
 #dbarray=(
16 34
 #"https://www.youtube.com/user/example-foo"
17 35
 #"https://www.youtube.com/channel/example-bar/videos?sort=dd&shelf_id=0&view=0"
18 36
 #)
19 37
 
20
-# from Firefox bookmarks
21
-#switch to the default firefox folder with sqlite databases.
22
-#change *default* if you have other profiles than default.
23
-cd ~/.mozilla/firefox/*default*
24
-
38
+#comment this if you load from array
25 39
 #firefox manages bookmarks from database. 
26
-#Firefox  bookmarks needs a folder auto-yt.
27
-#save all your Youtube playlists in auto-yt
40
+#Firefox  bookmarks needs a folder $favdir.
41
+#save all your Youtube playlists in $favdir
28 42
 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'"))'; ))
29
-#switch  to your youtube download folder
30
-cd ~/Downloads
31
-#let youtube-dl do the work  and download brandnew videos
32
-for i in ${dbarray[@]}; do
33
-youtube-dl --dateafter $datum --playlist-end 4 --max-downloads 2 $i
43
+
44
+#this  must not be commented
45
+cd  $dl_folder || exit
46
+# let youtube-dl do the work  and download brandnew videos
47
+# 
48
+for i in "${dbarray[@]}"; do
49
+youtube-dl --external-downloader aria2c  --external-downloader-args "-j 8 -s 8 -x 8 -k 5M" --dateafter "$datum" --playlist-end "$perday" --max-downloads "$perday" "$i"
50
+# echo $i
34 51
 done
52
+
53
+#dolphin $dl_folder
Browse code

test Umgebung entfernt

Stefan authored on22/10/2017 15:55:59
Showing1 changed files
... ...
@@ -1,13 +1,13 @@
1 1
 #! /bin/bash
2 2
 #This Bash-script should be executed every day (crontab -e) 
3 3
 
4
-#update youtube-dl
5
-#youtube-dl -U
6
-#sleep 5
4
+update youtube-dl
5
+youtube-dl -U
6
+sleep 5
7 7
 # fav dir
8 8
 # put in your favorite path
9 9
 favdir="auto-yt"
10
-echo $favdir
10
+#echo $favdir
11 11
 #Date= yesterday
12 12
 datum=$(date -d "1 day ago" '+%Y%m%d')
13 13
 
... ...
@@ -27,7 +27,6 @@ cd ~/.mozilla/firefox/*default*
27 27
 #save all your Youtube playlists in auto-yt
28 28
 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'"))'; ))
29 29
 #switch  to your youtube download folder
30
-echo $favdir
31 30
 cd ~/Downloads
32 31
 #let youtube-dl do the work  and download brandnew videos
33 32
 for i in ${dbarray[@]}; do
Browse code

Favoriten als Variable

Der Pfad muß zu Beginn vom User als Variable gesetzt werden

Stefan authored on22/10/2017 15:47:31
Showing1 changed files
1 1
old mode 100644
2 2
new mode 100755
... ...
@@ -2,9 +2,12 @@
2 2
 #This Bash-script should be executed every day (crontab -e) 
3 3
 
4 4
 #update youtube-dl
5
-youtube-dl -U
6
-sleep 5
7
-
5
+#youtube-dl -U
6
+#sleep 5
7
+# fav dir
8
+# put in your favorite path
9
+favdir="auto-yt"
10
+echo $favdir
8 11
 #Date= yesterday
9 12
 datum=$(date -d "1 day ago" '+%Y%m%d')
10 13
 
... ...
@@ -22,8 +25,9 @@ cd ~/.mozilla/firefox/*default*
22 25
 #firefox manages bookmarks from database. 
23 26
 #Firefox  bookmarks needs a folder auto-yt.
24 27
 #save all your Youtube playlists in auto-yt
25
-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  == "auto-yt"))'; ))
28
+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'"))'; ))
26 29
 #switch  to your youtube download folder
30
+echo $favdir
27 31
 cd ~/Downloads
28 32
 #let youtube-dl do the work  and download brandnew videos
29 33
 for i in ${dbarray[@]}; do
Browse code

There is an option only array

dewomser authored on31/01/2017 16:40:42
Showing1 changed files
... ...
@@ -1,14 +1,30 @@
1 1
 #! /bin/bash
2
+#This Bash-script should be executed every day (crontab -e) 
2 3
 
3
-#should be executed every day (crontab -e) 
4
+#update youtube-dl
5
+youtube-dl -U
6
+sleep 5
7
+
8
+#Date= yesterday
4 9
 datum=$(date -d "1 day ago" '+%Y%m%d')
5
-#switch to the default firefox folder with sqlite databases
10
+
11
+# from array. No Firefox needed
12
+#dbarray=(
13
+#"https://www.youtube.com/user/example-foo"
14
+#"https://www.youtube.com/channel/example-bar/videos?sort=dd&shelf_id=0&view=0"
15
+#)
16
+
17
+# from Firefox bookmarks
18
+#switch to the default firefox folder with sqlite databases.
19
+#change *default* if you have other profiles than default.
6 20
 cd ~/.mozilla/firefox/*default*
7
-#firefox manages bookmarks in a database. Firefox  bookmarks needs a folder auto-yt.
8
-#save  playlists in this directory
21
+
22
+#firefox manages bookmarks from database. 
23
+#Firefox  bookmarks needs a folder auto-yt.
24
+#save all your Youtube playlists in auto-yt
9 25
 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  == "auto-yt"))'; ))
10
-#switch  home
11
-cd
26
+#switch  to your youtube download folder
27
+cd ~/Downloads
12 28
 #let youtube-dl do the work  and download brandnew videos
13 29
 for i in ${dbarray[@]}; do
14 30
 youtube-dl --dateafter $datum --playlist-end 4 --max-downloads 2 $i
Browse code

Update youtube-dl.sh

Stefan Höhn authored on26/12/2016 00:07:46 • GitHub committed on26/12/2016 00:07:46
Showing1 changed files
... ...
@@ -2,9 +2,9 @@
2 2
 
3 3
 #should be executed every day (crontab -e) 
4 4
 datum=$(date -d "1 day ago" '+%Y%m%d')
5
-#switch to the default firefox dir with sqlite databases
5
+#switch to the default firefox folder with sqlite databases
6 6
 cd ~/.mozilla/firefox/*default*
7
-# firefox manage bookmarks in a database. Firefox  bookmarks needs a directory auto-yt.
7
+#firefox manages bookmarks in a database. Firefox  bookmarks needs a folder auto-yt.
8 8
 #save  playlists in this directory
9 9
 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_bookma