Coder Social home page Coder Social logo

Comments (21)

Akianonymus avatar Akianonymus commented on June 18, 2024 2

Yeah, google has been doing this from a long time. Authenticated users have no limitations on download of public files/folders.

Applies to shared drive/non shared drive.

Now that you have confirmed that the issue is totally because of authentication, just have to implement authentication. Would be easy to do like google-drive-upload.

Again for this issue, will start working on it next week.

from gdrive-downloader.

Akianonymus avatar Akianonymus commented on June 18, 2024 1

Ooh, i misunderstood your problem. Seems like i have to handle it seperately if more than 100 files.

from gdrive-downloader.

Anon-Exploiter avatar Anon-Exploiter commented on June 18, 2024 1

Man, awesome stuff, working perfectly fine!

Thanks for working on this ❤️

from gdrive-downloader.

Anon-Exploiter avatar Anon-Exploiter commented on June 18, 2024

I looked into #7 before creating this and it seems he ran into the same problem as I did but didn't provide any details if that URL was publicly accessible or from his own drive.

from gdrive-downloader.

Anon-Exploiter avatar Anon-Exploiter commented on June 18, 2024

Confirmed, this only happens unauthenticatedly, can confirm through an incognito session as well, if the user is logged in, doesn't happen, and can download easily.

from gdrive-downloader.

Anon-Exploiter avatar Anon-Exploiter commented on June 18, 2024

Also, I can confirm that when I'm authenticated as any user and not admin/member of that gdrive, I can download the file multiple times without any quota errors.

Happens only in incognito or unauthenticatedly, we might have to implement a check or something for shared drives. I've yet to test this all on personal drive, I'm sure there won't be any probs there.

from gdrive-downloader.

Anon-Exploiter avatar Anon-Exploiter commented on June 18, 2024

Great, sure!

from gdrive-downloader.

Akianonymus avatar Akianonymus commented on June 18, 2024

Install test gdl

curl -Ls --compressed  https://github.com/Akianonymus/gdrive-downloader/raw/master/install.sh | sh -s -- -b wip -c test_gdl

Use test_gdl command to test.

Added -a / --auth flag to use authentication.

Read https://github.com/Akianonymus/gdrive-downloader/tree/wip#authentication for more info.

from gdrive-downloader.

Anon-Exploiter avatar Anon-Exploiter commented on June 18, 2024

Awesome, works perfectly fine with 0 fails.

image

Thanks for working on this!

from gdrive-downloader.

Anon-Exploiter avatar Anon-Exploiter commented on June 18, 2024

Unrelated question:

Have you taken a look at integrating API key rather than Oauth tokens for GDL? It's just that the process takes longer and you need a refresh token when you're using the saved config file after some time.

https://console.cloud.google.com/apis/credentials/

image


For the API key, just export it in environmental variables or we can take it as a input from user.

from gdrive-downloader.

Anon-Exploiter avatar Anon-Exploiter commented on June 18, 2024

Hey, so due to some reason, it is only downloading 100 files from the folder. I created 1000 test files, uploaded them in a directory and it is downloading 100 from every directory.

You can use the shared drive link for testing further.

Authenticated:

test_gdl https://drive.google.com/open?id=1JTslaDrtoFNnOC9APuRxQXnLv55cN8ay -p 20 --auth

image


Unauthenticated:

test_gdl https://drive.google.com/open?id=1JTslaDrtoFNnOC9APuRxQXnLv55cN8ay -p 20

image

from gdrive-downloader.

Anon-Exploiter avatar Anon-Exploiter commented on June 18, 2024

Files count:

image

from gdrive-downloader.

Akianonymus avatar Akianonymus commented on June 18, 2024

Unrelated question:

Have you taken a look at integrating API key rather than Oauth tokens for GDL? It's just that the process takes longer and you need a refresh token when you're using the saved config file after some time.

https://console.cloud.google.com/apis/credentials/

image

For the API key, just export it in environmental variables or we can take it as a input from user.

Yeah, it should be simple enough, just have to add key=api_key to url instead of access_token header.

E.g: curl -o filename "${API_URL}/drive/${API_VERSION}/files/${file_id}?alt=media&key=${API_KEY}"

If i remember correctly, api keys have less qouta for downloading files, have to recheck.

from gdrive-downloader.

Akianonymus avatar Akianonymus commented on June 18, 2024

Hey, so due to some reason, it is only downloading 100 files from the folder. I created 1000 test files, uploaded them in a directory and it is downloading 100 from every directory.

You can use the shared drive link for testing further.

Authenticated:

test_gdl https://drive.google.com/open?id=1JTslaDrtoFNnOC9APuRxQXnLv55cN8ay -p 20 --auth

image

Unauthenticated:

test_gdl https://drive.google.com/open?id=1JTslaDrtoFNnOC9APuRxQXnLv55cN8ay -p 20

image

It's due to because you are doing too much parallel downloading, decrease that value and use retry flag to handle possible errors due to api limitation.

e.g: test_gdl 1JTslaDrtoFNnOC9APuRxQXnLv55cN8ay -p 100 -R 10 and superfast without any errors ( hopefully ) .

from gdrive-downloader.

Anon-Exploiter avatar Anon-Exploiter commented on June 18, 2024

The thing is all the files download easily, but the total count it is showing is 100.

I downloaded another directory with subfolders, each having 50+ files in them and 4 total folders. That worked fine, maybe 100+ doesn't work?

image

from gdrive-downloader.

Anon-Exploiter avatar Anon-Exploiter commented on June 18, 2024

Just to add here, the original directory has 1000 files.

Tested on two other directories with 176 and 376 files, it downloaded only 100 in them too.

from gdrive-downloader.

Anon-Exploiter avatar Anon-Exploiter commented on June 18, 2024

Yosh, man oh man I'm good at QA 😂

from gdrive-downloader.

Akianonymus avatar Akianonymus commented on June 18, 2024

So, i have added two new flags, -o/--oauth and -k/--key.

-o for oauth authentication and --key for using api key.

Providing api key is optional, if not provided, it will use in script api key.

See more info here: https://github.com/Akianonymus/gdrive-downloader/tree/wip#usage

To test, update the test_gdl command with test_gdl -u.

from gdrive-downloader.

Akianonymus avatar Akianonymus commented on June 18, 2024

I have pushed fixes for 100 files problem, update and try that too.

from gdrive-downloader.

Akianonymus avatar Akianonymus commented on June 18, 2024

Added option to save custom api key in config file.

from gdrive-downloader.

Anon-Exploiter avatar Anon-Exploiter commented on June 18, 2024

Awesome, lemme try.

from gdrive-downloader.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.