JuanBindez / pytubefix

Python3 library for downloading YouTube Videos.
http://pytubefix.rtfd.io/
MIT License
714 stars 99 forks source link

Youtube changed something on "https://www.youtube.com/youtubei/v1/player?prettyPrint=false" url #327

Open akirapix opened 1 day ago

akirapix commented 1 day ago

I suppose Youtube changed the way of accessing this URL https://www.youtube.com/youtubei/v1/player?prettyPrint=false causing a 400 error

if i try to copy/paste this url on the browser it says:

  1. That’s an error. The request method GET is inappropriate for the URL /youtubei/v1/player. That’s all we know.

this behaviour changed more or less yesterday, and only when using allow_oauth_cache=True and use_oauth=True

to reproduce the error i used simply:

from pytubefix import YouTube

yt = YouTube(, allow_oauth_cache=True, use_oauth=True) stream = yt.streams.filter(only_audio=True).order_by('abr').desc().first()

this piece of code was working without any errors since a month, but suddenly stopped giving me a 400 error

code is working on:

angela-gentile commented 1 day ago

Same problem too

rockfarmor commented 1 day ago

Same issue, setting allow_oauth_cache and use_oauth to False resolves the issue, besides not being able to download some videos due to not being authenticated

akirapix commented 1 day ago

Same issue, setting allow_oauth_cache and use_oauth to False resolves the issue, besides not being able to download some videos due to not being authenticated

yeah the same for me. i need to make it work allow_oauth_cache and use_oauth set to True

JuanBindez commented 16 hours ago

The version that corrects this has been released, 8.4.1 and taking advantage of the use of oauth, I made a PR to reset the cache, if you can leave your opinions on whether or not I should launch it, if it will help... I tested it and it made it a lot easier , if you want to test this in the "reset_cache" branch, see the PR on how to use it -> https://github.com/JuanBindez/pytubefix/pull/333