878 字
4 分鐘
使用Google-cloud下載BT資源

介紹#

Google-cloud 有提供免費 300 美金的試用,不想架設網站的話剛好可以使用架設雲端下載 BT 並達到離線下載功能,為什麼要用雲端下載呢? 因為使用 BT 下載任何版權東西盡量不要使用自己網路,可避免有法律問題,雲端網路速度極快下載非常快速,只需要安裝兩樣就可快速架設完成,在 Coogle-cloud 安裝 docker、Cloud Torrent(在新分頁開啟)。

下載功能cloud-torrent01#

Cloud Torrent(在新分頁開啟)#

Cloud Torrent(在新分頁開啟)像是一個下載器,在雲端中下載資源的程式,可下載普通資源及 BT 資源,來看看怎麼快速安裝。

需要安裝項目#

  • docker
  • Cloud Torrent

註冊 cloud#

網址:cloud.google.com(在新分頁開啟)
如果不會註冊,可以 google 搜尋一下” google cloud 註冊教學 ” 會有很多教學。

建立虛擬器 VM#

區域建議選非自己國家區域的,其他設定如圖。cloud-torrent02

作業系統設定#

選擇 Ubuntu 16.04 LTS 或是 Ubuntu 18 也可以
想要下載大檔案,空間可以調大一點,注意:費用會增加,硬碟空間建立之後也可以在調整。cloud-torrent03 cloud-torrent04

將動態 IP 設定為固定 IP#

VPC > 外部 IP 位址cloud-torrent05

選擇臨時 > 靜態
名稱 > 保留cloud-torrent06

進入 SSHcloud-torrent07#

更新 Ubuntb#

非常重要,少了執行這個更新會無法安裝 docker

Terminal window
sudo apt-get update

安裝 docker#

Terminal window
sudo apt-get install docker.io

cloud-torrent08

安裝 linux-image-extra#

如果有錯誤也沒關西不會影響到。

Terminal window
sudo apt-get install \
linux-image-extra-$(uname -r) \
linux-image-extra-virtual

安裝 colud-torrent#

如果想要使用密碼登入網站請至下面看如何建立有密碼的方法。

Terminal window
sudo docker run --name ct -d -p 80:80 \
--restart always \
-v /root/downloads:/downloads \
jpillora/cloud-torrent --port 80

cloud-torrent09

開啟 colud-torrent#

http://你的(在新分頁開啟) ip/
例如:http://125.55.66.11/(在新分頁開啟)

注意網址不要有 https 會無法進入網頁

關機,不浪費錢#

沒在使用下載一直開機會很燒錢。cloud-torrent10

刪除 docker 建立的守護程序

Terminal window
sudo docker ps -a #查詢現有的守護程序 例如守護程序ID是 8d6e95844372
sudo docker stop 8d6e95844372 #停止 必須先停止才能刪除
sudo docker rm 8d6e95844372 #刪除
sudo docker start **CONTAINER ID** #啟動

設置指令#

進入 docker 容器#

sudo docker ps -a #查詢現有的守護程序 例如守護程序ID是 8d6e95844372
sudo docker attach 8d6e95844372

使用 docker 指令文章
(在新分頁開啟)https://yeasy.gitbooks.io/docker_practice/container/attach_exec.html(在新分頁開啟)

選項#

Terminal window
Options:
--title, -t Title of this instance (default Cloud Torrent, env TITLE)
--port, -p Listening port (default 3000, env PORT)
--host, -h Listening interface (default all)
--auth, -a Optional basic auth in form 'user:password' (env AUTH)
--config-path, -c Configuration file path (default cloud-torrent.json)
--key-path, -k TLS Key file path
--cert-path, -r TLS Certicate file path
--log, -l Enable request logging
--open, -o Open now with your default browser
--help
--version, -v

刪除容器#

Terminal window
sudo docker container rm id容器的ID
如果要刪除一個運行中的容器,可以添加 -f 參數。Docker 會發送 SIGKILL 信號給容器。

建立容器並安裝 cloud-torrent 及密碼設定#

建立容器

Terminal window
sudo docker run -d -p 3000:3000 --restart always \
-v /root/downloads:/downloads \
--name cloud-torrent jpillora/cloud-torrent \
--auth 帳號:密碼

可使用 80 如果要使用 3000 防火牆需要開啟 3000port

參考資料:

使用Google-cloud下載BT資源
https://aishuafei.com/posts/使用google-cloud下載bt資源/
作者
愛耍廢
發佈於
2020-02-05
許可協議
CC BY-NC-SA 4.0