首页 > 解决方案 > YouTube API takes minutes now - instead of seconds

问题描述

I have a Perl script which uses LWP::UserAgent to retrieve a YouTube video's information via an HTTPS request. The script normally would take 2-3 seconds to retrieve three separate HTTPS requests. Now, it takes 15-20 minutes.

I wrote a similar script in Python where I use the following:

    import google_auth_oauthlib.flow
    import googleapiclient.discovery
    import googleapiclient.errors

And this one request is taking 5-7 minutes.

Then - on Thursday night - the Perl script went back to only taking 2-3 seconds. This lasted for a few hours, and now the time is back to taking 15-20 minutes. The script seems to take forever on the HTTPS call - and not during any other time of the script.

If I take the HTTPS URL and put it in a web browser, it takes less than a second.

The script is over 2,000 lines long, so I can't post it here. But, all I am doing is trying to retrieve:

https://www.googleapis.com/youtube/v3/videos?part=statistics&key=$key&id=$video_comments_to_get,

where $key is my authorization key, and $video_comments_to_get is the 11 character YouTube video ID value.

This all started after YouTube's outage on November 11th. Any ideas why this would be taking so long? I only run this script 10-15 times a day - so it isn't like I am over my quota.

标签: youtube-data-api

解决方案


推荐阅读