Skip to content

Commit

Permalink
ctbcap: -v add curl version
Browse files Browse the repository at this point in the history
- ctbcap: -v optimize layout
- ctbcap-healthcheck: $UA use real time value
  • Loading branch information
KFERMercer committed Jan 3, 2025
1 parent 0c2ba3d commit 4efaf93
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 10 deletions.
17 changes: 8 additions & 9 deletions ctbcap
Original file line number Diff line number Diff line change
Expand Up @@ -111,21 +111,20 @@ doc() {
echo "<https://github.com/KFERMercer/chaturbate-grabber>"
;;
ver)
echo "Chaturbate-Grabber (aka CtbCap) v${CTBCAP_VERSION}-r${CTBCAP_RELEASE}."
printf "ctbcap/${CTBCAP_VERSION}-r${CTBCAP_RELEASE} "
printf "Copyright (C) 2019-2025 KFERMercer <https://github.com/KFERMercer>\n"
echo
echo "Copyright (C) 2019-2025 KFERMercer <https://github.com/KFERMercer>"
echo
echo "We defend the ideals of Communism and Anarky, Believe"
echo "the transmission of knowledge and information cannot"
echo "receive any perceived impediment."
echo "UA: ${UA}"
echo
echo "Time-Mark: [$(date "+%Y%m%d-%H%M%S")] ($(date "+%Z"))"
echo
printf "cURL: "
printf "$(command -v "curl" 1>/dev/null 2>&1 || echo "N/A")"
printf "$(curl -V 2>/dev/null | head -n 1 | grep -oE '[0-9][^ ]+' | head -n 1)\n"
echo
printf "FFmpeg: "
printf "$(command -v "ffmpeg" 1>/dev/null 2>&1 || echo "N/A")"
printf "$(ffmpeg -version 2>/dev/null | head -n 1 | grep -oE '[0-9].+')\n"
echo
echo "UA: ${UA}"
printf "$(ffmpeg -version 2>/dev/null | head -n 1 | grep -oE '[0-9][^ ]+' | head -n 1)\n"
;;
esac
}
Expand Down
2 changes: 1 addition & 1 deletion ctbcap-healthcheck
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ esac
# If Model currently online, set HTTP Status Code of m3u8 link as flag
[ -f "${LOG_PATH}/${MODEL}-${PLATFORM}.online" ] && {
STREAM_LINK="$(cat "${LOG_PATH}/${MODEL}-${PLATFORM}.online")"
[ -n "${UA}" ] || UA="$(ctbcap -v | grep '^UA: ' | sed 's|UA: ||')"
UA="$(ctbcap -v | grep '^UA: ' | sed 's|UA: ||')"
[ -z "${UA}" ] && echo "(ERROR) UA does not exist!" && exit 1
# Has ffmpeg process, but m3u8 link is unavailable --> err
FFMPEG_PROCESS=$(ps -ef | grep -oE "[f]fmpeg.*-i.*.m3u8.*${MODEL}.*.mkv" 2>/dev/null)
Expand Down

0 comments on commit 4efaf93

Please sign in to comment.