Compare commits
5 Commits
with-resum
...
v1.4
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d9dd7dcf99 | ||
|
|
dae470acd1 | ||
|
|
bc5a4f3929 | ||
|
|
b6d5341ee3 | ||
|
|
447313111d |
26
README.md
26
README.md
@@ -23,13 +23,37 @@ For example, to download [this video](https://drive.google.com/file/d/0B1L_hFrWJ
|
||||
|
||||
$ ./gdown.pl https://drive.google.com/file/d/0B1L_hFrWJfRhLUJZdXdSdTdfSWs/edit axolotl.mp4
|
||||
|
||||
As long as a file name is indicated (second parameter), gdown.pl **will try to resume the partially downloaded file** if an incomplete file with that name already exists.
|
||||
Resuming a download
|
||||
===================
|
||||
|
||||
If you need to resume a download, please, use [**gdown.pl v2.0** here](https://github.com/circulosmeos/gdown.pl/tree/with-resume).
|
||||
As long as a file name is indicated as second parameter, *gdown.pl v2.0* **will try to resume the partially downloaded file** if a local incomplete file with that name already exists.
|
||||
|
||||
Version
|
||||
=======
|
||||
|
||||
This version is **v1.4**.
|
||||
|
||||
### Warning
|
||||
|
||||
Please, note that v1.2 (available between days 12 to 31 of Jan/2019) **should not be used**, as it contains a bug that could result in unusable downloaded files. Proceed to overwrite with v1.3 in case you have it.
|
||||
|
||||
Docker
|
||||
======
|
||||
|
||||
A simple Docker file is provided, to build a simple Docker image with gdown.pl.
|
||||
This has been used for pre-pulling data from a Google Drive to Kubernetes persistent volumes. Thanks @anton-khodak
|
||||
|
||||
License
|
||||
=======
|
||||
|
||||
Distributed [under GPL 3](http://www.gnu.org/licenses/gpl-3.0.html)
|
||||
|
||||
Disclaimer
|
||||
==========
|
||||
|
||||
This software is provided "as is", without warranty of any kind, express or implied.
|
||||
|
||||
More info
|
||||
=========
|
||||
|
||||
|
||||
13
gdown.pl
13
gdown.pl
@@ -5,7 +5,7 @@
|
||||
#
|
||||
# v1.0 by circulosmeos 04-2014.
|
||||
# v1.1 by circulosmeos 01-2017.
|
||||
# v1.2 by circulosmeos 01-2019.
|
||||
# v1.2, v1.3, v1.4 by circulosmeos 01-2019, 02-2019.
|
||||
# //circulosmeos.wordpress.com/2014/04/12/google-drive-direct-download-of-big-files
|
||||
# Distributed under GPL 3 (//www.gnu.org/licenses/gpl-3.0.html)
|
||||
#
|
||||
@@ -22,11 +22,14 @@ my $URL=shift;
|
||||
die "\n./gdown.pl 'gdrive file url' [desired file name]\n\n" if $URL eq '';
|
||||
|
||||
my $FILENAME=shift;
|
||||
$FILENAME='gdown.'.strftime("%Y%m%d%H%M%S", localtime) if $FILENAME eq '';
|
||||
$FILENAME='gdown.'.strftime("%Y%m%d%H%M%S", localtime).'.'.substr(rand,2) if $FILENAME eq '';
|
||||
|
||||
if ($URL=~m#^https?://drive.google.com/file/d/([^/]+)#) {
|
||||
$URL="https://docs.google.com/uc?id=$1&export=download";
|
||||
}
|
||||
elsif ($URL=~m#^https?://drive.google.com/open\?id=([^/]+)#) {
|
||||
$URL="https://docs.google.com/uc?id=$1&export=download";
|
||||
}
|
||||
|
||||
execute_command();
|
||||
|
||||
@@ -65,8 +68,8 @@ while (-s $FILENAME < 100000) { # only if the file isn't the download yet
|
||||
unlink $TEMP;
|
||||
|
||||
sub execute_command() {
|
||||
$COMMAND="wget -c --no-check-certificate --load-cookie $TEMP --save-cookie $TEMP \"$URL\"";
|
||||
$COMMAND="wget --progress=dot:giga --no-check-certificate --load-cookie $TEMP --save-cookie $TEMP \"$URL\"";
|
||||
$COMMAND.=" -O \"$FILENAME\"" if $FILENAME ne '';
|
||||
`$COMMAND`;
|
||||
system ( $COMMAND );
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user