youtube subs changes

This commit is contained in:
inigoortega 2020-04-11 18:49:45 +02:00
parent 358191d985
commit 21315328f6
2 changed files with 8 additions and 4 deletions

View File

@ -6,7 +6,7 @@ cleanup() {
trap cleanup INT TERM
usage() {
echo "Usage: $0 [-f <file>] [-u] [-h]" 1>&2
echo "Usage: $0 [-f <file>] [-u] [-h] [-p]" 1>&2
echo "" 1>&2
printf \
"\tThis program manages your subscriptions with the given file with -f or\n" 1>&2
@ -16,10 +16,11 @@ usage() {
printf \
"\t-e To play the videos when at the end instead of progressivaly\n" 1>&2
printf "\t-h Show this help text\n" 1>&2
printf "\t-p Preserve old wlvfs_videos file.\n" 1>&2
exit 1
}
while getopts ":uef:" option; do
while getopts ":upef:" option; do
case "${option}" in
u)
update_now="1"
@ -30,6 +31,9 @@ while getopts ":uef:" option; do
f)
subs_file="${OPTARG}"
;;
p)
preserve_oldvideos="1"
;;
*)
usage
;;
@ -137,7 +141,7 @@ fi
# Processing
rm $videos_file 2> /dev/null
[ -z "$preserve_oldvideos" ] && rm "$videos_file" 2> /dev/null
grep -vE '^#|^$|^!' "$subs_file" | sort -rg -k 6 -k 5 -k 4 | while read line; do
channel=$(echo "$line" | awk '{print $1}')

View File

@ -5,7 +5,7 @@ last_watched_video="$2"
[ -n "$3" ] && dateafter="--dateafter $3"
dash $TSCRIPTS/no-response-timeout.sh -f 128 -r 5 \
dash $TSCRIPTS/no-response-timeout.sh -f 128 -r 10 \
youtube-dl --get-id "$channel" $dateafter 2>/dev/null |
while read -r line && [ "$line" != "$last_watched_video" ]; do
echo "$line"