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.
|
# Finally, play the result with mpv.
|
||||||
get_sel() {
|
get_sel() {
|
||||||
if [ -d "$SUBS_CACHE" ] ; then
|
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
|
else
|
||||||
die 'Subs cache has not been retrieved.'
|
die 'Subs cache has not been retrieved.'
|
||||||
fi
|
fi
|
||||||
|
|
||||||
[ "$sel" ] || die Interrupted
|
[ "$sel" ] || die Interrupted
|
||||||
|
|
||||||
chan="${sel#* }"
|
oldchan="${sel#* }"
|
||||||
chan="${chan%%] *}"
|
chan=$(printf '%s' "${oldchan%%] *}" | sed -e 's/\&/&/g' -e 's/"/\"/g' -e 's/</\</g' -e 's/>/\>/g' )
|
||||||
title=${sel#*"$chan"\] }
|
title=$(printf '%s' "${sel#*"${oldchan%%] *}"\] }" | sed -e 's/\&/&/g' -e 's/"/\"/g' -e 's/</\</g' -e 's/>/\>/g' )
|
||||||
while read -r line ; do
|
while read -r line ; do
|
||||||
case $line in
|
case $line in
|
||||||
*"$SEP$title$SEP"*)
|
*"$SEP$title$SEP"*)
|
||||||
|
|||||||
Reference in New Issue
Block a user