How to get comments through Youtube Data API v3 / JSOUP parsing? [duplicate]

天大地大妈咪最大 提交于 2019-12-10 11:12:36

问题


"Getting comments with Youtube Data API V3 is on Trusted Tester stage". Can anyone give me some update info for this?

I don't want to use API V2 for getting comments, maybe there is a better way? Can anyone give me an advice how to use jsoup html parser in Android for retrieving comments if there is no way to use Youtube Data API V3 (With example, please)?


回答1:


The YouTube Team added support for comments in v3 recently.

Have a look here:

  • http://youtube-eng.blogspot.co.at/2015/04/manage-comments-with-youtube-data-api-v3.html
  • https://developers.google.com/youtube/v3/docs/commentThreads



回答2:


Update: Comments feature is now available in Data API v3. http://youtube-eng.blogspot.com/2015/04/manage-comments-with-youtube-data-api-v3.html

Comments feature for the v3 API will hopefully be released on early Q1. You can track the issue and ask for the trusted tester, so you can already start developing against.

https://code.google.com/p/gdata-issues/issues/detail?id=5046




回答3:


I don't know if this may help a bit, but there is a little code example page from Google to use their Youtube API: YouTube Data API (v3) Code Samples

The samples are available at github as you can see at the page.

I don't think it really think JSOUP is an option. If you have a video (let's take PewDiePie for example) it has litterly thousands of comments (maybe more), and not all the comments are displayed when you open the video, so you'll first need to find a way to load all comments before you can start reading them. The reading part is the most difficult, because it has thousands of comments, the system takes a while to read the comments and do whatever you want to do with it.

But what I did find is this: How to get comments of youtube Video from VideoId android in youtubeApi v3?

Take a look at the link in the comment on the first post and compare it to the video itself:

With this link you get the comments using JSON:

Getting comments of a video: http://gdata.youtube.com/feeds/api/videos/DBNYwxDZ_pA/comments?orderby=published&alt=json&max-results=30&start-index=1

The video itself: https://www.youtube.com/watch?v=DBNYwxDZ_pA

I hope this helps you a bit with your project!



来源:https://stackoverflow.com/questions/27646598/how-to-get-comments-through-youtube-data-api-v3-jsoup-parsing

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!