JohnLM 27 Posted Wednesday at 05:56 PM I was wondering. . . Is there any apps (for Windows) that can retrieve all comments from a given Youtube video ? And how quickly can it be received ? And, has anyone used it or uses it currently ? I've been wanting to download or extract Youtube comments for a number of purposes. What I'm looking for is how *fast* can comment's be retrieved, not how to do it myself. I've written a few code snippets to pull it once I have a video in view and it can be very tedious, especially when there are replies and when the comments are in the thousands. And sometimes I can't read them on screen because there are too many and/or I run out of memory or something. I'm wondering how people are doing it without issues and how fast they can pull thousands. Share this post Link to post
Die Holländer 88 Posted Thursday at 06:27 AM Use the Youtube API. uses System.Net.HttpClient, System.JSON; procedure GetYouTubeComments(const VideoID, APIKey: string); var Client: TNetHTTPClient; Response: string; JSON: TJSONObject; begin Client := TNetHTTPClient.Create(nil); try Response := Client.Get( Format('https://www.googleapis.com/youtube/v3/commentThreads?part=snippet&videoId=%s&key=%s', [VideoID, APIKey]) ).ContentAsString; JSON := TJSONObject.ParseJSONValue(Response) as TJSONObject; // Parse JSON to extract comments finally Client.Free; end; end; Share this post Link to post
JohnLM 27 Posted Thursday at 08:24 AM Thanks, but I am also already using the YT API. I have been using it for years but thought there was an even faster way of obtaining the larger comments listing. I guess what I am already using is the fastest then, only I am not using JSON. I am just manually parsing the json response because I am accustom to doing that way and json is not easy for me. I was originally using a web scrapper method but it was tedious when there were hundreds or more of comments. And when I learned about the YT API, I started using that but I couldn't figure out how to obtain more than the 100 item limit, so I went back to using the scrapper and made various updates to it whenever I had time to fine-tune it. But years later I had figured it out how to use the YT API to go past the 100 item limit and started using it--see image below. Share this post Link to post
Die Holländer 88 Posted Thursday at 09:43 AM 1 hour ago, JohnLM said: I guess what I am already using is the fastest then, only I am not using JSON. I am just manually parsing the json response So, is your parsing "slow" or the fetching the API data from Youtube? How did you do the parsing? By running through the Memo of your screenshot? Share this post Link to post