scripts changes

This commit is contained in:
inigoortega 2020-03-29 16:56:08 +02:00
parent 23b67a5ac9
commit 10b93638d6
6 changed files with 43 additions and 30 deletions

View File

@ -26,6 +26,7 @@ do
if [ -n "$link" -a -z "$(printf "%b\n" "$links" | grep "$link")" ]; then if [ -n "$link" -a -z "$(printf "%b\n" "$links" | grep "$link")" ]; then
links="$links\n$link" links="$links\n$link"
fi fi
echo "$link"
done done
# Get first link and download # Get first link and download

View File

@ -32,7 +32,7 @@ while getopts ":uf:" option; do
done done
shift $((OPTIND-1)) shift $((OPTIND-1))
videos_file="/tmp/wlvfs_videos" videos_file="$HOME/.local/share/wlvfs_videos"
if [ -z "$subs_file" ]; then if [ -z "$subs_file" ]; then
if [ -z "$YT_SUBS" ]; then if [ -z "$YT_SUBS" ]; then
@ -94,28 +94,34 @@ fi
# Processing # 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}') channel=$(echo "$line" | awk '{print $1}')
last_video=$(echo "$line" | awk '{print $2}') last_video=$(echo "$line" | awk '{print $2}')
upload_frequency=$(echo "$line" | awk '{print $3}') upload_frequency=$(echo "$line" | awk '{print $3}')
prev_upload_frequency=$(echo "$line" | awk '{print $4}') 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" temp="/tmp/wlvfs"
dash termscripts/channel-videos-after.sh \ dash $TSCRIPTS/channel-videos-after.sh "https://youtube.com/channel/$channel" "$last_video" | tee "$temp" | \
"https://invidio.us/channel/$channel" "$last_video" | tee "$temp" | \
while read video; do while read video; do
printf "\tFound video: %s\n" "$video" printf "\tFound video: %s\n" "$video"
if [ ! -f "$videos_file" ]; then if [ ! -f "$videos_file" ]; then
echo "ytdl://$video" >> $videos_file echo "ytdl://$video" >> $videos_file
if [ -z "$play_at_the_end" ]; then if [ -z "$play_at_the_end" ]; then
(dash termscripts/play-videos-from-file.sh "$videos_file"&& \ (dash $TSCRIPTS/play-videos-from-file.sh "$videos_file"&&
rm "$videos_file") & rm "$videos_file") &
fi fi
else else
echo "ytdl://$video" >> $videos_file echo "ytdl://$video" >> $videos_file
{
sleep 5
[ ! -f "$videos_file" ] && echo "ytdl://$video" >> \
$videos_file
} &
fi fi
done done
new_last_video=$(head -n 1 "$temp") new_last_video=$(head -n 1 "$temp")

View File

@ -2,4 +2,4 @@
watch="$(cat $FAV_STREAMERS | rofi -dmenu -matching fuzzy)" watch="$(cat $FAV_STREAMERS | rofi -dmenu -matching fuzzy)"
[ -n "$watch" ] && mpv "https://www.twitch.tv/$watch" [ -n "$watch" ] && $VIDEOPLAYER "https://www.twitch.tv/$watch"

View File

@ -3,8 +3,6 @@
channel="$1" channel="$1"
last_watched_video="$2" last_watched_video="$2"
videos=""
youtube-dl --get-id "$channel" 2>/dev/null | while read line && youtube-dl --get-id "$channel" 2>/dev/null | while read line &&
[ "$line" != "$last_watched_video" ]; do [ "$line" != "$last_watched_video" ]; do
echo "$line" echo "$line"

View File

@ -1,25 +1,33 @@
#!/usr/bin/env sh #!/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`" && old_config="$KERNEL_CONFIGS/kernel-config-`uname -r`" &&
cp /usr/src/linux/.config $old_config && cp /usr/src/linux/.config $old_config &&
emerge -v --update --deep --with-bdeps=y --newuse \ export old_config
sys-kernel/gentoo-sources && export -f update_kernel
su -c update_kernel
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

View File

@ -11,7 +11,7 @@ do
video="$(sed "$current_video q;d" "$1")" video="$(sed "$current_video q;d" "$1")"
dash -c "$VIDEOPLAYER '$video'" $VIDEOPLAYER "$video"
length="$(wc -l "$1" | awk '{print $1}')" length="$(wc -l "$1" | awk '{print $1}')"
# if [ "$length" -eq "$current_video" ]; then # if [ "$length" -eq "$current_video" ]; then