Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get a user's Google+ ID from a YouTube channel ID

I'm running a service where people can connect their Google account using oauth 2.0, and with YouTube permissions I can manage their channels/access their YouTube Channel ID.

However, my question is whether or not you can go backwards. i.e. How can you determine the Google Account Owner from a given YouTube channel ID?

like image 497
ksloan Avatar asked Oct 15 '25 16:10

ksloan


1 Answers

Probably people can not get Google+ ID from YouTube API(v3). But even the channel owner did not create google plus account, you can know it in advance on the channel HTML document by using XHR or curl.

  1. visit channel page.

    https://www.youtube.com/channel/UCL8ZULXASCc1I_oaOT0NaOQ

  2. Catch Javascript object from Developer tool on browser at the page.

    ytInitialData.metadata.channelMetadataRenderer.ownerUrls

    [ "http://www.youtube.com/user/googlechrome",
    "https://plus.google.com/100585555255542998765" ]

  3. Second one is always google plus address and the number is Google+ ID. You can get more info from ytInitialData at the channel page if necessary.

One example. https://www.youtube.com/channel/UCiQPrVjbUlZBWY0fVtvpoKg

About that channel id(UCiQPrVjbUlZBWY0fVtvpoKg) You can not get Google+ ID from YouTube API(v3), but you can get Google+ ID at the channel directly when you can access html document or read it. Even if the channel owner did not create google plus account, the Youtube already made Google+ ID together.

like image 83
JH SON Avatar answered Oct 19 '25 13:10

JH SON



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!