全球主机交流论坛

 找回密码
 注册

QQ登录

只需一步,快速开始

CeraNetworks网络延迟测速工具IP归属甄别会员请立即修改密码
查看: 1923|回复: 19

用GCP白票中转与下载

[复制链接]
发表于 2020-5-14 02:12:32 | 显示全部楼层 |阅读模式
本帖最后由 铅笔 于 2020-5-14 14:44 编辑

  由于GCP到gdrive的流量是免费的,所以可以用aria2离线下载上传GCP团队盘 再通过CF搭建的GDindex下载也可以用于中转 只要aria2能下载的都可以中转到团队盘

GCP流量说明


GCP切换ROOT登陆
  1. sudo -i   //切换到root用户
  2. vi /etc/ssh/sshd_config //编辑文件
  3. # Authentication:
  4. PermitRootLogin yes //默认为no,需要开启root用户访问改为yes
  5. # Change to no to disable tunnelled clear text passwords
  6. PasswordAuthentication yes //默认为no,改为yes开启密码登陆
  7. 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

挂载团队盘
  1. root@aria2:~# rclone config
  2. 2020/05/13 16:47:25 NOTICE: Config file "/root/.config/rclone/rclone.conf" not found - using defaults
  3. No remotes found - make a new one
  4. n) New remote
  5. s) Set configuration password
  6. q) Quit config
  7. n/s/q> n #选择新建用户
  8. name> aria #用户名
  9. Type of storage to configure.
  10. Enter a string value. Press Enter for the default ("").
  11. Choose a number from below, or type in your own value
  12. 1 / 1Fichier
  13.    \ "fichier"
  14. 2 / Alias for an existing remote
  15.    \ "alias"
  16. 3 / Amazon Drive
  17.    \ "amazon cloud drive"
  18. 4 / Amazon S3 Compliant Storage Provider (AWS, Alibaba, Ceph, Digital Ocean, Dreamhost, IBM COS, Minio, etc)
  19.    \ "s3"
  20. 5 / Backblaze B2
  21.    \ "b2"
  22. 6 / Box
  23.    \ "box"
  24. 7 / Cache a remote
  25.    \ "cache"
  26. 8 / Citrix Sharefile
  27.    \ "sharefile"
  28. 9 / Dropbox
  29.    \ "dropbox"
  30. 10 / Encrypt/Decrypt a remote
  31.    \ "crypt"
  32. 11 / FTP Connection
  33.    \ "ftp"
  34. 12 / Google Cloud Storage (this is not Google Drive)
  35.    \ "google cloud storage"
  36. 13 / Google Drive
  37.    \ "drive"
  38. 14 / Google Photos
  39.    \ "google photos"
  40. 15 / Hubic
  41.    \ "hubic"
  42. 16 / In memory object storage system.
  43.    \ "memory"
  44. 17 / JottaCloud
  45.    \ "jottacloud"
  46. 18 / Koofr
  47.    \ "koofr"
  48. 19 / Local Disk
  49.    \ "local"
  50. 20 / Mail.ru Cloud
  51.    \ "mailru"
  52. 21 / Mega
  53.    \ "mega"
  54. 22 / Microsoft Azure Blob Storage
  55.    \ "azureblob"
  56. 23 / Microsoft OneDrive
  57.    \ "onedrive"
  58. 24 / OpenDrive
  59.    \ "opendrive"
  60. 25 / Openstack Swift (Rackspace Cloud Files, Memset Memstore, OVH)
  61.    \ "swift"
  62. 26 / Pcloud
  63.    \ "pcloud"
  64. 27 / Put.io
  65.    \ "putio"
  66. 28 / QingCloud Object Storage
  67.    \ "qingstor"
  68. 29 / SSH/SFTP Connection
  69.    \ "sftp"
  70. 30 / Sugarsync
  71.    \ "sugarsync"
  72. 31 / Transparently chunk/split large files
  73.    \ "chunker"
  74. 32 / Union merges the contents of several remotes
  75.    \ "union"
  76. 33 / Webdav
  77.    \ "webdav"
  78. 34 / Yandex Disk
  79.    \ "yandex"
  80. 35 / http Connection
  81.    \ "http"
  82. 36 / premiumize.me
  83.    \ "premiumizeme"
  84. Storage> 13 #选择Google Drive
  85. ** See help for drive backend at: https://rclone.org/drive/ **

  86. Google Application Client Id
  87. Setting your own is recommended.
  88. See https://rclone.org/drive/#making-your-own-client-id for how to create your own.
  89. If you leave this blank, it will use an internal key which is low performance.
  90. Enter a string value. Press Enter for the default ("").
  91. client_id>
  92. Google Application Client Secret
  93. Setting your own is recommended.
  94. Enter a string value. Press Enter for the default ("").
  95. client_secret>
  96. Scope that rclone should use when requesting access from drive.
  97. Enter a string value. Press Enter for the default ("").
  98. Choose a number from below, or type in your own value
  99. 1 / Full access all files, excluding Application Data Folder.
  100.    \ "drive"
  101. 2 / Read-only access to file metadata and file contents.
  102.    \ "drive.readonly"
  103.    / Access to files created by rclone only.
  104. 3 | These are visible in the drive website.
  105.    | File authorization is revoked when the user deauthorizes the app.
  106.    \ "drive.file"
  107.    / Allows read and write access to the Application Data folder.
  108. 4 | This is not visible in the drive website.
  109.    \ "drive.appfolder"
  110.    / Allows read-only access to file metadata but
  111. 5 | does not allow any access to read or download file content.
  112.    \ "drive.metadata.readonly"
  113. scope> 1
  114. ID of the root folder
  115. Leave blank normally.

  116. Fill in to access "Computers" folders (see docs), or for rclone to use
  117. a non root folder as its starting point.

  118. Note that if this is blank, the first time rclone runs it will fill it
  119. in with the ID of the root folder.

  120. Enter a string value. Press Enter for the default ("").
  121. root_folder_id> 0AGeamfYP7phQUk9PVA  
  122. Service Account Credentials JSON file path
  123. Leave blank normally.
  124. Needed only if you want use SA instead of interactive login.
  125. Enter a string value. Press Enter for the default ("").
  126. service_account_file>
  127. Edit advanced config? (y/n)
  128. y) Yes
  129. n) No (default)
  130. y/n> n #选择N
  131. Remote config
  132. Use auto config?
  133. * Say Y if not sure
  134. * Say N if you are working on a remote or headless machine
  135. y) Yes (default)
  136. n) No
  137. y/n> n 选择N
  138. 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
  139.   #复制地址到浏览器登录授权 然后粘贴授权码
  140. Log in and authorize rclone for access
  141. Enter verification code> *********** #此处写团队盘的ID
  142. Configure this as a team drive?
  143. y) Yes
  144. n) No (default)
  145. y/n> n 选择N
  146. --------------------
  147. [aria]
  148. type = drive
  149. scope = drive
  150. root_folder_id = ********************
  151. token = {"access_token":"******************************************************************","token_type":"Bearer","refresh_token":"********************************************","expiry":"2020-05-13T17:48:29.937342798Z"}
  152. --------------------
  153. y) Yes this is OK (default)
  154. e) Edit this remote
  155. d) Delete this remote
  156. y/e/d> y #选择Y确认
  157. Current remotes:

  158. Name                 Type
  159. ====                 ====
  160. aria                 drive

  161. e) Edit existing remote
  162. n) New remote
  163. d) Delete remote
  164. r) Rename remote
  165. c) Copy remote
  166. s) Set configuration password
  167. q) Quit config
  168. e/n/d/r/c/s/q> 选择q退出
