Download torrent to google drive using python and google colaboratory

harsha kuruwita
2 min readDec 5, 2022

--

Using BitTorrent or µTorrent and downloading torrent file to your local computer/Phone is pretty easy for now a day. but there are only few solution to download torrent to cloud drive like seeder, Bitport, ZBigZ but most of them free plane have bandwidth and space limit as well as limited exicution time,

Lets write perfect torent client using python and run on accelerated google’s GPU

What is google colaboratory

Colab is a product from Google Research. Colab allows anybody to write and execute arbitrary python code through the browser, and is especially well suited to machine learning, data analysis and education. More technically, Colab is a hosted Jupyter notebook service that requires no setup to use, while providing access free of charge to computing resources including accelerated GPU and TPU.

Mount google drive to your Colab session

Colab will inizalize session and mount google drive to session. and session can run 12 hours

Create download folder in google drive

Install libtorrent to session

Libtorrent is a feature complete C++ bittorrent implementation focusing on efficiency and scalability. It runs on embedded devices as well as desktops.

Download torent file to google drive folder

The ZIP file format is a common archive and compression standard. This module provides tools to create, read, write, append, and list a ZIP file. we using this to zip and save file to google drive.

The shutil module offers a number of high-level operations on files and collections of files. In particular, functions are provided which support file copying and removal. For operations on individual files

You can access all code with this link

--

--