<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://aznot.com/index.php?action=history&amp;feed=atom&amp;title=Google%2FDrive</id>
	<title>Google/Drive - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://aznot.com/index.php?action=history&amp;feed=atom&amp;title=Google%2FDrive"/>
	<link rel="alternate" type="text/html" href="https://aznot.com/index.php?title=Google/Drive&amp;action=history"/>
	<updated>2026-05-05T11:21:49Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.41.0</generator>
	<entry>
		<id>https://aznot.com/index.php?title=Google/Drive&amp;diff=7120&amp;oldid=prev</id>
		<title>Kenneth: /* Direct Download */</title>
		<link rel="alternate" type="text/html" href="https://aznot.com/index.php?title=Google/Drive&amp;diff=7120&amp;oldid=prev"/>
		<updated>2024-03-02T20:48:02Z</updated>

		<summary type="html">&lt;p&gt;&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;Direct Download&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 20:48, 2 March 2024&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l5&quot;&gt;Line 5:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 5:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== Direct Download ==&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== Direct Download ==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;If you want to share a direct link, simply change the format of the link from this:&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;If you want to share a direct link, simply change the format of the link from this: &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;(works up to a 100MB file, larger than use gdown)&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;pre&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;pre&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;

&lt;!-- diff cache key aznot:diff:1.41:old-6152:rev-7120:php=table --&gt;
&lt;/table&gt;</summary>
		<author><name>Kenneth</name></author>
	</entry>
	<entry>
		<id>https://aznot.com/index.php?title=Google/Drive&amp;diff=6152&amp;oldid=prev</id>
		<title>Kenneth: /* Direct Download Python */</title>
		<link rel="alternate" type="text/html" href="https://aznot.com/index.php?title=Google/Drive&amp;diff=6152&amp;oldid=prev"/>
		<updated>2022-12-21T22:14:15Z</updated>

		<summary type="html">&lt;p&gt;&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;Direct Download Python&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;== Windows Missing Overlay Icons ==&lt;br /&gt;
&lt;br /&gt;
See [[Windows/Missing Overlay Icons]]&lt;br /&gt;
&lt;br /&gt;
== Direct Download ==&lt;br /&gt;
&lt;br /&gt;
If you want to share a direct link, simply change the format of the link from this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
https://drive.google.com/file/d/[FILE_ID]/edit?usp=sharing&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
https://drive.google.com/uc?export=download&amp;amp;id=[FILE_ID]&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Reference:&lt;br /&gt;
* Share Direct Links to Files in Google Drive and Skip the Web Viewer - http://lifehacker.com/share-direct-links-to-files-in-google-drive-and-skip-th-1493813665&lt;br /&gt;
* Google Drive Direct Link Generator - https://sites.google.com/site/gdocs2direct/&lt;br /&gt;
&lt;br /&gt;
=== Direct Download Python ===&lt;br /&gt;
&lt;br /&gt;
 pip install gdown&lt;br /&gt;
 # gdown --id [ID]  # why specify --id??&lt;br /&gt;
 gdown [ID]&lt;br /&gt;
&lt;br /&gt;
 gdown https://drive.google.com/uc?id=&amp;lt;file_id&amp;gt;  # for files&lt;br /&gt;
 gdown &amp;lt;file_id&amp;gt;                                 # alternative format&lt;br /&gt;
 gdown --folder https://drive.google.com/drive/folders/&amp;lt;file_id&amp;gt;  # for folders&lt;br /&gt;
 gdown --folder --id &amp;lt;file_id&amp;gt;                                   # this format works for folders too&lt;br /&gt;
