使用 wget 从 google 驱动器下载一个 exe
Download an exe from google drive using wget
有什么方法可以使用命令从 google 驱动器下载文件吗?每当我尝试这样做时,它都会下载网站的内容,而不是 exe。我正在制作一个自动下载器,只要按下它就会下载最新的补丁。求助!
使用 wget:
wget --no-check-certificate 'https://docs.google.com/uc?export=download&id=FILEID' -O FILENAME
但我使用另一种方式下载文件和文件夹,因为如果您要更改文件,它将使用新的文件 ID。
尝试使用:https://github.com/prasmussen/gdrive for Windows/Linux/Mac
使用drive.exe:
drive download --id 0B3X9GlR6EmbnenBYSFI4MzN0d2M
并且,为了下载文件夹,我编写了 BAT 文件
@echo off
::USAGE: PATH\TO\THISFILE.BAT "ID"
setlocal enabledelayedexpansion
set DRIVEBAT=%PROGRAMFILES%\Google Drive Downloader\drivefolder.bat
set DRIVECONF=%PROGRAMFILES%\Google Drive Downloader\.gdrive
if "%1"=="" exit
set FOLDERID=%1
for /f "usebackq tokens=*" %%a in (`drive -c "%DRIVECONF%" info -i %FOLDERID% ^| find "Title: "`) do (
set "FOLDERNAME=%%a"
set "FOLDERNAME=!FOLDERNAME:Title: =!"
echo Downloading [!FOLDERNAME!] dir...
)
rd /s /q !FOLDERNAME! >nul 2>&1
md "!FOLDERNAME!\"
cd "!FOLDERNAME!\"
for /f "usebackq tokens=1" %%a in (`drive -c "%DRIVECONF%" list -q "'%FOLDERID%' in parents" -n`) do (
drive -c "%DRIVECONF%" download -i %%a >nul || (
echo.
timeout /t 3 >nul 2>&1
start "" cmd.exe /c call "%DRIVEBAT%" "%%a"
)
)
exit
安装蝙蝠:
- 设置 DRIVEBAT=%PROGRAMFILES%\Google 驱动器 Downloader\drivefolder.bat
- set DRIVECONF=%PROGRAMFILES%\Google Drive Downloader\.gdrive
- 添加到 windows 变量 PATH %PROGRAMFILES%\Google Drive Downloader\
- 从 %appdata%\roaming\.gdrive 复制驱动器配置
- 复制 drive.exe 到 %PROGRAMFILES%\Google Drive Downloader\
用法蝙蝠:
cmd.exe /c cd "C:\destenetionfolder" & call "drivefolder.bat" "0FG6kgDTKrk6ERKTY45klDHdldGc"
有什么方法可以使用命令从 google 驱动器下载文件吗?每当我尝试这样做时,它都会下载网站的内容,而不是 exe。我正在制作一个自动下载器,只要按下它就会下载最新的补丁。求助!
使用 wget:
wget --no-check-certificate 'https://docs.google.com/uc?export=download&id=FILEID' -O FILENAME
但我使用另一种方式下载文件和文件夹,因为如果您要更改文件,它将使用新的文件 ID。
尝试使用:https://github.com/prasmussen/gdrive for Windows/Linux/Mac
使用drive.exe:
drive download --id 0B3X9GlR6EmbnenBYSFI4MzN0d2M
并且,为了下载文件夹,我编写了 BAT 文件
@echo off
::USAGE: PATH\TO\THISFILE.BAT "ID"
setlocal enabledelayedexpansion
set DRIVEBAT=%PROGRAMFILES%\Google Drive Downloader\drivefolder.bat
set DRIVECONF=%PROGRAMFILES%\Google Drive Downloader\.gdrive
if "%1"=="" exit
set FOLDERID=%1
for /f "usebackq tokens=*" %%a in (`drive -c "%DRIVECONF%" info -i %FOLDERID% ^| find "Title: "`) do (
set "FOLDERNAME=%%a"
set "FOLDERNAME=!FOLDERNAME:Title: =!"
echo Downloading [!FOLDERNAME!] dir...
)
rd /s /q !FOLDERNAME! >nul 2>&1
md "!FOLDERNAME!\"
cd "!FOLDERNAME!\"
for /f "usebackq tokens=1" %%a in (`drive -c "%DRIVECONF%" list -q "'%FOLDERID%' in parents" -n`) do (
drive -c "%DRIVECONF%" download -i %%a >nul || (
echo.
timeout /t 3 >nul 2>&1
start "" cmd.exe /c call "%DRIVEBAT%" "%%a"
)
)
exit
安装蝙蝠:
- 设置 DRIVEBAT=%PROGRAMFILES%\Google 驱动器 Downloader\drivefolder.bat
- set DRIVECONF=%PROGRAMFILES%\Google Drive Downloader\.gdrive
- 添加到 windows 变量 PATH %PROGRAMFILES%\Google Drive Downloader\
- 从 %appdata%\roaming\.gdrive 复制驱动器配置
- 复制 drive.exe 到 %PROGRAMFILES%\Google Drive Downloader\
用法蝙蝠:
cmd.exe /c cd "C:\destenetionfolder" & call "drivefolder.bat" "0FG6kgDTKrk6ERKTY45klDHdldGc"