mirror of
https://github.com/The-Repo-Club/DotFiles.git
synced 2024-11-25 00:38:20 -05:00
Update
This commit is contained in:
parent
02383287bf
commit
63fa469e25
@ -197,7 +197,7 @@
|
||||
0E029022AF4C18835CBDCC7EF5001BC3\%7B5B1E2E81-ED4F-4F79-9EB5-F8ACA67D1BF0%7D\0\Lighting\Keys\y=#ffffff
|
||||
0E029022AF4C18835CBDCC7EF5001BC3\%7B5B1E2E81-ED4F-4F79-9EB5-F8ACA67D1BF0%7D\0\Lighting\Keys\z=#ffffff
|
||||
0E029022AF4C18835CBDCC7EF5001BC3\%7B5B1E2E81-ED4F-4F79-9EB5-F8ACA67D1BF0%7D\0\Lighting\UseRealNames=true
|
||||
0E029022AF4C18835CBDCC7EF5001BC3\%7B5B1E2E81-ED4F-4F79-9EB5-F8ACA67D1BF0%7D\0\Modified=4364c31b
|
||||
0E029022AF4C18835CBDCC7EF5001BC3\%7B5B1E2E81-ED4F-4F79-9EB5-F8ACA67D1BF0%7D\0\Modified=3508de03
|
||||
0E029022AF4C18835CBDCC7EF5001BC3\%7B5B1E2E81-ED4F-4F79-9EB5-F8ACA67D1BF0%7D\0\Name=Rainbow
|
||||
0E029022AF4C18835CBDCC7EF5001BC3\%7B5B1E2E81-ED4F-4F79-9EB5-F8ACA67D1BF0%7D\0\Performance\AngleSnap=false
|
||||
0E029022AF4C18835CBDCC7EF5001BC3\%7B5B1E2E81-ED4F-4F79-9EB5-F8ACA67D1BF0%7D\0\Performance\DPI\0=@Point(400 400)
|
||||
@ -425,7 +425,7 @@
|
||||
0E029022AF4C18835CBDCC7EF5001BC3\%7B5B1E2E81-ED4F-4F79-9EB5-F8ACA67D1BF0%7D\1\Lighting\Keys\y=#ff0000
|
||||
0E029022AF4C18835CBDCC7EF5001BC3\%7B5B1E2E81-ED4F-4F79-9EB5-F8ACA67D1BF0%7D\1\Lighting\Keys\z=#ff0000
|
||||
0E029022AF4C18835CBDCC7EF5001BC3\%7B5B1E2E81-ED4F-4F79-9EB5-F8ACA67D1BF0%7D\1\Lighting\UseRealNames=true
|
||||
0E029022AF4C18835CBDCC7EF5001BC3\%7B5B1E2E81-ED4F-4F79-9EB5-F8ACA67D1BF0%7D\1\Modified=a0be9872
|
||||
0E029022AF4C18835CBDCC7EF5001BC3\%7B5B1E2E81-ED4F-4F79-9EB5-F8ACA67D1BF0%7D\1\Modified=57083d7b
|
||||
0E029022AF4C18835CBDCC7EF5001BC3\%7B5B1E2E81-ED4F-4F79-9EB5-F8ACA67D1BF0%7D\1\Name=Breathing
|
||||
0E029022AF4C18835CBDCC7EF5001BC3\%7B5B1E2E81-ED4F-4F79-9EB5-F8ACA67D1BF0%7D\1\Performance\AngleSnap=false
|
||||
0E029022AF4C18835CBDCC7EF5001BC3\%7B5B1E2E81-ED4F-4F79-9EB5-F8ACA67D1BF0%7D\1\Performance\DPI\0=@Point(400 400)
|
||||
@ -675,7 +675,7 @@
|
||||
0E029022AF4C18835CBDCC7EF5001BC3\%7B5B1E2E81-ED4F-4F79-9EB5-F8ACA67D1BF0%7D\2\Lighting\Keys\y=#aa00ff
|
||||
0E029022AF4C18835CBDCC7EF5001BC3\%7B5B1E2E81-ED4F-4F79-9EB5-F8ACA67D1BF0%7D\2\Lighting\Keys\z=#aa00ff
|
||||
0E029022AF4C18835CBDCC7EF5001BC3\%7B5B1E2E81-ED4F-4F79-9EB5-F8ACA67D1BF0%7D\2\Lighting\UseRealNames=true
|
||||
0E029022AF4C18835CBDCC7EF5001BC3\%7B5B1E2E81-ED4F-4F79-9EB5-F8ACA67D1BF0%7D\2\Modified=c1cb8216
|
||||
0E029022AF4C18835CBDCC7EF5001BC3\%7B5B1E2E81-ED4F-4F79-9EB5-F8ACA67D1BF0%7D\2\Modified=7ecd7df4
|
||||
0E029022AF4C18835CBDCC7EF5001BC3\%7B5B1E2E81-ED4F-4F79-9EB5-F8ACA67D1BF0%7D\2\Name=Trippy
|
||||
0E029022AF4C18835CBDCC7EF5001BC3\%7B5B1E2E81-ED4F-4F79-9EB5-F8ACA67D1BF0%7D\2\Performance\AngleSnap=false
|
||||
0E029022AF4C18835CBDCC7EF5001BC3\%7B5B1E2E81-ED4F-4F79-9EB5-F8ACA67D1BF0%7D\2\Performance\DPI\0=@Point(400 400)
|
||||
@ -733,7 +733,7 @@
|
||||
0E029022AF4C18835CBDCC7EF5001BC3\%7B5B1E2E81-ED4F-4F79-9EB5-F8ACA67D1BF0%7D\CurrentMode={51EB6E3A-27A0-4AD6-A35C-6B67E0329A3D}
|
||||
0E029022AF4C18835CBDCC7EF5001BC3\%7B5B1E2E81-ED4F-4F79-9EB5-F8ACA67D1BF0%7D\HwModified=7ffd
|
||||
0E029022AF4C18835CBDCC7EF5001BC3\%7B5B1E2E81-ED4F-4F79-9EB5-F8ACA67D1BF0%7D\ModeCount=3
|
||||
0E029022AF4C18835CBDCC7EF5001BC3\%7B5B1E2E81-ED4F-4F79-9EB5-F8ACA67D1BF0%7D\Modified=1975e830
|
||||
0E029022AF4C18835CBDCC7EF5001BC3\%7B5B1E2E81-ED4F-4F79-9EB5-F8ACA67D1BF0%7D\Modified=9777d5f0
|
||||
0E029022AF4C18835CBDCC7EF5001BC3\%7B5B1E2E81-ED4F-4F79-9EB5-F8ACA67D1BF0%7D\Name=Multi
|
||||
0E029022AF4C18835CBDCC7EF5001BC3\%7BBA7FC152-2D51-4C26-A7A6-A036CC93D924%7D\0\Binding\KeyMap=K68 GB
|
||||
0E029022AF4C18835CBDCC7EF5001BC3\%7BBA7FC152-2D51-4C26-A7A6-A036CC93D924%7D\0\Binding\UseRealNames=true
|
||||
@ -929,7 +929,7 @@
|
||||
0E029022AF4C18835CBDCC7EF5001BC3\%7BBA7FC152-2D51-4C26-A7A6-A036CC93D924%7D\0\Lighting\Keys\y=#ffffff
|
||||
0E029022AF4C18835CBDCC7EF5001BC3\%7BBA7FC152-2D51-4C26-A7A6-A036CC93D924%7D\0\Lighting\Keys\z=#ffffff
|
||||
0E029022AF4C18835CBDCC7EF5001BC3\%7BBA7FC152-2D51-4C26-A7A6-A036CC93D924%7D\0\Lighting\UseRealNames=true
|
||||
0E029022AF4C18835CBDCC7EF5001BC3\%7BBA7FC152-2D51-4C26-A7A6-A036CC93D924%7D\0\Modified=442a1fae
|
||||
0E029022AF4C18835CBDCC7EF5001BC3\%7BBA7FC152-2D51-4C26-A7A6-A036CC93D924%7D\0\Modified=ec072167
|
||||
0E029022AF4C18835CBDCC7EF5001BC3\%7BBA7FC152-2D51-4C26-A7A6-A036CC93D924%7D\0\Name=Rainbow
|
||||
0E029022AF4C18835CBDCC7EF5001BC3\%7BBA7FC152-2D51-4C26-A7A6-A036CC93D924%7D\0\Performance\AngleSnap=false
|
||||
0E029022AF4C18835CBDCC7EF5001BC3\%7BBA7FC152-2D51-4C26-A7A6-A036CC93D924%7D\0\Performance\DPI\0=@Point(400 400)
|
||||
@ -1157,7 +1157,7 @@
|
||||
0E029022AF4C18835CBDCC7EF5001BC3\%7BBA7FC152-2D51-4C26-A7A6-A036CC93D924%7D\1\Lighting\Keys\y=#ff0000
|
||||
0E029022AF4C18835CBDCC7EF5001BC3\%7BBA7FC152-2D51-4C26-A7A6-A036CC93D924%7D\1\Lighting\Keys\z=#ff0000
|
||||
0E029022AF4C18835CBDCC7EF5001BC3\%7BBA7FC152-2D51-4C26-A7A6-A036CC93D924%7D\1\Lighting\UseRealNames=true
|
||||
0E029022AF4C18835CBDCC7EF5001BC3\%7BBA7FC152-2D51-4C26-A7A6-A036CC93D924%7D\1\Modified=cdb0408f
|
||||
0E029022AF4C18835CBDCC7EF5001BC3\%7BBA7FC152-2D51-4C26-A7A6-A036CC93D924%7D\1\Modified=3104239e
|
||||
0E029022AF4C18835CBDCC7EF5001BC3\%7BBA7FC152-2D51-4C26-A7A6-A036CC93D924%7D\1\Name=Breathing
|
||||
0E029022AF4C18835CBDCC7EF5001BC3\%7BBA7FC152-2D51-4C26-A7A6-A036CC93D924%7D\1\Performance\AngleSnap=false
|
||||
0E029022AF4C18835CBDCC7EF5001BC3\%7BBA7FC152-2D51-4C26-A7A6-A036CC93D924%7D\1\Performance\DPI\0=@Point(400 400)
|
||||
@ -1407,7 +1407,7 @@
|
||||
0E029022AF4C18835CBDCC7EF5001BC3\%7BBA7FC152-2D51-4C26-A7A6-A036CC93D924%7D\2\Lighting\Keys\y=#aa00ff
|
||||
0E029022AF4C18835CBDCC7EF5001BC3\%7BBA7FC152-2D51-4C26-A7A6-A036CC93D924%7D\2\Lighting\Keys\z=#aa00ff
|
||||
0E029022AF4C18835CBDCC7EF5001BC3\%7BBA7FC152-2D51-4C26-A7A6-A036CC93D924%7D\2\Lighting\UseRealNames=true
|
||||
0E029022AF4C18835CBDCC7EF5001BC3\%7BBA7FC152-2D51-4C26-A7A6-A036CC93D924%7D\2\Modified=f70d32f9
|
||||
0E029022AF4C18835CBDCC7EF5001BC3\%7BBA7FC152-2D51-4C26-A7A6-A036CC93D924%7D\2\Modified=b1ce4fea
|
||||
0E029022AF4C18835CBDCC7EF5001BC3\%7BBA7FC152-2D51-4C26-A7A6-A036CC93D924%7D\2\Name=Trippy
|
||||
0E029022AF4C18835CBDCC7EF5001BC3\%7BBA7FC152-2D51-4C26-A7A6-A036CC93D924%7D\2\Performance\AngleSnap=false
|
||||
0E029022AF4C18835CBDCC7EF5001BC3\%7BBA7FC152-2D51-4C26-A7A6-A036CC93D924%7D\2\Performance\DPI\0=@Point(400 400)
|
||||
@ -1465,7 +1465,7 @@
|
||||
0E029022AF4C18835CBDCC7EF5001BC3\%7BBA7FC152-2D51-4C26-A7A6-A036CC93D924%7D\CurrentMode={11C11AE3-3195-4DFC-B8AC-2FEA703414E5}
|
||||
0E029022AF4C18835CBDCC7EF5001BC3\%7BBA7FC152-2D51-4C26-A7A6-A036CC93D924%7D\HwModified=40b6f054
|
||||
0E029022AF4C18835CBDCC7EF5001BC3\%7BBA7FC152-2D51-4C26-A7A6-A036CC93D924%7D\ModeCount=3
|
||||
0E029022AF4C18835CBDCC7EF5001BC3\%7BBA7FC152-2D51-4C26-A7A6-A036CC93D924%7D\Modified=1b741e2a
|
||||
0E029022AF4C18835CBDCC7EF5001BC3\%7BBA7FC152-2D51-4C26-A7A6-A036CC93D924%7D\Modified=79fc734f
|
||||
0E029022AF4C18835CBDCC7EF5001BC3\%7BBA7FC152-2D51-4C26-A7A6-A036CC93D924%7D\Name=Demo
|
||||
|
||||
[Popups]
|
||||
|
Binary file not shown.
BIN
fzf/.config/fzf/fzf-desktop.db
Normal file
BIN
fzf/.config/fzf/fzf-desktop.db
Normal file
Binary file not shown.
39
fzf/.config/fzf/subs.ini
Normal file
39
fzf/.config/fzf/subs.ini
Normal file
@ -0,0 +1,39 @@
|
||||
# Linux
|
||||
UCVls1GmFKf6WlTraIb_IaJg # DistroTube
|
||||
UC2eYFnH61tmytImy1mTYvhA # Luke Smith
|
||||
UCld68syR8Wi-GY_n4CaoJGA # Brodie Robertson
|
||||
UCg6gPGh8HU2U01vaFCAsvmQ # Chris Titus Tech
|
||||
UCCIHOP7e271SIumQgyl6XBQ # OldTechBloke
|
||||
UCJdmdUp5BrsWsYVQUylCMLg # Erik Dubois
|
||||
UCdGFLV7h9RGeTUX7wa5rqGw # Manjaro Linux
|
||||
UCoryWpk4QVYKFCJul9KBdyw # Switched to Linux
|
||||
UC5UAwBUum7CPN5buc-_N1Fw # The Linux Experiment
|
||||
UCX_WM2O-X96URC5n66G-hvw # EF Linux
|
||||
UCZiL6BoryLWxyapUuVYW27g # Average Linux User
|
||||
UCylGUf9BvQooEFjgdNudoQg # The Linux Cast
|
||||
UC8ENHE5xdFSwx71u3fDH5Xw # ThePrimeagen
|
||||
UCRE3NFNtdjR96-H4QG4U1Fg # HexDSL
|
||||
# UCfp-lNJy4QkIGnaEE6NtDSg # Terminal For Life
|
||||
UCmw-QGOHbHA5cDAvwwqUTKQ # Zaney
|
||||
|
||||
#Minecraft
|
||||
UChFur_NwVSbUozOcF_F2kMg # MumboJumbo
|
||||
UC_GQ4mac4oN3wl1UdbFuTEA # ibxToyCat
|
||||
UCRlEFn0L2G_DktbyvN0AZ5A # WadZee
|
||||
UC9mvRrl9o7rG65ABsGVvDBw # Mysticat
|
||||
UCuMJPFqazQI4SofSFEd-5zA # impulseSV
|
||||
|
||||
#Spirit
|
||||
UC_8fJz5gAnhRqZ740QXlzmw # Jen McCarty
|
||||
UCAk3t7WHs2zjsZpopox8Taw # Jonna Jinton
|
||||
|
||||
#Meditations
|
||||
UCUSzc8BHGJPaYt0DjvscIzw # Woke Nation
|
||||
UCM7XCXnxtYJkkMN0zf0tsSw # Meditation And Healing
|
||||
|
||||
#Music
|
||||
UCMvETSFFkMOADyrGBj3gbWA # NerdOut
|
||||
UCXBcDYUr89ImtOLYaHPiiPg # Marcus Veltri
|
||||
|
||||
# Myself
|
||||
UCuKJ0LqxI8t2a9ATl1rWBGA # Myself
|
269
fzf/.local/bin/fzf/fzf_youtube_subs
Executable file
269
fzf/.local/bin/fzf/fzf_youtube_subs
Executable file
@ -0,0 +1,269 @@
|
||||
#!/usr/bin/env bash
|
||||
#-*-coding:utf-8 -*-
|
||||
#Auto updated?
|
||||
# Yes
|
||||
#File:
|
||||
# fzf_youtube_subs
|
||||
#Author:
|
||||
# The-Repo-Club [wayne6324@gmail.com]
|
||||
#Github:
|
||||
# https://github.com/The-Repo-Club/
|
||||
#
|
||||
#Created:
|
||||
# Sun 03 January 2021, 05:09:33 PM [GMT]
|
||||
#Modified:
|
||||
# Thu 20 October 2022, 03:27:18 PM [GMT+1]
|
||||
#
|
||||
#Description:
|
||||
# Watch your youtube subscriptions without a youtube account
|
||||
# via curl, fzf, browser and basic unix commands.
|
||||
#
|
||||
# The $SUBS_FILE is a text file containing usernames or channel IDs
|
||||
# comments and blank lines are ignored.
|
||||
#
|
||||
#
|
||||
#Dependencies:
|
||||
# fzf
|
||||
#
|
||||
|
||||
fzf_menu() {
|
||||
fzf --prompt="Select a video: " --border=rounded --margin=1% --color=dark --height 100% --reverse --header=" YOUTUBE SUBS MENU " --info=hidden --header-first
|
||||
}
|
||||
|
||||
# -/-/-/-/- Settings -/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/
|
||||
: "${SUBS_FILE:=${HOME}/.config/fzf/subs.ini}"
|
||||
: "${SUBS_MENU_PROG:=fzf_menu}"
|
||||
: "${SUBS:=${HOME}/.cache/subs}"
|
||||
: "${SUBS_LINKS:=$SUBS/links}"
|
||||
: "${SUBS_OPEN:=$(repo-exec videoplayer)}"
|
||||
: "${SUBS_CACHE:=$SUBS/cache}"
|
||||
: "${SUBS_SLEEP_VALUE:=0.05}" # raise this if you experience problems
|
||||
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
SEP=^^^^^ # shouldn't need to change this
|
||||
# -/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/
|
||||
|
||||
die() {
|
||||
printf >&2 '%s\n' "$*"
|
||||
exit 1
|
||||
}
|
||||
|
||||
usage() {
|
||||
die 'Usage: fzf_youtube_subs [-c cat_subs] [-g gen_links] [-u update_subs] [-d daemonize]'
|
||||
}
|
||||
|
||||
# -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
|
||||
# Synopsis: $SUBS_FILE [txt] -> $SUBS_LINKS [xml links]
|
||||
#
|
||||
# Updates local cache of xml subscription links from the
|
||||
# subscription file containing either usernames or channel ids.
|
||||
# -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
|
||||
gen_links() {
|
||||
: >"$SUBS_LINKS"
|
||||
|
||||
count=0
|
||||
total=$(sed -e '/^$/d' -e '/^#/d' <"$SUBS_FILE" | wc -l)
|
||||
|
||||
while read -r line; do
|
||||
|
||||
# ignore comments and blank lines
|
||||
case $line in '' | ' ' | '#'*) continue ;; esac
|
||||
|
||||
# strip off in-line comments and any trailing whitespace
|
||||
line=${line%%#*}
|
||||
line=${line%% *}
|
||||
|
||||
count=$((count + 1))
|
||||
|
||||
case $line in
|
||||
UC*)
|
||||
# YT channel IDs always begin with 'UC' and are 24 chars long
|
||||
printf "[%s/%s] using channel ID '%s' for xml link\n" "$count" "$total" "$line"
|
||||
|
||||
[ ${#line} -eq 24 ] &&
|
||||
printf 'https://youtube.com/feeds/videos.xml?%s\n' \
|
||||
"channel_id=$line" >>"$SUBS_LINKS"
|
||||
;;
|
||||
*)
|
||||
# otherwise we are given a username, we must find out its channel ID
|
||||
printf "fetching channel ID for %s...\n" "$line"
|
||||
|
||||
curl -sfL --retry 10 "https://youtube.com/user/$line/about" |
|
||||
while read -r line; do
|
||||
case $line in
|
||||
*channel/UC??????????????????????*)
|
||||
line=${line##*channel/}
|
||||
line=${line%%\"*}
|
||||
printf "[%s/%s] using channel ID '%s' for xml link\n" "$count" "$total" "$line"
|
||||
printf 'https://youtube.com/feeds/videos.xml?channel_id=%s\n' \
|
||||
"$line" >>"$SUBS_LINKS"
|
||||
break
|
||||
;;
|
||||
esac
|
||||
done &
|
||||
sleep "${SUBS_SLEEP_VALUE:-0}"
|
||||
;;
|
||||
esac
|
||||
|
||||
done <"$SUBS_FILE"
|
||||
|
||||
count=0
|
||||
while [ "$count" -ne "$total" ]; do
|
||||
count=$(wc -l <"$SUBS_LINKS")
|
||||
printf "[%s/%s] waiting for jobs to complete...\n" "$count" "$total"
|
||||
sleep 0.5
|
||||
done
|
||||
}
|
||||
|
||||
# -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
|
||||
# Synopsis: $1 [LINK] -> $SUBS_CACHE/$chan_name/concat [CHANNEL INFO]
|
||||
#
|
||||
# Takes a channel rss feed link and creates a file
|
||||
# with a line of its videos dates, titles, and urls.
|
||||
# -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
|
||||
get_vids() {
|
||||
data=$(curl -sfL --retry 15 "$1")
|
||||
|
||||
# hide the first <published> tag which is the channel
|
||||
# creation date
|
||||
data=${data#*\<\/published\>}
|
||||
|
||||
# trim off outer <name> tags
|
||||
chan=${data%%</name*}
|
||||
chan=${chan##*name>}
|
||||
|
||||
printf "%s\n" "$data" |
|
||||
while read -r line; do
|
||||
case $line in
|
||||
*'link rel='*)
|
||||
line=${line#*href=\"}
|
||||
line=${line%\"/\>}
|
||||
line=https://${line#*www.}
|
||||
url=$line
|
||||
;;
|
||||
*'<published>'*)
|
||||
line=${line%+00:*}
|
||||
line=${line#*<published>}
|
||||
date=$line
|
||||
;;
|
||||
*'<media:title>'*)
|
||||
line=${line%</*}
|
||||
line=${line#*:title>}
|
||||
title=$line
|
||||
printf '%s\n' \
|
||||
"${date}${SEP}${chan}${SEP}${title}${SEP}${url}" \
|
||||
>>"$SUBS_CACHE/$chan"
|
||||
;;
|
||||
esac
|
||||
done
|
||||
}
|
||||
|
||||
# -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
|
||||
# Updates the local cache of subscriptions. ([-u] flag)
|
||||
# -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
|
||||
update_subs() {
|
||||
[ -f "$SUBS_LINKS" ] || die 'Subs links have not been generated.'
|
||||
|
||||
rm -r "${SUBS_CACHE:-?}" 2>/dev/null || :
|
||||
mkdir -p "$SUBS_CACHE"
|
||||
|
||||
total=$(wc -l <"$SUBS_LINKS")
|
||||
|
||||
count=0
|
||||
while read -r link; do
|
||||
count=$((count + 1))
|
||||
printf 'starting job [%s/%s] for %s\n' "$count" "$total" "$link"
|
||||
get_vids "$link" &
|
||||
sleep "${SUBS_SLEEP_VALUE:-0}"
|
||||
done <"$SUBS_LINKS"
|
||||
|
||||
count=0
|
||||
while [ "$count" -ne "$total" ]; do
|
||||
count=$(printf '%s\n' "$SUBS_CACHE"/* | wc -l)
|
||||
printf "[%s/%s] waiting for fetch jobs to complete...\n" "$count" "$total"
|
||||
sleep 0.5
|
||||
done
|
||||
|
||||
printf '%s\n\n' 'done!'
|
||||
}
|
||||
|
||||
# -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
|
||||
# Grab current cache of subscriptions, sort by date uploaded
|
||||
# -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
|
||||
cat_subs() {
|
||||
sort -r "$SUBS_CACHE"/* |
|
||||
while read -r line; do
|
||||
chan=${line#*$SEP}
|
||||
chan=${chan%%$SEP*}
|
||||
title=${line#*$chan$SEP}
|
||||
title=${title%%$SEP*}
|
||||
date=${line%%$SEP*}
|
||||
date=${date#*-}
|
||||
date=${date%T*}
|
||||
printf '[%s %s] %s\n' "$date" "$chan" "$title"
|
||||
done
|
||||
}
|
||||
|
||||
# Split the concatenated lines into entities, send to menu program.
|
||||
# Finally, play the result with mpv.
|
||||
get_sel() {
|
||||
if [ -d "$SUBS_CACHE" ]; then
|
||||
sel=$(cat_subs | $SUBS_MENU_PROG)
|
||||
else
|
||||
die 'Subs cache has not been retrieved.'
|
||||
fi
|
||||
|
||||
[ "$sel" ] || die Interrupted
|
||||
|
||||
chan="${sel#* }"
|
||||
chan="${chan%%] *}"
|
||||
title=${sel#*"$chan"\] }
|
||||
while read -r line; do
|
||||
case $line in
|
||||
*"$SEP$title$SEP"*)
|
||||
url=${line##*$SEP}
|
||||
if [ "$url" ]; then
|
||||
printf 'playing: %s\n' "$url"
|
||||
# Play the selection.
|
||||
# shellcheck disable=2086
|
||||
exec devour $SUBS_OPEN "$url"
|
||||
fi
|
||||
break
|
||||
;;
|
||||
esac
|
||||
done <"$SUBS_CACHE/$chan"
|
||||
}
|
||||
|
||||
daemonize() {
|
||||
# create a cached copy of the subs file to check for changes
|
||||
# if changes occur, re-generate links automatically
|
||||
daemon_file=${HOME}/.cache/subs_daemon.cache
|
||||
if [ ! -f "$daemon_file" ]; then
|
||||
cp -f "${SUBS_FILE:=${HOME}/.config/fzf/subs.ini}" "$daemon_file"
|
||||
fi
|
||||
|
||||
while true; do
|
||||
if ! cmp "${SUBS_FILE:=${HOME}/.config/fzf/subs.ini}" "$daemon_file"; then
|
||||
cp -f "${SUBS_FILE:=${HOME}/.config/fzf/subs.ini}" "$daemon_file"
|
||||
fi
|
||||
gen_links
|
||||
update_subs
|
||||
interval=${SUBS_DAEMON_INTERVAL:-$((10 * 60))}
|
||||
printf 'Sleeping for %s seconds...\n' "$interval"
|
||||
sleep "$interval"
|
||||
done
|
||||
}
|
||||
|
||||
main() {
|
||||
mkdir -p "$SUBS"
|
||||
|
||||
case ${1#-} in
|
||||
h) usage ;;
|
||||
g) gen_links ;;
|
||||
u) update_subs ;;
|
||||
c) cat_subs ;;
|
||||
d) daemonize ;;
|
||||
*) get_sel ;;
|
||||
esac
|
||||
}
|
||||
|
||||
main "$@"
|
@ -878,7 +878,7 @@ $exe autostart
|
||||
|
||||
# {{{ Settings
|
||||
|
||||
$exe repomenue_youtube_subs -d
|
||||
$exe fzf_youtube_subs -d
|
||||
|
||||
# setting variables for later use
|
||||
# use xrandr and/or arandr to know the names of your monitors
|
||||
|
@ -12,7 +12,7 @@
|
||||
#Created:
|
||||
# Mon 22 November 2021, 03:15:54 PM [GMT+1]
|
||||
#Modified:
|
||||
# Sun 16 October 2022, 05:05:58 PM [GMT+1]
|
||||
# Thu 20 October 2022, 03:26:36 PM [GMT+1]
|
||||
#
|
||||
#Description:
|
||||
# <Todo>
|
||||
|
Loading…
Reference in New Issue
Block a user