scripts changes
This commit is contained in:
parent
23b67a5ac9
commit
10b93638d6
|
@ -26,6 +26,7 @@ do
|
|||
if [ -n "$link" -a -z "$(printf "%b\n" "$links" | grep "$link")" ]; then
|
||||
links="$links\n$link"
|
||||
fi
|
||||
echo "$link"
|
||||
done
|
||||
|
||||
# Get first link and download
|
||||
|
|
|
@ -32,7 +32,7 @@ while getopts ":uf:" option; do
|
|||
done
|
||||
shift $((OPTIND-1))
|
||||
|
||||
videos_file="/tmp/wlvfs_videos"
|
||||
videos_file="$HOME/.local/share/wlvfs_videos"
|
||||
|
||||
if [ -z "$subs_file" ]; then
|
||||
if [ -z "$YT_SUBS" ]; then
|
||||
|
@ -94,28 +94,34 @@ fi
|
|||
|
||||
|
||||
# Processing
|
||||
rm $videos_file 2> /dev/null
|
||||
|
||||
grep -vE '^#|^$|^!' "$subs_file" | sort -rg -k 4 -k 3 -k 5 | while read line; do
|
||||
grep -vE '^#|^$|^!' "$subs_file" | sort -rg -k 5 -k 4 -k 3 | while read line; do
|
||||
channel=$(echo "$line" | awk '{print $1}')
|
||||
last_video=$(echo "$line" | awk '{print $2}')
|
||||
upload_frequency=$(echo "$line" | awk '{print $3}')
|
||||
prev_upload_frequency=$(echo "$line" | awk '{print $4}')
|
||||
manual_preference=$(echo "$line" | awk '{print $5}')
|
||||
|
||||
echo "Processing: $channel on Preference: $prev_upload_frequency"
|
||||
echo "Processing: $channel on Preference: $manual_preference - $prev_upload_frequency"
|
||||
|
||||
temp="/tmp/wlvfs"
|
||||
dash termscripts/channel-videos-after.sh \
|
||||
"https://invidio.us/channel/$channel" "$last_video" | tee "$temp" | \
|
||||
dash $TSCRIPTS/channel-videos-after.sh "https://youtube.com/channel/$channel" "$last_video" | tee "$temp" | \
|
||||
while read video; do
|
||||
printf "\tFound video: %s\n" "$video"
|
||||
if [ ! -f "$videos_file" ]; then
|
||||
echo "ytdl://$video" >> $videos_file
|
||||
if [ -z "$play_at_the_end" ]; then
|
||||
(dash termscripts/play-videos-from-file.sh "$videos_file"&& \
|
||||
rm "$videos_file") &
|
||||
(dash $TSCRIPTS/play-videos-from-file.sh "$videos_file"&&
|
||||
rm "$videos_file") &
|
||||
fi
|
||||
else
|
||||
echo "ytdl://$video" >> $videos_file
|
||||
{
|
||||
sleep 5
|
||||
[ ! -f "$videos_file" ] && echo "ytdl://$video" >> \
|
||||
$videos_file
|
||||
} &
|
||||
fi
|
||||
done
|
||||
new_last_video=$(head -n 1 "$temp")
|
||||
|
|
|
@ -2,4 +2,4 @@
|
|||
|
||||
watch="$(cat $FAV_STREAMERS | rofi -dmenu -matching fuzzy)"
|
||||
|
||||
[ -n "$watch" ] && mpv "https://www.twitch.tv/$watch"
|
||||
[ -n "$watch" ] && $VIDEOPLAYER "https://www.twitch.tv/$watch"
|
||||
|
|
|
@ -3,8 +3,6 @@
|
|||
channel="$1"
|
||||
last_watched_video="$2"
|
||||
|
||||
videos=""
|
||||
|
||||
youtube-dl --get-id "$channel" 2>/dev/null | while read line &&
|
||||
[ "$line" != "$last_watched_video" ]; do
|
||||
echo "$line"
|
||||
|
|
|
@ -1,25 +1,33 @@
|
|||
#!/usr/bin/env sh
|
||||
|
||||
update_kernel () {
|
||||
emerge -v --update --deep --with-bdeps=y --newuse \
|
||||
sys-kernel/gentoo-sources &&
|
||||
|
||||
next_number="$(($(eselect kernel list | wc -l) - 1))" &&
|
||||
|
||||
echo "New kernel: $(eselect kernel list | tail -n 1)" &&
|
||||
|
||||
eselect kernel set $next_number &&
|
||||
|
||||
cp $old_config /usr/src/linux/.config &&
|
||||
|
||||
cd /usr/src/linux &&
|
||||
|
||||
make syncconfig &&
|
||||
make modules_prepare &&
|
||||
emerge -v @module-rebuild &&
|
||||
make -j2 &&
|
||||
make modules_install &&
|
||||
make install &&
|
||||
|
||||
grub-mkconfig -o /grub/libreboot_grub.cfg
|
||||
}
|
||||
|
||||
old_config="$KERNEL_CONFIGS/kernel-config-`uname -r`" &&
|
||||
|
||||
cp /usr/src/linux/.config $old_config &&
|
||||
|
||||
emerge -v --update --deep --with-bdeps=y --newuse \
|
||||
sys-kernel/gentoo-sources &&
|
||||
|
||||
next_number="$(($(eselect kernel list | wc -l) - 1))" &&
|
||||
|
||||
eselect kernel set $next_number &&
|
||||
|
||||
cp $old_config /usr/src/linux/.config &&
|
||||
|
||||
cd /usr/src/linux &&
|
||||
|
||||
make syncconfig &&
|
||||
make modules_prepare &&
|
||||
emerge -v @module-rebuild &&
|
||||
make -j2 &&
|
||||
make modules_install &&
|
||||
make install &&
|
||||
|
||||
grub-mkconfig -o /grub/libreboot_grub.cfg
|
||||
export old_config
|
||||
export -f update_kernel
|
||||
su -c update_kernel
|
||||
|
|
|
@ -11,7 +11,7 @@ do
|
|||
|
||||
video="$(sed "$current_video q;d" "$1")"
|
||||
|
||||
dash -c "$VIDEOPLAYER '$video'"
|
||||
$VIDEOPLAYER "$video"
|
||||
|
||||
length="$(wc -l "$1" | awk '{print $1}')"
|
||||
# if [ "$length" -eq "$current_video" ]; then
|
||||
|
|
Loading…
Reference in New Issue