Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upGitHub is where the world builds software
Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world.
[Request] YouTube OAuth 2.0 Authentication #5936
Comments
|
It looks like OAuth 2.0 can only be used with the YouTube API v3 which we can't use for downloading videos, so it wouldn't be too useful. Could you confirm that? Note that two factor authentication should work (look for the |
|
Yes, you can't use the YouTube API to download videos but you might be able to authenticate and use youtube-dl to download the video with "your means" but I'm not sure if this is even possible. |
|
As far as I know the Oauth is needed so an application can use some features from the API on behalf of the user (private videos, modifying playlists, uploading videos ...), it wouldn't work in the normal YouTube website (which is what we use). |
|
I'm closing the issue because it doesn't seem we could benefit from it. If you find some feature that would need it, feel free to explain it. |
|
I have a use case for OAuth 2.0 that isn't served by the The thing is, I don't want to give my university account password to Google (which is what I assume the Currently I can work around youtube-dl's lack of OAuth 2.0 support by following the example of this gist, which uses cut-and-paste and a few curl commands to interact with accounts.google.com and get a temporary OAuth access token. I then insert the access \token using the
It would be nice if I could just download my client_secret.json from the Google Developer's Console and do something like |
|
Here is a little helper script that allows you to use youtube-dl with YouTube and OAuth 2.0. It outputs an
The first time you run it, it will print a URL to open in a browser and wait for you to paste in a code. The second and later times, it doesn't require interaction.
The process can be made a little more automatic: rather than asking the user to paste a code, you can have the OAuth server redirect to a local webserver and issue a request that contains the code. That's what the oauth2client.tools.run_flow function does. I didn't use it in the script because it writes to stdout and interferes with the The pypi page for oauth2client says it is deprecated, and recommends using google-auth or oauthlib instead. Beware that the helper script issues its own HTTP requests (in |
I would like to request an
OAuth 2.0feature to authenticate for YouTube instead of submitting a username and a password. This is useful for e.g. downloading private videos since they require you to be logged in.Basically, if the video is private the application should try to authenticate in order to download the video (in case it's the one from your account).
Here are Python code samples for the YouTube API and authentication:
https://developers.google.com/youtube/v3/code_samples/python