# Transfer error ...from torrent to gdrive....using colab

**URL:** <https://onehack.st/t/transfer-error-from-torrent-to-gdrive-using-colab/173617>\
**Category:** Discussion & Solutions\
**Tags:** solved\
**Created:** [February 24, 2021, 5:16pm UTC](https://onehack.st/t/transfer-error-from-torrent-to-gdrive-using-colab/173617 "2021-02-24T17:16:21Z")\
**Posts on this page:** 18\
**Page:** 1

<div class="post-metadata">

**Author:** ![john\_corner](https://onehack.st/user_avatar/onehack.st/john_corner/32/40688_2.png) [@john\_corner](https://onehack.st/u/john_corner)\
**Post date:** [February 24, 2021, 5:16pm UTC](https://onehack.st/t/transfer-error-from-torrent-to-gdrive-using-colab/173617/1 "2021-02-24T17:16:21Z")

</div>

![1](https://onehack.st/uploads/default/original/3X/7/2/72543d0e10521416bd8e42e05ddff4c9467dd304.png)

👇 👇🏽

Reading package lists… Done  
Building dependency tree  
Reading state information… Done  
The following additional packages will be installed:  
libtorrent-rasterbar9  
Suggested packages:  
libtorrent-rasterbar-dbg  
The following NEW packages will be installed:  
libtorrent-rasterbar9 python3-libtorrent  
0 upgraded, 2 newly installed, 0 to remove and 11 not upgraded.  
Need to get 1,569 kB of archives.  
After this operation, 5,718 kB of additional disk space will be used.  
Get:1 [http://archive.ubuntu.com/ubuntu](http://archive.ubuntu.com/ubuntu) bionic/universe amd64 libtorrent-rasterbar9 amd64 1.1.5-1build1 [1,258 kB]  
Get:2 [http://archive.ubuntu.com/ubuntu](http://archive.ubuntu.com/ubuntu) bionic/universe amd64 python3-libtorrent amd64 1.1.5-1build1 [310 kB]  
Fetched 1,569 kB in 0s (13.8 MB/s)  
Selecting previously unselected package libtorrent-rasterbar9.  
(Reading database … 149414 files and directories currently installed.)  
Preparing to unpack …/libtorrent-rasterbar9\_1.1.5-1build1\_amd64.deb …  
Unpacking libtorrent-rasterbar9 (1.1.5-1build1) …  
Selecting previously unselected package python3-libtorrent.  
Preparing to unpack …/python3-libtorrent\_1.1.5-1build1\_amd64.deb …  
Unpacking python3-libtorrent (1.1.5-1build1) …  
Setting up libtorrent-rasterbar9 (1.1.5-1build1) …  
Setting up python3-libtorrent (1.1.5-1build1) …  
Processing triggers for libc-bin (2.27-3ubuntu1.4) …  
/sbin/ldconfig.real: /usr/local/lib/python3.7/dist-packages/ideep4py/lib/libmkldnn.so.0 is not a symbolic link

* * *

ModuleNotFoundError Traceback (most recent call last)  
 in ()  
8 get\_ipython().system(‘apt install python3-libtorrent’)  
9  
—\> 10 import libtorrent as lt  
11  
12 ses = lt.session()

ModuleNotFoundError: No module named ‘libtorrent’

* * *

---

<div class="post-metadata">

**Author:** ![BadFella](https://onehack.st/user_avatar/onehack.st/badfella/32/88045_2.png) [@BadFella](https://onehack.st/u/BadFella)\
**Post date:** [February 24, 2021, 5:23pm UTC](https://onehack.st/t/transfer-error-from-torrent-to-gdrive-using-colab/173617/2 "2021-02-24T17:23:35Z")

</div>

Use this code instead:

!apt install python3-libtorrent

import libtorrent as lt

ses = lt.session()  
ses.listen\_on(6881, 6891)  
downloads =

Just running !apt install python3-libtorrent won’t do anything

---

<div class="post-metadata">

**Author:** ![david\_das](https://onehack.st/user_avatar/onehack.st/david_das/32/20415_2.png) [@david\_das](https://onehack.st/u/david_das)\
**Post date:** [February 24, 2021, 6:03pm UTC](https://onehack.st/t/transfer-error-from-torrent-to-gdrive-using-colab/173617/3 "2021-02-24T18:03:27Z")

</div>

@BadFella , doesn’t work bro… No module named libtorrent. until yesterday , it was working fine.

---

<div class="post-metadata">

**Author:** ![BadFella](https://onehack.st/user_avatar/onehack.st/badfella/32/88045_2.png) [@BadFella](https://onehack.st/u/BadFella)\
**Post date:** [February 24, 2021, 6:30pm UTC](https://onehack.st/t/transfer-error-from-torrent-to-gdrive-using-colab/173617/4 "2021-02-24T18:30:37Z")

</div>

![image](https://onehack.st/uploads/default/original/3X/b/5/b555fab35e58c36e04472180f8efa1bd3bfb15de.png)

Use this:

!apt install libtorrent-rasterbar9

import libtorrent as lt

ses = lt.session()

ses.listen\_on(6881, 6891)

downloads =

---

<div class="post-metadata">

**Author:** ![david\_das](https://onehack.st/user_avatar/onehack.st/david_das/32/20415_2.png) [@david\_das](https://onehack.st/u/david_das)\
**Post date:** [February 24, 2021, 6:39pm UTC](https://onehack.st/t/transfer-error-from-torrent-to-gdrive-using-colab/173617/5 "2021-02-24T18:39:13Z")

</div>

@BadFella , same “No Module” error bro. I think it’s blocked…saw some videos on youtube and a lot people complaining about it not working anymore.

---

<div class="post-metadata">

**Author:** ![BadFella](https://onehack.st/user_avatar/onehack.st/badfella/32/88045_2.png) [@BadFella](https://onehack.st/u/BadFella)\
**Post date:** [February 24, 2021, 6:40pm UTC](https://onehack.st/t/transfer-error-from-torrent-to-gdrive-using-colab/173617/6 "2021-02-24T18:40:51Z")

</div>

I ran these two commands before running the above and it worked fine for me:

 ![image](https://onehack.st/uploads/default/original/3X/a/1/a16cafccdd70d7247b774c5dc6855794a82e6878.png)

---

<div class="post-metadata">

**Author:** ![david\_das](https://onehack.st/user_avatar/onehack.st/david_das/32/20415_2.png) [@david\_das](https://onehack.st/u/david_das)\
**Post date:** [February 24, 2021, 6:51pm UTC](https://onehack.st/t/transfer-error-from-torrent-to-gdrive-using-colab/173617/7 "2021-02-24T18:51:04Z")

</div>

@BadFella , that worked but now python colab script is not working giving some KeyError: ‘unknown name in torrent params: paused’. Can you please share the colab notebook you are using

---

<div class="post-metadata">

**Author:** ![Anvo\_Saka](https://onehack.st/user_avatar/onehack.st/anvo_saka/32/76447_2.png) [@Anvo\_Saka](https://onehack.st/u/Anvo_Saka)\
**Post date:** [February 24, 2021, 7:46pm UTC](https://onehack.st/t/transfer-error-from-torrent-to-gdrive-using-colab/173617/8 "2021-02-24T19:46:22Z")

</div>

thanks brother it worked for me. i was also finding the solution for many hours and your code worked

---

<div class="post-metadata">

**Author:** ![omi](https://onehack.st/user_avatar/onehack.st/omi/32/20767_2.png) [@omi](https://onehack.st/u/omi)\
**Post date:** [February 25, 2021, 4:11am UTC](https://onehack.st/t/transfer-error-from-torrent-to-gdrive-using-colab/173617/10 "2021-02-25T04:11:37Z")

</div>

Thank you 🤩

---

<div class="post-metadata">

**Author:** ![Shiv\_Raj\_Saran](https://onehack.st/user_avatar/onehack.st/shiv_raj_saran/32/68890_2.png) [@Shiv\_Raj\_Saran](https://onehack.st/u/Shiv_Raj_Saran)\
**Post date:** [February 27, 2021, 2:46pm UTC](https://onehack.st/t/transfer-error-from-torrent-to-gdrive-using-colab/173617/12 "2021-02-27T14:46:08Z")

</div>

I am also facing the same issue. Please somebody help.

---

<div class="post-metadata">

**Author:** ![dillu\_dilsa](https://onehack.st/user_avatar/onehack.st/dillu_dilsa/32/30553_2.png) [@dillu\_dilsa](https://onehack.st/u/dillu_dilsa)\
**Post date:** [February 27, 2021, 3:02pm UTC](https://onehack.st/t/transfer-error-from-torrent-to-gdrive-using-colab/173617/13 "2021-02-27T15:02:36Z")

</div>

could anyone share the colab file plz

---

<div class="post-metadata">

**Author:** ![Aryaman\_Purkait](https://onehack.st/user_avatar/onehack.st/aryaman_purkait/32/96918_2.png) [@Aryaman\_Purkait](https://onehack.st/u/Aryaman_Purkait)\
**Post date:** [February 27, 2021, 5:37pm UTC](https://onehack.st/t/transfer-error-from-torrent-to-gdrive-using-colab/173617/14 "2021-02-27T17:37:05Z")

</div>

Open Colab  
Add the following lines in separate code segments. (New code after every line break.)

**Install libtorrent and Initialize Session**

!python -m pip install --upgrade pip setuptools wheel

!python -m pip install lbry-libtorrent

!apt install libtorrent-rasterbar9  
import libtorrent as lt  
ses = lt.session()  
ses.listen\_on(6881, 6891)  
downloads = [remove this text]

**Mount Google Drive**

from google.colab import drive  
drive.mount(“/content/drive”)

**Add From Magnet Link**

params = {“save\_path”: “OUTPUT\_FILE\_PATH”}  
while True:  
magnet\_link = input("Enter Magnet Link Or Type Exit: ")  
if magnet\_link.lower() == “exit”:  
break  
downloads.append(  
lt.add\_magnet\_uri(ses, magnet\_link, params)  
)

**Add From Torrent File**

from google.colab import files  
source = files.upload()  
params = {  
“save\_path”: “OUTPUT\_FILE\_PATH”,  
“ti”: lt.torrent\_info(list(source.keys())[0]),  
}  
downloads.append(ses.add\_torrent(params))

**Check Download Progress**

import time  
from IPython.display import display  
import ipywidgets as widgets  
state\_str = [  
“queued”,  
“checking”,  
“downloading metadata”,  
“downloading”,  
“finished”,  
“seeding”,  
“allocating”,  
“checking fastresume”,  
]  
layout = widgets.Layout(width=“auto”)  
style = {“description\_width”: “initial”}  
download\_bars = [  
widgets.FloatSlider(  
step=0.01, disabled=True, layout=layout, style=style  
)  
for \_ in downloads  
]  
display(\*download\_bars)  
while downloads:  
next\_shift = 0  
for index, download in enumerate(downloads[:]):  
bar = download\_bars[index + next\_shift]  
if not download.is\_seed():  
s = download.status()  
bar.description = " ".join(  
[  
download.name(),  
str(s.download\_rate / 1000),  
“kB/s”,  
state\_str[s.state],  
]  
)  
bar.value = s.progress \* 100  
else:  
next\_shift -= 1  
ses.remove\_torrent(download)  
downloads.remove(download)  
bar.close()  
download\_bars.remove(bar)  
print(download.name(), “complete”)  
time.sleep(1)

---

<div class="post-metadata">

**Author:** ![M\_annonymous](https://onehack.st/user_avatar/onehack.st/m_annonymous/32/19269_2.png) [@M\_annonymous](https://onehack.st/u/M_annonymous)\
**Post date:** [February 27, 2021, 6:05pm UTC](https://onehack.st/t/transfer-error-from-torrent-to-gdrive-using-colab/173617/16 "2021-02-27T18:05:24Z")

</div>

Will check iT out LAter

---

<div class="post-metadata">

**Author:** ![dillu\_dilsa](https://onehack.st/user_avatar/onehack.st/dillu_dilsa/32/30553_2.png) [@dillu\_dilsa](https://onehack.st/u/dillu_dilsa)\
**Post date:** [February 28, 2021, 6:34am UTC](https://onehack.st/t/transfer-error-from-torrent-to-gdrive-using-colab/173617/17 "2021-02-28T06:34:35Z")

</div>

> [@Aryaman\_Purkait](#):
>
> !python -m pip install --upgrade pip setuptools wheel
> 
> !python -m pip install lbry-libtorrent
> 
> !apt install libtorrent-rasterbar9  
> import libtorrent as lt  
> ses = lt.session()  
> ses.listen\_on(6881, 6891)  
> downloads = [remove this text]

it worked buddy thanx

---

<div class="post-metadata">

**Author:** ![whobeee](https://onehack.st/user_avatar/onehack.st/whobeee/32/84406_2.png) [@whobeee](https://onehack.st/u/whobeee)\
**Post date:** [February 28, 2021, 10:57am UTC](https://onehack.st/t/transfer-error-from-torrent-to-gdrive-using-colab/173617/18 "2021-02-28T10:57:45Z")

</div>

no problem

---

<div class="post-metadata">

**Author:** ![john\_corner](https://onehack.st/user_avatar/onehack.st/john_corner/32/40688_2.png) [@john\_corner](https://onehack.st/u/john_corner)\
**Post date:** [February 25, 2021, 4:10am UTC](https://onehack.st/t/transfer-error-from-torrent-to-gdrive-using-colab/173617/9 "2021-02-25T04:10:29Z")

</div>

**Cheers** , mate…its working…  
thanx 😍

---

<div class="post-metadata">

**Author:** ![david\_das](https://onehack.st/user_avatar/onehack.st/david_das/32/20415_2.png) [@david\_das](https://onehack.st/u/david_das)\
**Post date:** [February 25, 2021, 6:24am UTC](https://onehack.st/t/transfer-error-from-torrent-to-gdrive-using-colab/173617/11 "2021-02-25T06:24:11Z")

</div>

@john_corner , bro can please share the colab notebook you’are using. Mine is not working.

---

<div class="post-metadata">

**Author:** ![whobeee](https://onehack.st/user_avatar/onehack.st/whobeee/32/84406_2.png) [@whobeee](https://onehack.st/u/whobeee)\
**Post date:** [February 27, 2021, 5:38pm UTC](https://onehack.st/t/transfer-error-from-torrent-to-gdrive-using-colab/173617/15 "2021-02-27T17:38:02Z")

</div>

![image](https://onehack.st/uploads/default/original/3X/d/1/d13735aee156e766f1d10ccf27be39a2081aef11.png)  
i added those two lines and it worked for me

```auto
!python -m pip install --upgrade pip setuptools wheel
!python -m pip install lbry-libtorrent

```

[Next page](https://onehack.st/t/transfer-error-from-torrent-to-gdrive-using-colab/173617.md?page=2)
