kkdai / youtube

Download Youtube Video in Golang
MIT License
3.3k stars 430 forks source link

fix precondition check failed error #322

Closed ppalone closed 6 months ago

ppalone commented 6 months ago

Description

Updated clientVersion for Android client from 17.31.35 to 18.11.34.

I'm getting an error unexpected status code: 400 while getting info or downloading any video as mentioned by some users in #320. I did some digging by replicating the request made by http client in postman and got this response.

{
    "error": {
        "code": 400,
        "message": "Precondition check failed.",
        "errors": [
            {
                "message": "Precondition check failed.",
                "domain": "global",
                "reason": "failedPrecondition"
            }
        ],
        "status": "FAILED_PRECONDITION"
    }
}

This is related to the issue here. Luckily, @bashonly has already provided a patch at comment https://github.com/yt-dlp/yt-dlp/issues/9316#issuecomment-1969319360 at commit https://github.com/bashonly/yt-dlp/commit/f2e86a3f6d8a016e98d678fa47ecb94de23cbfa0. I tried replicating same patch in go youtube client and they appear to be working on machine.

Fixes: #320

robrotheram commented 6 months ago

Not a reviewer but can confirm this change worked in my project. I am no longer seeing the 400 error

XORbit01 commented 6 months ago

when this PR will be merged? please call the repo owner, lol

Nico-Mayer commented 6 months ago

Can also confirm that this is fixing the Satus Code 400 issue.

cgzirim commented 6 months ago

@kkdai please can you review this PR

4strodev commented 6 months ago

@kkdai please review de PR :pray:

kkdai commented 6 months ago

Hi @corny Do you have time to check this?