久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

使用 Python 下載共享的 Google Drive 文件夾

Download Shared Google Drive Folder with Python(使用 Python 下載共享的 Google Drive 文件夾)
本文介紹了使用 Python 下載共享的 Google Drive 文件夾的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學(xué)習(xí)吧!

問題描述

我在谷歌驅(qū)動器上有一個只有 .jpg 圖像的文件夾,我想使用該文件夾的共享鏈接將文件夾中的所有圖像下載到我的計算機.

I have a folder on the google drive with just .jpg images and I want to download all of the images in the folder to my computer using the folder's shared link.

到目前為止,我發(fā)現(xiàn)唯一有效的是下面的代碼,但我只能讓它適用于特定的共享文件,而不是整個文件夾.

So far, the only thing that I have found that works is the code below but I can only get it to work for specific shared files and not an entire folder.

from google_drive_downloader import GoogleDriveDownloader as gdd

gdd.download_file_from_google_drive(file_id='1viW3guJTZuEFcx1-ivCL2aypDNLckEMh',
                                    dest_path='./data/mnist.zip',
                                    unzip=True)

有沒有辦法修改它以使用 google 文件夾,或者是否有其他方法可以下載 google drive 文件夾?

Is there a way to modify this to work with google folders or is there another way to download google drive folders?

推薦答案

你可以使用gdrive 工具.基本上它是一個從命令行訪問谷歌驅(qū)動器帳戶的工具.按照這個 Linux 機器的示例進行設(shè)置:

You can use the gdrive tool. Basically it is a tool to access a google drive account from command-line. Follow this example for a Linux machine to set this up:

  1. 首先下載gdrive的執(zhí)行文件這里.
  2. 解壓得到可執(zhí)行文件gdrive.現(xiàn)在通過執(zhí)行命令更改文件的權(quán)限chmod +x gdrive.
  3. 運行./gdrive about,你會得到一個URL,要求你輸入驗證碼.按照提示復(fù)制鏈接并轉(zhuǎn)到您的瀏覽器上的 URL,然后登錄您的 Google Drive 帳戶并授予權(quán)限.最后你會得到一些驗證碼.復(fù)制它.
  4. 返回之前的終端,粘貼剛剛復(fù)制的驗證碼.然后驗證你的信息在那里.現(xiàn)在您已成功將您的機器鏈接到您的 Google Drive帳戶.
  1. At first download the execution file of gdrive here.
  2. Decompress it and get the executable file gdrive. Now change the permissions of the file by executing the command chmod +x gdrive.
  3. Run ./gdrive about and you will get a URL asking you to enter for a verification code. As instructed in the prompt copy the link and go to the URL on your browser, then log into your Google Drive account and grant permission. You will get some verification code at last. Copy it.
  4. Go back to your previous terminal and paste the verification code you just copied. Then verify your information there. Now you successfully link your machine to your Google Drive account.

現(xiàn)在完成上述過程后,您可以使用下面提到的命令瀏覽驅(qū)動器上的文件.

Now once done with the above process you can navigate the files on your drive using the commands mentioned below.

./gdrive list # List all files' information in your account
./gdrive list -q "name contains 'University'" # serch files by name
./gdrive download fileID # Download some file. You can find the fileID from the 'gdrive list' result.
./gdrive upload filename  #  Upload a local file to your google drive account.
./gdrive mkdir # Create new folder

希望這會有所幫助.

這篇關(guān)于使用 Python 下載共享的 Google Drive 文件夾的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

【網(wǎng)站聲明】本站部分內(nèi)容來源于互聯(lián)網(wǎng),旨在幫助大家更快的解決問題,如果有圖片或者內(nèi)容侵犯了您的權(quán)益,請聯(lián)系我們刪除處理,感謝您的支持!

相關(guān)文檔推薦

Troubles while parsing with python very large xml file(使用 python 解析非常大的 xml 文件時出現(xiàn)問題)
Find all nodes by attribute in XML using Python 2(使用 Python 2 在 XML 中按屬性查找所有節(jié)點)
Python - How to parse xml response and store a elements value in a variable?(Python - 如何解析 xml 響應(yīng)并將元素值存儲在變量中?)
How to get XML tag value in Python(如何在 Python 中獲取 XML 標(biāo)記值)
How to correctly parse utf-8 xml with ElementTree?(如何使用 ElementTree 正確解析 utf-8 xml?)
Parse XML from URL into python object(將 XML 從 URL 解析為 python 對象)
主站蜘蛛池模板: 免费观看黄色片视频 | 欧洲视频一区二区 | 91精品一区二区三区久久久久久 | 一区二区在线看 | 国产在线视频网 | 国产情侣激情 | 欧美一级淫片免费视频黄 | 亚洲国产小视频 | 成在线人视频免费视频 | 国产精品久久久久久久久动漫 | 91在线看| 国产综合精品一区二区三区 | 日韩一区二区三区视频 | 91久久| 国产精品网址 | 久久88| 九九在线视频 | 国产免费一区 | 麻豆精品一区二区三区在线观看 | 日韩视频在线免费观看 | 久久久亚洲一区 | 日韩人体视频 | 你懂的在线视频播放 | 日韩在线中文 | 天堂网中文 | 免费一级做a爰片久久毛片潮喷 | 国产精品美女久久久久久免费 | 91人人看 | 国产欧美精品一区二区三区 | 欧美精品在欧美一区二区 | 99热精品在线 | 欧美国产日韩一区二区三区 | 国产福利91精品一区二区三区 | 色欧美综合 | 色婷婷国产精品综合在线观看 | 国产 欧美 日韩 一区 | 亚洲3级| 男人阁久久 | 国产免费一区二区三区 | 久久久精品视频免费 | 欧美一区二区三区在线观看 |