How to get comments from videos using YouTube API v3 and Python?

前端 未结 5 1968
陌清茗
陌清茗 2021-02-02 04:40

I\'ve been trying to get comments (both threads and replies) from a given video on YouTube using Python (as an exercise to learn the language).

Based on the examples giv

5条回答
  •  一向
    一向 (楼主)
    2021-02-02 05:03

    I don't know if it's the same root cause, but I ran into trouble recently when I was trying to access all comments of a video. I would get a list of comment threads, but when I tried to find all the replies to those comments: some comments would show up and some wouldn't. I noticed, however, that the API query you can try out in the documentation would usually seem to retrieve more results than attempts I made in my own code. I checked the Network panel and noticed that the example in the API documentation is making calls to https://content.googleapis.com - not https://www.googleapis.com as it instructs others to do. I had better luck using the content URL instead, but I'm not sure why there is such a discrepancy between the two.

提交回复
热议问题