wkentaro / gdown

Google Drive Public File Downloader when Curl/Wget Fails
MIT License
4.11k stars 343 forks source link

223 Modify download form tag to fix download issue #224

Closed yiheng-wang-nv closed 1 year ago

yiheng-wang-nv commented 1 year ago

This PR is used to fix the issue in #222 and #223 (I closed it as it is duplicate with 222)

I checked the issue list and found that others also meet the similar issue. A common place between @rmcpantoja and I is that the file to be downloaded is considered as a large file and will prompt a virus scan warning.

Therefore I checked the source code of gdown, and find the place that is used to process this case (https://github.com/wkentaro/gdown/blob/941200a9a1f4fd7ab903fb595baa5cad34a30a45/gdown/download.py#L32). I printed the output when call the download function with an url of a large file, and found that there is no "downloadForm".

If using a web browser and enter the link of a file, and inspect the code (such as the file I used: https://drive.google.com/uc?id=1y3NkcscPJ-KkOhVqWHbF6HbNdtgQyA_i) we can see that there is a form with id "download-form". I suspect google drive modifies the id here. By replacing "downloadForm" with "download-form", the file can be downloaded successfully according to my local test.

yiheng-wang-nv commented 1 year ago

Hi @wkentaro may need your help to double confirm this issue, and feel free to close/modify this PR, if my change is not comprehensive. Thanks in advance! gdown is really helpful!

felcaetano commented 1 year ago

This fixed my issue, many thanks!

younyokel commented 1 year ago

+

wkentaro commented 1 year ago

Thanks guys!