Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support Google Drive by transforming view/edit/etc URLs to download URLs #1735

Open
pabs3 opened this issue Jul 30, 2021 · 5 comments · May be fixed by #5525
Open

support Google Drive by transforming view/edit/etc URLs to download URLs #1735

pabs3 opened this issue Jul 30, 2021 · 5 comments · May be fixed by #5525

Comments

@pabs3
Copy link

pabs3 commented Jul 30, 2021

When the user is trying to view an image like this URL:

https://drive.google.com/file/d/1nxCfRCSQFjgDuc_jhlC24Y1Lrydg46zg/view

The URL can be transformed to this URL to download the image:

https://drive.google.com/uc?export=download&id=1nxCfRCSQFjgDuc_jhlC24Y1Lrydg46zg

There are some additional details when dealing with very large images or files that haven't yet been virus scanned, a confirmation parameter and temporary cookies are needed:

https://stackoverflow.com/questions/48133080/how-to-download-a-google-drive-url-via-curl-or-wget

Google Drive URLs can also contain folders, but I'm not sure how to transform those to a download URL:

https://drive.google.com/drive/folders/0By-NOo-lCyxBREtydWtzR0VvcWc

@Hrxn
Copy link
Contributor

Hrxn commented Jul 30, 2021

What exactly is the request here?
You cannot get stuff on Google Drive without an access link, and links cannot be "transformed" to evade the sharing settings.

If something is shared (viewable) via a public link, you can access everything, copy it to your own Drive, use a handy download link etc.

But you can't access anything that was not meant to be shared, if that was the implicated question here?

@pabs3
Copy link
Author

pabs3 commented Jul 31, 2021

Sorry for not being clear in my initial request.

If I have a Google Drive link that is publicly shareable, gallery-dl currently cannot download it:

$ gallery-dl https://drive.google.com/file/d/1nxCfRCSQFjgDuc_jhlC24Y1Lrydg46zg/view
[gallery-dl][error] No suitable extractor found for 'https://drive.google.com/file/d/1nxCfRCSQFjgDuc_jhlC24Y1Lrydg46zg/view'
$ echo $?
64

Adding support for that would be fairly simple (the URL transform mentioned above).

@gphg
Copy link

gphg commented Aug 23, 2021

Google Drive is too general for gallery-dl usage. I recommends: https://github.com/prasmussen/gdrive/ (required auth)

This sounds like youtube-dl, an optional tools to download video. I suggest to have gdrive as optional tool to download gallery from Google Drive. There are case when Danbooru's external source are from Google Drive, for example these ones:
https://safebooru.donmai.us/posts?tags=source%3Ahttps%3A%2F%2Fdrive.google.com*+status%3Aany

@pabs3
Copy link
Author

pabs3 commented Aug 23, 2021 via email

@108EAA0A
Copy link

108EAA0A commented Jan 15, 2022

Sometimes fanbox and patreon only post preview images, and the full version is a link to Google Drive (or Dropbox, MEGA, etc.).
It is desirable to work with the extractor.fanbox.embeds option to complete the download with gallery-dl alone.

@zWolfrost zWolfrost linked a pull request Apr 28, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants