ytdl-org / youtube-dl

Command-line program to download videos from YouTube.com and other video sites
http://ytdl-org.github.io/youtube-dl/
The Unlicense
132.41k stars 10.04k forks source link

Is it possible to Authorize a user as the owner of the channel or not without Youtube Data API #29742

Open Eniamza opened 3 years ago

Eniamza commented 3 years ago

Checklist

Question

I'm writing an application that does something related to archive work or more specifically video backups but in general any person could fetch/dump the whole channel and reupload to the backup service that's not quite suitable for my scenario

Is it possible to retrieve the channel ID from logged-in cookie file or any other way?

Eniamza commented 3 years ago

@89z Suppose, My app downloads videos from a channel and reupload them to another platform.. But If no Auth is in place, the User can download anyone's channel and reupload, increasing DMCA infringements. So I was thinking of some way to Auth the User and his input youtube channel name to check if get owns it or not in real

this can be done by YouTube Data API, but one of the sole purposes of my app is to keep it API free

Eniamza commented 3 years ago

@89z Thanks for the suggestion, Yes someone can fork and remove it but then it'd be not my liability. More like ethics I say.

I checked the Doc you provided but it seems to use API from the google Identity console. Though I was thinking of keeping it API free, I think I would need to implant the Auth part anyway.

xenova commented 3 years ago

@Eniamza You could try loading https://studio.youtube.com/ and then scraping the channel ID in that way (it does show in a few places). In the browser, it usually changes the location to be something like https://studio.youtube.com/channel/UCw...

In fact, it turns out almost any page you load should contain that information.

If you want an "API response", open up dev tools and go to https://www.youtube.com/channel_switcher. You should see a POST request made to https://www.youtube.com/youtubei/v1/account/accounts_list. You should be able to easily replicate this in your program (see how YouTube-DL does it for example)