尝试从 Google Analytics API 中提取数据。代码一直运行良好,直到昨天。现在我在 debug.log 中看到了这些警告。
WARNING:oauth2client.contrib.locked_file:Could not acquire lock <PATH> in 0 seconds
DEBUG:googleapiclient.discovery_cache.file_cache:Could not obtain a lock for the cache file.
INFO:googleapiclient.discovery:URL being requested: GET https://www.googleapis.com/analytics/v3/data/ga?sort=-ga%3Avisits&max-results=10&dimensions=ga%3Amedium&start-date=2016-05-10&start-index=1&ids=ga%3A57752509&metrics=ga%3Avisits&alt=json&end-date=2016-06-09
我没有更改代码中的任何内容。当我尝试运行此方法时出现问题:
def access(self, profile_id):
self.profile_id = profile_id
self.argv = sys.argv
# Authenticate and construct service.
self.service, flags = sample_tools.init(
self.argv, 'analytics', 'v3', __doc__, __file__,
scope='https://www.googleapis.com/auth/analytics.readonly')
整个代码可以在github.com/google...