We have a program that fetches the content of a Drive and downloads the files by using the "Export Links" property returned by the API.
To download the file, we use the MediaDownloader class and the request is authenticated (OAuth2).
Everything works in the majority of time. The program does what we expect.
However, we experiment a strange issue with some Google Spreadsheets. Randomly, when we download a Google Spreadsheet via the Export Link (xlsx format). Instead of receiving an Excel file, we got an HTML page with a warning:
Title: Too Many Requests
Content: Wow, this file is very popular! It might be unavailable until the crowd clears.
As I said, it randomly fails. And this is not always the same files that fail...
Since it doesn't return an error, it's difficult to handle this case programmatically and retry the download for example.
Five things that we know:
- This problem occurs only Google Spreadsheets and it's a random problem.
- It seems that it's the old format for spreadsheets according to the URL of these files: Why are there two different URL formats for Google spreadsheet documents?.
- We don't receive any exception or error when we download the file.
- This file is not used by several users. We try it at different times of the day. No one is using the file at same time.
- Our program fetches all the content and makes about 5-8 downloads simultaneously per second (download different files).
Does anyone have any idea about this problem?