Take the 2-minute tour ×
Web Applications Stack Exchange is a question and answer site for power users of web applications. It's 100% free, no registration required.

I am trying In Google Drive, how can you link directly to "Download" a zip file and not view the contents? but it does not work. I am not sure on how to repeat the question. It downloads a 'file is too big to be antivirus scanned' warning HTML and when I try https://drive.google.com/uc?export=download&confirm=no_antivirus&id= it still downloads that.

Edit: I tried to wget --save-cookies /tmp/cookie.txt --load-cookies /tmp/cookie.txt and repeat it, still no dice.

share|improve this question
    
Did you ever figure this out? Running into the same problem with bigger files. –  Travis R Mar 18 at 19:31
    
No, I gave up on this. –  chx Mar 18 at 20:50
add comment

3 Answers 3

up vote 0 down vote accepted

A cookie must match the "confirm" url parameter, and it is changed on each call.

Here's a perl script to download these files in an unattended way.

With the url from the antivirus scan warning page (https://drive.google.com/uc?export=download&confirm=s5vl&id=XXX) this code should be enough:

#!/usr/bin/perl
use strict;
my $TEMP='/tmp';my $COMMAND;my $confirm;
sub execute_command();
my $URL=shift;my $FILENAME=shift;
$FILENAME='gdown' if $FILENAME eq '';
execute_command();
if (-s $FILENAME < 100000) { # only if file isn't the download yet
    open fFILENAME, '<', $FILENAME;
    foreach (<fFILENAME>) {
        if (/confirm=([^;&]+)/) {
            $confirm=$1; last;   }    }
    close fFILENAME;
    $URL=~s/confirm=([^;&]+)/confirm=$confirm/;
    execute_command();    }
sub execute_command() {
    $COMMAND="wget --no-check-certificate --load-cookie $TEMP/cookie.txt --save-cookie $TEMP/cookie.txt \"$URL\"";
    $COMMAND.=" -O \"$FILENAME\"" if $FILENAME ne '';
    `$COMMAND`; return 1;    }
share|improve this answer
add comment

Try this

You can download these files to your computer in the following formats:

For documents: HTML, RTF, Word, Open Office, PDF, Text file.
For spreadsheets: CSV, HTML, ODS, PDF, XLS, TXT (only for a single sheet)
For presentations: PDF, PPTX, TXT
For drawings: PNG, JPEG, SVG, PDF

Download a file to your computer from Google Drive

Click the checkbox(es) next to the item(s) that you'd like to download.
Expand the More drop-down menu, and select Download...
Select a file format to which you'd like convert and download your item, such as Microsoft Word. If you select multiple items, they'll be

compressed into a .zip file Click Download.

You can also download a file when you're viewing the file. Go to the File menu, point your mouse to Download as, and select a file format.

If total file is above 2GB I don't think you'll be able to download without breaking into batches.

share|improve this answer
    
alas, it's a binary file :( neither of the above. –  chx Apr 25 '13 at 2:05
add comment

Ok, Google uses the following URL format for the final download link:

https://drive.google.com/uc?export=download&confirm=s5vl&id=XXX

Notice the confirm parameter which seems to change every time you go to the original link. Maybe it's a short lived token or cookie matching or something?

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.