Skip to content

Commit

Permalink
ctbcap: fix potential connect dump splitting issue
Browse files Browse the repository at this point in the history
  • Loading branch information
KFERMercer committed Jan 4, 2025
1 parent 6f21cc8 commit 33de66f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions ctbcap
Original file line number Diff line number Diff line change
Expand Up @@ -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}" ] && {
Expand All @@ -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}]"
Expand All @@ -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
Expand Down

0 comments on commit 33de66f

Please sign in to comment.