Compare commits

...

2 Commits

View File

@ -60,22 +60,35 @@ sub_link() {
list_read() {
VID=""
VIDFILES=""
while read -r art; do
LINK="$(sub_link "$art")"
if [ ! -z "$(printf "%s" "$LINK" | grep 'youtube.com\|odycdn\|simplecastaudio\|podcasts\|twitch')" ]; then
VID="$VID$LINK "
if [ -n "$VIDFILES" ]; then
VIDFILES=$(printf "%s\n%s" "$VIDFILES" "$art")
else
VIDFILES="$art"
fi
else
xdg-open $LINK 2> /dev/null &
fi
if [ -h "$art" ]; then
# remove symlinks from new/
rm "$art"
if [ -h "$art" ]; then
# remove symlinks from new/
rm "$art"
fi
fi
done
if [ -n "$VID" ]; then
mpv $VID 2> /dev/null &
if mpv $VID 2> /dev/null; then
printf "%s" "$VIDFILES" | xargs -d "\n" rm
else
printf "\n%s%s%s\n" \
$blue \
"mrss: Non-zero return code from mpv, not marking video files as read" \
$normal
fi
fi
}
@ -86,18 +99,24 @@ sub_read() {
}
sub_select() {
find "$MRSS_NEWDIR" -type l | (
while read -r ARTICLE; do
clear
NEWARTS="$(find "$MRSS_NEWDIR" -type l)"
TOTAL_COUNT="$(printf "%s" "$NEWARTS" | wc -l)"
printf "%s" "$NEWARTS" | (
INDEX=0
while read -r ARTICLE; do
if [ -n "$SKIPALL" ]; then
continue
fi
INDEX=$((INDEX+1))
clear
DIRNAME="$(basename $(dirname "$ARTICLE"))"
TITLE="$(cat "$ARTICLE" | jq -r '.title')"
DESC_TRUNC="$(cat "$ARTICLE" | jq -r '.description // ""' | w3m -dump -T text/html | head -n 20)"
printf "\nItem %s/%s\n" "$INDEX" "$TOTAL_COUNT"
printf "\nFeed '%s'\n" "$DIRNAME"
printf "\n%s%s%s\n" "$blue" "$TITLE" "$normal"