I've been looking for a method to extract details from a YouTube clip when only knowing the clip URL within a python script. I specifically need the original channel name.
The YouTube API does not seem to include any method to do so, only to extract details from a known video ID.
For example, this clip: https://www.youtube.com/clip/UgkxnEqNDtOHMOOoS5TyJFr2QOjdKbaTOTlW, with the ID UgkxnEqNDtOHMOOoS5TyJFr2QOjdKbaTOTlW
is from this video https://youtu.be/z-e2bDx7tUA, with the ID z-e2bDx7tUA
.
z-e2bDx7tUA
is searchable with the API, but UgkxnEqNDtOHMOOoS5TyJFr2QOjdKbaTOTlW
is not.
Even if there's a more roundabout method, such as getting the clip ID, then getting the video ID and then being able to use that within the API would work. But I've not found an efficient way of doing so, including web scraping.
Any help would be greatly appreciated.
One more time YouTube Data API v3 doesn't provide a basic feature.
I recommend you to use my open-source YouTube operational API. Indeed by using https://yt.lemnoslife.com/videos?part=id&clipId=CLIP_ID you'll get in item['videoId']
the video id associated with the clip.
For example the CLIP_ID
UgkxfiAGoXJYA02_JdIzA3k3pvqpLNm90DBx
is extracted from the videoId
9bZkp7q19f0
.