Substitute HTML escape codes when piping into menu (#5)
PR: Substitute HTML escape codes when piping into menu
This commit is contained in:
9
subs
9
subs
@@ -187,16 +187,17 @@ cat_subs() {
|
||||
# Finally, play the result with mpv.
|
||||
get_sel() {
|
||||
if [ -d "$SUBS_CACHE" ] ; then
|
||||
sel=$(cat_subs | $SUBS_MENU_PROG)
|
||||
# Pipe your subs feed into your desired menu and replace HTML escape codes (" -> ")
|
||||
sel=$(cat_subs | sed -e 's/"/"/g' -e 's/&/\&/g' -e 's/</</g' -e 's/>/>/g' | $SUBS_MENU_PROG)
|
||||
else
|
||||
die 'Subs cache has not been retrieved.'
|
||||
fi
|
||||
|
||||
[ "$sel" ] || die Interrupted
|
||||
|
||||
chan="${sel#* }"
|
||||
chan="${chan%%] *}"
|
||||
title=${sel#*"$chan"\] }
|
||||
oldchan="${sel#* }"
|
||||
chan=$(printf '%s' "${oldchan%%] *}" | sed -e 's/\&/&/g' -e 's/"/\"/g' -e 's/</\</g' -e 's/>/\>/g' )
|
||||
title=$(printf '%s' "${sel#*"${oldchan%%] *}"\] }" | sed -e 's/\&/&/g' -e 's/"/\"/g' -e 's/</\</g' -e 's/>/\>/g' )
|
||||
while read -r line ; do
|
||||
case $line in
|
||||
*"$SEP$title$SEP"*)
|
||||
|
||||
Reference in New Issue
Block a user