26 lines
742 B
Bash
Executable File
26 lines
742 B
Bash
Executable File
#!/bin/zsh
|
|
() {
|
|
zmodload zsh/stat
|
|
local feedpath=~/.sfeed/feeds
|
|
setopt local_options shwordsplit
|
|
local vids=()
|
|
local IFS=$'\n'
|
|
for f in $feedpath/YouTube\ -\ *; do
|
|
local IFS=$'\n'
|
|
local content=($(< $f))
|
|
local IDS=()
|
|
for i in {1..5}; do
|
|
local IFS=$'\t'
|
|
local options=(${content[$i]})
|
|
if [[ ${options[6]:0:9} == "yt:video:" ]] && [[ ${IDS[(r)${options[6]:9:11}]} != ${options[6]:9:11} ]]; then
|
|
IDS+=(${options[6]:9:11})
|
|
vids+=("$(printf '%s | ID: %s - %.40s - %s' $options[1] ${options[6]:9:11} $options[7] $options[2])")
|
|
fi
|
|
done
|
|
done
|
|
local IFS=$'\n'
|
|
[ -z "${vids}" ] && return
|
|
local title=$(print -l ${${(nO)vids}#* | } | dmenu -i -l 35)
|
|
[ ! -z $title ] && exec mpv --profile=v ytdl://${title:4:11}
|
|
}
|