复制代码


安装aria2
  1. 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

速度测试

发表于 2020-5-14 03:00:06 来自手机 | 显示全部楼层
为什么不用heroku,甚至不用开服务器
 楼主| 发表于 2020-5-14 03:00:47 | 显示全部楼层
海苔 发表于 2020-5-14 03:00
为什么不用heroku,甚至不用开服务器

heroku没事就封
发表于 2020-5-14 06:43:37 来自手机 | 显示全部楼层
cf慢的一批,谁能在线播放?
Josephus 该用户已被删除
发表于 2020-5-14 06:45:00 | 显示全部楼层
提示: 作者被禁止或删除 内容自动屏蔽
发表于 2020-5-14 06:56:47 | 显示全部楼层
不错 感谢分享 mark
 楼主| 发表于 2020-5-14 14:10:33 | 显示全部楼层
reidme 发表于 2020-5-14 06:43
cf慢的一批,谁能在线播放?

idm多线程下载 基本可以满速宽带 在线观看我试过了 我这边南方电信没问题…
发表于 2020-5-14 14:17:48 | 显示全部楼层
gcp硬盘收费怎么样
您需要登录后才可以回帖 登录 | 注册

本版积分规则

Archiver|手机版|小黑屋|全球主机交流论坛

GMT+8, 2024-4-20 04:47 , Processed in 0.065388 second(s), 10 queries , Gzip On, MemCache On.

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表