I have searched in YouTube Documents and found nothing to get others channel name from a YouTube video.
That is,
I currently would like to get the channel name from a video, I only have the URL, how to get the channel name?
I have searched in YouTube Documents and found nothing to get others channel name from a YouTube video.
That is,
I currently would like to get the channel name from a video, I only have the URL, how to get the channel name?
You can do this easily by using YouTube Data API v3.
The latest part in the URL after "http://www.youtube.com/watch?v=" is your VIDEO_ID.
Just do a videos->list with setting part="snippet". Then you can grab snippet.channelId in the response.
Request would be:
for your example.
You can always try these using API explorer.
Great sample codes to get you started.
For total newbies who are lost : consider a sample function that will help understand the entire cycle of fetch,parse,display etc and bring youtube channel's videos to your tableview specifically. im not writing the tableview part here
You can extract the video id from the URL, and then make an HTTP GET request:
https://gdata.youtube.com/feeds/api/videos/dQw4w9WgXcQ?v=2&alt=json
where
dQw4w9WgXcQ
is the video id you're interested in. This returns a JSON response, with the channel name in theauthor
field (click the link for an example).For more information, see Retrieving Data for a Single Video and the rest of the YouTube API documentation.
See e.g. How do I find all YouTube video ids in a string using a regex? for some ways to get the video id from a YouTube URL.