func_check_state() METADATA_CURL parsing failed
jim60105 opened this issue ยท 3 comments
Hello, I want to report the error, this program has not worked since yesterday. Either the channel url or the video url will not work.
This is the log that appears when the live broadcast starts.
I'm almost sure that the regex replacement here failed. It may be that Youtube changed the page.
I cut a simple script to verify this.
I am not familiar with regex and bash, I found the problem but not able to fix it.
Hope you can handle it, thank you.
This bug stems from:
Line 430 in ea1cfd7
becoming an empty string (maybe due to changes in youtube).
Changing that line to
METADATA_CURL_RAW=`echo "$_body" | grep -o 'var ytInitialPlayerResponse = .*'`
passes the "testcases" listed in the README.md, except the 4th test (playlist).
However, this change make the jq on
Line 439 in ea1cfd7
Thus, this change is merely a temporarily workaround.
fix for METADATA_CURL:
METADATA_CURL=`echo "$METADATA_CURL_RAW" | perl -pe 's/^.*?(\{".*});var meta.*$/\1/g' | jq -r .`
fix for METADATA_CURL:
METADATA_CURL=`echo "$METADATA_CURL_RAW" | perl -pe 's/^.*?(\{".*});var meta.*$/\1/g' | jq -r .`
This is not working on video.
Sorry, it was my mistake. After I put the two fixes together, it worked.
Thanks for your reply.