From fcf357f5b31b9a4a3507adecf30e248d4a4bf28d Mon Sep 17 00:00:00 2001 From: Kevin MacMartin Date: Mon, 28 Oct 2024 18:09:37 -0400 Subject: [PATCH] Fix a processing issue --- iptv-m3u-update | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/iptv-m3u-update b/iptv-m3u-update index 09e1155..f324ddb 100755 --- a/iptv-m3u-update +++ b/iptv-m3u-update @@ -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