Reputation: 13734
https://www.googleapis.com/youtube/v3/videos?part=snippet&id=O44zOeYcEXs&key={API_KEY}
A url like the above returns a particular videos' information, but the description is plain text. Although when we visit that particular video (https://www.youtube.com/watch?v=O44zOeYcEXs) the description is nicely formatted html.
I've been researching but haven't found any means to extract the complete html description of a video using the API.
Any pointers ?
These are different questions :
Getting complete description of video using YouTube API v3
Upvotes: 0
Views: 2629
Reputation: 1525
The other answer is correct but doesn't exactly explain what is going on. Youtube descriptions are supposed to be plain text and the only way to post links are with the full URL. You can't hyperlink snippets of text or use any other html. I assume this is to prevent malware spreading and several other issues.
Youtube detects and linkifys URLs in the description when you open a video. You would have to process the plain-text description for links and add the html a href
tags yourself. One way to do that is to use Regex to detect URLs.
Upvotes: 0
Reputation: 117281
Most of the Google APIs the YouTube v3 API included returns data in JSon format, basically you get a string back. If you want it formatted nicely as html you need to do that yourself.
For each resource type, the guide lists one or more data representations, and resources are represented as JSON objects.
Upvotes: 0