imputnet / cobalt

save what you love
https://cobalt.tools
GNU Affero General Public License v3.0
10.26k stars 722 forks source link

couldn't get this youtube video because it requires an account to view via start api locally with npm #567

Closed Changjinxing closed 1 week ago

Changjinxing commented 2 weeks ago

bug description

curl --location 'http://localhost:9000/api/json' \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --data '{ "url": "https://youtu.be/S_rEFH94T94" }'


{
  "status": "error",
  "text": "couldn't get this youtube video because it requires an account to view.<br><br>this limitation is done by google to seemingly stop scraping, affecting all 3rd party tools and even their own clients.<br><br>try again, but if issue persists, check the <a class=\"text-backdrop link\" href=\"https://status.cobalt.tools/\" target=\"_blank\">status page</a> or <a class=\"text-backdrop link\" href=\"https://github.com/imputnet/cobalt\" target=\"_blank\">create an issue on github</a>."
}

reproduction steps steps to reproduce the behavior:

  1. setup the API locally using npm
  2. run the curl bash cmd above
  3. download this video: https://youtu.be/S_rEFH94T94
  4. see error
dumbmoron commented 2 weeks ago

that video downloads for me on the main instance for me. as the error message says, you need to add an account to your instance to be able to download it

wukko commented 1 week ago

as the error message says, you need to add an account to your instance to be able to download it

wukko commented 1 week ago

you can do it by running "npm run token:youtube" and following setup steps

wukko commented 1 week ago
  1. run npm run token:youtube on your local machine, not the instance server.
  2. follow steps using a dummy google account, NOT your personal one.
  3. copy generated cookie and put it into your instance's cookies.json youtube array.