Fix a processing issue

This commit is contained in:
Kevin MacMartin 2024-10-28 18:09:37 -04:00
parent ca7faae1e2
commit fcf357f5b3

View file

@ -52,9 +52,9 @@ function update {
if [[ "$id" = 'id' ]]; then
printf '%s\n' "${REPLY},link"
else
match="$(grep -A1 'tvg-id="'"$id"'"' "$tmp_m3u_file")"
match="$(grep -A1 'tvg-id="'"$id"'"' "$tmp_m3u_file" | grep -e '^http' | head -n 1)"
if (( $? == 0 )); then
if (( $? == 0 )) && [[ -n "$match" ]]; then
link="$(grep -e '^http' <<< "$match")"
printf '%s\n' "$REPLY,$link"
fi