Google drive - bulk download files error at once

I have created an API for sending letters. My letters are on google drive. I have created an API that uses my pdf files saved on a google drive account. So the API has a loop according to a number of letters. If I have 1000 records API will take 1000 files from google drive for every record already saved in a specific folder. I'm not using any API for downloading files from google drive. I'm using this link for getting files https://drive.google.com/uc?id=FILE_ID&format=pdf or https://drive.google.com/uc?id=FILE_ID&authuser=0&export=download

$query_str = explode('/', $fileURL);

$fileID = $query_str[5]; $parrsedURL = "https://drive.google.com/uc?id=".$fileID;

file_put_contents('ClientFiels/'.$fileName.'.pdf', fopen($fileURL, 'r'));

FILE_ID id will be changed every time the new round of loop will start. Problem: The API is working fine for 60 to 70 records. And after that, I'm getting this error. 403 for URL: https://doc-00-5o-docs.googleusercontent.com/docs/securesc/ha0ro937gcuc7l7deffksulhg5h7mbp1/576qj60mg7jp9jdrko5ck1dtabf1ktm3/1647339525000/09925282465490487763//1V1AYJRwLcZxSoAFJPRzuOEMFWiKiptb4?e=download And after 5 to 10 minutes if I run the program again it works for the same amount of records again. When I check my API metrics in google console it shows me an error in Drive.files.copy: method. I tried to download files in different ways but I got the same error. I'm not sure if there is any quota limit or I need to change any settings.

hello and welcome to the forum,

sorry if i missed it, but did not see a rclone question?

if you have a rclone question, need to answer all the questions in the help and support template.

I'm not sure about it but I just have a problem with google drive and I saw there was discussion about it and i asked for my problem

well, are you using rclone?

You need to implement the exponential backoff as described here and retry:

It doesn't work even I use 30 seconds delay.

Try a long delay between each operation and see if it still stops after 60-70.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.