本帖最后由 铅笔 于 2020-5-14 14:44 编辑
由于GCP到gdrive的流量是免费的,所以可以用aria2离线下载上传GCP团队盘 再通过CF搭建的GDindex下载也可以用于中转 只要aria2能下载的都可以中转到团队盘
GCP流量说明
GCP切换ROOT登陆
- sudo -i //切换到root用户
- vi /etc/ssh/sshd_config //编辑文件
- # Authentication:
- PermitRootLogin yes //默认为no,需要开启root用户访问改为yes
- # Change to no to disable tunnelled clear text passwords
- PasswordAuthentication yes //默认为no,改为yes开启密码登陆
- service sshd restart
复制代码
团队盘申请:https://www.hostloc.com/thread-684825-1-1.html
申请完之后登陆点击团队盘 会出现这个地址 https://drive.google.com/drive/folders/********** "*代表团队盘目录ID"
安装rclone
apt install wget curl ca-certificates unzip -y
curl https://rclone.org/install.sh | sudo bash
rclone config
挂载团队盘
- root@aria2:~# rclone config
- 2020/05/13 16:47:25 NOTICE: Config file "/root/.config/rclone/rclone.conf" not found - using defaults
- No remotes found - make a new one
- n) New remote
- s) Set configuration password
- q) Quit config
- n/s/q> n #选择新建用户
- name> aria #用户名
- Type of storage to configure.
- Enter a string value. Press Enter for the default ("").
- Choose a number from below, or type in your own value
- 1 / 1Fichier
- \ "fichier"
- 2 / Alias for an existing remote
- \ "alias"
- 3 / Amazon Drive
- \ "amazon cloud drive"
- 4 / Amazon S3 Compliant Storage Provider (AWS, Alibaba, Ceph, Digital Ocean, Dreamhost, IBM COS, Minio, etc)
- \ "s3"
- 5 / Backblaze B2
- \ "b2"
- 6 / Box
- \ "box"
- 7 / Cache a remote
- \ "cache"
- 8 / Citrix Sharefile
- \ "sharefile"
- 9 / Dropbox
- \ "dropbox"
- 10 / Encrypt/Decrypt a remote
- \ "crypt"
- 11 / FTP Connection
- \ "ftp"
- 12 / Google Cloud Storage (this is not Google Drive)
- \ "google cloud storage"
- 13 / Google Drive
- \ "drive"
- 14 / Google Photos
- \ "google photos"
- 15 / Hubic
- \ "hubic"
- 16 / In memory object storage system.
- \ "memory"
- 17 / JottaCloud
- \ "jottacloud"
- 18 / Koofr
- \ "koofr"
- 19 / Local Disk
- \ "local"
- 20 / Mail.ru Cloud
- \ "mailru"
- 21 / Mega
- \ "mega"
- 22 / Microsoft Azure Blob Storage
- \ "azureblob"
- 23 / Microsoft OneDrive
- \ "onedrive"
- 24 / OpenDrive
- \ "opendrive"
- 25 / Openstack Swift (Rackspace Cloud Files, Memset Memstore, OVH)
- \ "swift"
- 26 / Pcloud
- \ "pcloud"
- 27 / Put.io
- \ "putio"
- 28 / QingCloud Object Storage
- \ "qingstor"
- 29 / SSH/SFTP Connection
- \ "sftp"
- 30 / Sugarsync
- \ "sugarsync"
- 31 / Transparently chunk/split large files
- \ "chunker"
- 32 / Union merges the contents of several remotes
- \ "union"
- 33 / Webdav
- \ "webdav"
- 34 / Yandex Disk
- \ "yandex"
- 35 / http Connection
- \ "http"
- 36 / premiumize.me
- \ "premiumizeme"
- Storage> 13 #选择Google Drive
- ** See help for drive backend at: https://rclone.org/drive/ **
- Google Application Client Id
- Setting your own is recommended.
- See https://rclone.org/drive/#making-your-own-client-id for how to create your own.
- If you leave this blank, it will use an internal key which is low performance.
- Enter a string value. Press Enter for the default ("").
- client_id>
- Google Application Client Secret
- Setting your own is recommended.
- Enter a string value. Press Enter for the default ("").
- client_secret>
- Scope that rclone should use when requesting access from drive.
- Enter a string value. Press Enter for the default ("").
- Choose a number from below, or type in your own value
- 1 / Full access all files, excluding Application Data Folder.
- \ "drive"
- 2 / Read-only access to file metadata and file contents.
- \ "drive.readonly"
- / Access to files created by rclone only.
- 3 | These are visible in the drive website.
- | File authorization is revoked when the user deauthorizes the app.
- \ "drive.file"
- / Allows read and write access to the Application Data folder.
- 4 | This is not visible in the drive website.
- \ "drive.appfolder"
- / Allows read-only access to file metadata but
- 5 | does not allow any access to read or download file content.
- \ "drive.metadata.readonly"
- scope> 1
- ID of the root folder
- Leave blank normally.
- Fill in to access "Computers" folders (see docs), or for rclone to use
- a non root folder as its starting point.
- Note that if this is blank, the first time rclone runs it will fill it
- in with the ID of the root folder.
- Enter a string value. Press Enter for the default ("").
- root_folder_id> 0AGeamfYP7phQUk9PVA
- Service Account Credentials JSON file path
- Leave blank normally.
- Needed only if you want use SA instead of interactive login.
- Enter a string value. Press Enter for the default ("").
- service_account_file>
- Edit advanced config? (y/n)
- y) Yes
- n) No (default)
- y/n> n #选择N
- Remote config
- Use auto config?
- * Say Y if not sure
- * Say N if you are working on a remote or headless machine
- y) Yes (default)
- n) No
- y/n> n 选择N
- Please go to the following link: https://accounts.google.com/o/oauth2/auth?access_type=offline&client_id=202264815644.apps.googleusercontent.com&redirect_uri=urn%3Aietf%3Awg%3Aoauth%3A2.0%3Aoob&response_type=code&scope=https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fdrive&state=OTlPFqRlrfduCyQtQ3nP2w
- #复制地址到浏览器登录授权 然后粘贴授权码
- Log in and authorize rclone for access
- Enter verification code> *********** #此处写团队盘的ID
- Configure this as a team drive?
- y) Yes
- n) No (default)
- y/n> n 选择N
- --------------------
- [aria]
- type = drive
- scope = drive
- root_folder_id = ********************
- token = {"access_token":"******************************************************************","token_type":"Bearer","refresh_token":"********************************************","expiry":"2020-05-13T17:48:29.937342798Z"}
- --------------------
- y) Yes this is OK (default)
- e) Edit this remote
- d) Delete this remote
- y/e/d> y #选择Y确认
- Current remotes:
- Name Type
- ==== ====
- aria drive
- e) Edit existing remote
- n) New remote
- d) Delete remote
- r) Rename remote
- c) Copy remote
- s) Set configuration password
- q) Quit config
- e/n/d/r/c/s/q> 选择q退出
复制代码
安装aria2
- bash <(wget -qO- git.io/aria2.sh)
复制代码
修改配置文件/root/.aria2/aria2.conf
# 全局最大上传速度限制, 运行时可修改, 默认:0
max-overall-upload-limit=100k 改为100K或者更低上传,这个很重要 因为上传是出站第三方流量是算钱的
# 单个任务上传速度限制, 默认:0
max-upload-limit=100k
# 下载完成后执行的命令
把on-download-complete=/root/.aria2/delete.aria2.sh
替换为自动上传脚本 on-download-complete=/root/.aria2/autoupload.sh
修改自动上传脚本 /root/.aria2/autoupload.sh
# Rclone 配置时填写的网盘名(name)
DRIVE_NAME='aria'
# 网盘目录。即上传目标路径,留空为网盘根目录,末尾不要有斜杠。
DRIVE_PATH=''
service aria2 restart #重启aria2
安装GDindex
一键自动安装地址 https://gdindex-code-builder.glitch.me/
ROOT那里写团队盘ID 不写也行 反正全目录的
生成代码放CF workers
预览地址: https://aria.1994917.xyz
速度测试
|