From 33de66f3a9b21759a20c95b4643ba05e808b4844 Mon Sep 17 00:00:00 2001 From: KFERMercer Date: Sat, 4 Jan 2025 08:02:30 +0800 Subject: [PATCH] ctbcap: fix potential connect dump splitting issue --- ctbcap | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ctbcap b/ctbcap index b278c00..75f59bf 100755 --- a/ctbcap +++ b/ctbcap @@ -375,7 +375,7 @@ fetch_m3u() { chaturbate) # Check if Model change to new name [ "${CONNECT_STATUS}" = 404 ] && { - local CONNECT_DUMP=$(utils connect_dump "https://chaturbate.com/${MODEL}/") + local CONNECT_DUMP="$(utils connect_dump "https://chaturbate.com/${MODEL}/")" local CONNECT_STATUS="$(utils dump2status "${CONNECT_DUMP}")" MODEL_NEW_NAME=$(echo "${CONNECT_DUMP}" | grep -oE 'location:[ ]?/[^/]+/' | head -n 1 | cut -d '/' -f2) [ -n "${MODEL_NEW_NAME}" ] && { @@ -396,7 +396,7 @@ fetch_m3u() { local ROOM_STATUS="$(echo "${CONNECT_DUMP}" | grep -oE '"room_status":[ ]?"[^"]+"' | cut -d '"' -f4)" if [ -n "$(echo "${CONNECT_DUMP}" | grep -oE 'http[s]?://edge[^ ]+\.m3u8')" ]; then STREAM_LINK_GENERIC=$(echo "${CONNECT_DUMP}" | grep -oE 'http[s]?://edge[^ ]+\.m3u8' | head -n 1) - STREAM_LINK=$(utils connect_dump "${STREAM_LINK_GENERIC}" | tail -n 1) + STREAM_LINK="$(utils connect_dump "${STREAM_LINK_GENERIC}" | tail -n 1)" [ -n "${STREAM_LINK}" ] && STREAM_LINK=$(echo "${STREAM_LINK_GENERIC}" | sed 's|playlist.m3u8.*||')${STREAM_LINK} else echo "[$(date "+%Y%m%d-%H%M%S")] [${MODEL}] is ${ROOM_STATUS} now. [${CONNECT_STATUS}]" @@ -413,7 +413,7 @@ fetch_m3u() { if [ -n "$(echo "${CONNECT_DUMP}" | grep -o '"isCamAvailable":true')" ]; then local STREAMNAME="$(echo "${CONNECT_DUMP}" | grep '"streamName":' | head -n 1 | sed 's|.*"streamName":"||'| sed 's|".*||')" STREAM_LINK_GENERIC="https://edge-hls.doppiocdn.com/hls/${STREAMNAME}/master/${STREAMNAME}_auto.m3u8" - STREAM_LINK=$(utils connect_dump "${STREAM_LINK_GENERIC}" | grep -oE 'http[s]?://[^ ]+\.m3u8' | head -n 1) + STREAM_LINK="$(utils connect_dump "${STREAM_LINK_GENERIC}" | grep -oE 'http[s]?://[^ ]+\.m3u8' | head -n 1)" else echo "[$(date "+%Y%m%d-%H%M%S")] [${MODEL}] is offline/private now. [${CONNECT_STATUS}]" return 1