Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

func_check_state() METADATA_CURL parsing failed #7

Closed
jim60105 opened this issue Dec 11, 2020 · 3 comments
Closed

func_check_state() METADATA_CURL parsing failed #7

jim60105 opened this issue Dec 11, 2020 · 3 comments

Comments

@jim60105
Copy link

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.
2020-12-12 02 05 27

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.

@pjw91
Copy link

pjw91 commented Dec 12, 2020

This bug stems from:

live-dl/live-dl

Line 430 in ea1cfd7

METADATA_CURL_RAW=`echo "$_body" | grep '"ytInitialPlayerResponse"'`

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

live-dl/live-dl

Line 439 in ea1cfd7

METADATA_CURL=`echo "$METADATA_CURL_RAW" | perl -pe 's/^.*?({".*}).*/\1/g' | jq -r .`
raises "parse error: Invalid numeric literal at line 1, column 247".

Thus, this change is merely a temporarily workaround.

jim60105 added a commit to jim60105/live-dl that referenced this issue Dec 13, 2020
@Absolucy
Copy link

fix for METADATA_CURL:
METADATA_CURL=`echo "$METADATA_CURL_RAW" | perl -pe 's/^.*?(\{".*});var meta.*$/\1/g' | jq -r .`

@jim60105
Copy link
Author

jim60105 commented Dec 20, 2020

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.

jim60105 added a commit to jim60105/live-dl that referenced this issue Dec 20, 2020
jim60105 pushed a commit to jim60105/live-dl that referenced this issue Jan 7, 2021
jim60105 added a commit to jim60105/live-dl that referenced this issue Jan 7, 2021
When checking private videos/streams (for example, member only streams), cookies are required here.
But the original code does not work with cookie files. Therefore, I modified the perl regex to make it work.
My docker image can ensure that there must be a cookie file passed in, so there is no need to check in my case.
**(Please note that if no cookie file is passed in, it will not work properly. And you should use the original code.)**
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants