How do I add oauth?
Closed this issue · 2 comments
callumosborne commented
I am figuring out how to add my credentials to download private videos when I try to add my credentials I don't see any prompts asking me to log in.
Is this supported or is this me missing something?
(venv) callumosborne@Callums-MacBook-Pro track-library % python3
Python 3.9.6 (default, Aug 11 2023, 19:44:49)
[Clang 15.0.0 (clang-1500.0.40.1)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from pytubefix import YouTube
>>> yt = YouTube(
... 'http://youtube.com/watch?v=2lAe1cqCOXo',
... use_oauth=True,
... allow_oauth_cache=True
... )
>>>
`
JuanBindez commented
I am figuring out how to add my credentials to download private videos when I try to add my credentials I don't see any prompts asking me to log in.
Is this supported or is this me missing something?
(venv) callumosborne@Callums-MacBook-Pro track-library % python3 Python 3.9.6 (default, Aug 11 2023, 19:44:49) [Clang 15.0.0 (clang-1500.0.40.1)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> from pytubefix import YouTube >>> yt = YouTube( ... 'http://youtube.com/watch?v=2lAe1cqCOXo', ... use_oauth=True, ... allow_oauth_cache=True ... ) >>> `
Hello, you missed calling the download() method, a step-by-step guide will appear with a code that you will have to use in a link that will appear, I hope I helped, try a code similar to this:
from pytubefix import YouTube
from pytubefix.cli import on_progress
url = input("URL >")
yt = YouTube(url, use_oauth=True, allow_oauth_cache=True, on_progress_callback = on_progress)
print(yt.title)
ys = yt.streams.get_audio_only()
ys.download(mp3=True)
callumosborne commented
That worked, thank you!
Thanks for keeping this package up to date