&lt;br /&gt;
ref: https://stackoverflow.com/questions/25010369/wget-curl-large-file-from-google-drive/39225039#39225039&lt;br /&gt;
&lt;br /&gt;
.&lt;br /&gt;
&lt;br /&gt;
--- Old GDown Method ---&lt;br /&gt;
&lt;br /&gt;
Python3 or Python2.&lt;br /&gt;
&lt;br /&gt;
gdown.py:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
import requests&lt;br /&gt;
&lt;br /&gt;
def download_file_from_google_drive(id, destination):&lt;br /&gt;
    def get_confirm_token(response):&lt;br /&gt;
        for key, value in response.cookies.items():&lt;br /&gt;
            if key.startswith(&amp;#039;download_warning&amp;#039;):&lt;br /&gt;
                return value&lt;br /&gt;
&lt;br /&gt;
        return None&lt;br /&gt;
&lt;br /&gt;
    def save_response_content(response, destination):&lt;br /&gt;
        CHUNK_SIZE = 32768&lt;br /&gt;
&lt;br /&gt;
        with open(destination, &amp;quot;wb&amp;quot;) as f:&lt;br /&gt;
            for chunk in response.iter_content(CHUNK_SIZE):&lt;br /&gt;
                if chunk: # filter out keep-alive new chunks&lt;br /&gt;
                    f.write(chunk)&lt;br /&gt;
&lt;br /&gt;
    URL = &amp;quot;https://docs.google.com/uc?export=download&amp;quot;&lt;br /&gt;
&lt;br /&gt;
    session = requests.Session()&lt;br /&gt;
&lt;br /&gt;
    response = session.get(URL, params = { &amp;#039;id&amp;#039; : id }, stream = True)&lt;br /&gt;
    token = get_confirm_token(response)&lt;br /&gt;
&lt;br /&gt;
    if token:&lt;br /&gt;
        params = { &amp;#039;id&amp;#039; : id, &amp;#039;confirm&amp;#039; : token }&lt;br /&gt;
        response = session.get(URL, params = params, stream = True)&lt;br /&gt;
&lt;br /&gt;
    save_response_content(response, destination)    &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
if __name__ == &amp;quot;__main__&amp;quot;:&lt;br /&gt;
    import sys&lt;br /&gt;
    if len(sys.argv) != 3:&lt;br /&gt;
        print(&amp;quot;Usage: python google_drive.py drive_file_id destination_file_path&amp;quot;)&lt;br /&gt;
    else:&lt;br /&gt;
        # TAKE ID FROM SHAREABLE LINK&lt;br /&gt;
        file_id = sys.argv[1]&lt;br /&gt;
        # DESTINATION FILE ON YOUR DISK&lt;br /&gt;
        destination = sys.argv[2]&lt;br /&gt;
        download_file_from_google_drive(file_id, destination)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
ref: [https://stackoverflow.com/questions/25010369/wget-curl-large-file-from-google-drive/39225039#39225039]&lt;br /&gt;
&lt;br /&gt;
=== Linux gdrive ===&lt;br /&gt;
&lt;br /&gt;
gdrive:&lt;br /&gt;
 https://github.com/prasmussen/gdrive/&lt;br /&gt;
&lt;br /&gt;
Install:&lt;br /&gt;
 wget &amp;quot;https://github.com/prasmussen/gdrive/releases/download/2.1.1/gdrive_2.1.1_linux_amd64.tar.gz&amp;quot;&lt;br /&gt;
 tar -zvxf gdrive_2.1.1_linux_amd64.tar.gz&lt;br /&gt;
 sudo mv gdrive /usr/local/bin/&lt;br /&gt;
&lt;br /&gt;
Fix musl Dependency: (If you don&amp;#039;t you may get an error about &amp;quot;file not found&amp;quot;)&lt;br /&gt;
 sudo apt-get install musl-dev&lt;br /&gt;
 sudo  ln -s /usr/lib/x86_64-linux-musl/libc.so /lib/libc.musl-x86_64.so.1&lt;br /&gt;
&lt;br /&gt;
Usage:&lt;br /&gt;
 gdrive download 0B7_OwkDsUIgFWXA1B2FPQfV5S8H&lt;br /&gt;
&lt;br /&gt;
Rate limiting example:&lt;br /&gt;
 gdrive download --stdout 0B7_OwkDsUIgFWXA1B2FPQfV5S8H | \&lt;br /&gt;
    pv -br -L 90k | cat &amp;gt; file.ext&lt;br /&gt;
&lt;br /&gt;
Issue: (caused by missing musl)&lt;br /&gt;
 # gdrive&lt;br /&gt;
 -bash: /usr/local/bin/gdrive: No such file or directory&lt;br /&gt;
&lt;br /&gt;
 # ldd /usr/local/bin/gdrive&lt;br /&gt;
         linux-vdso.so.1 (0x00007ffc29757000)&lt;br /&gt;
         libc.musl-x86_64.so.1 =&amp;gt; not found&lt;br /&gt;
&lt;br /&gt;
ref: https://stackoverflow.com/questions/25010369/wget-curl-large-file-from-google-drive/39225039#39225039&lt;br /&gt;
&lt;br /&gt;
ref: https://github.com/prasmussen/gdrive/releases/tag/2.1.1&lt;br /&gt;
&lt;br /&gt;
ref: https://github.com/alexander-akhmetov/python-telegram/issues/3&lt;br /&gt;
&lt;br /&gt;
== keywords ==&lt;br /&gt;
&lt;br /&gt;
[[Category:Cloud Storage]]&lt;/div&gt;</summary>
		<author><name>Kenneth</name></author>
	</entry>
</feed>