Page 2 of 2

Re: Torrents won't delete

Posted: Wed May 27, 2020 3:56 am
by nSpectre
Thanks for that, novamanus.

I tried it in 3.8 but just get a ModuleNotFoundError: No module named 'deluge.libtorrent':

Code: Select all

File "/usr/lib/python3/dist-packages/deluge/_libtorrent.py", line 23, in <module>
    import deluge.libtorrent as lt
ModuleNotFoundError: No module named 'deluge.libtorrent'
Do you by chance have a clue for the clueless like me? :D

I did confirm that that file does exist at that path.

I do notice that the error produced is missing an underscore in the line "import deluge.libtorrent as lt" and the example given in _libtorrent.py does have an underscore. Yet the uncommented code in _libtorrent.py doesn't use an underscore. Which just makes me go cross-eyed.

I dorked around with it a bit by adding underscores, but then it just threw all kinds of other errors so I gave up. I don't know jack about Python. :)

Re: Torrents won't delete

Posted: Wed May 27, 2020 4:52 am
by novamanus
Hi nSpectre.

Sure, lets see if we can get this to work for you.

First thing, can you post the commands you ran? We shouldn't be importing from deluge.libtorrent with this script.

Also, off the top of my head from seeing that error message, I'd ask if there's a deluge-dev or similar development/header package that you can install.

Re: Torrents won't delete

Posted: Wed May 27, 2020 6:36 am
by nSpectre
Sorry. Got busy.

I'll try again tomorrow evening. :)

Re: Torrents won't delete

Posted: Mon Jul 06, 2020 3:45 pm
by granjerox
Thanks @novamanus it worked like a charm.

Ubuntu 18.04

Code: Select all

granjerox@nuc:~$ lsb_release -a
No LSB modules are available.
Distributor ID:	Ubuntu
Description:	Ubuntu 18.04.4 LTS
Release:	18.04
Codename:	bionic
Python3.6

Code: Select all

granjerox@nuc:~$ dpkg -l |egrep 'python3-six|python3\s+3'
ii  python3         3.6.7-1~18.04   amd64  interactive high-level object-oriented language (default python3 version)
ii  python3-six     1.11.0-2        all    Python 2 and 3 compatibility library (Python 3 interface)
deluge 2.1.1

Code: Select all

granjerox@nuc:~$ dpkg -l |grep deluge
ii  deluge-common    2.1.1~dev7516+23a48dd-202005101213~ubuntu18.04.1   all   Deluge Common Files
ii  deluge-console   2.1.1~dev7516+23a48dd-202005101213~ubuntu18.04.1   all   Deluge Console UI
ii  deluge-gtk       2.1.1~dev7516+23a48dd-202005101213~ubuntu18.04.1   all   Deluge GTK UI
ii  deluge-web       2.1.1~dev7516+23a48dd-202005101213~ubuntu18.04.1   all   Deluge Web UI
ii  deluged          2.1.1~dev7516+23a48dd-202005101213~ubuntu18.04.1   all   Deluge Daemon (deluged)

Re: Torrents won't delete

Posted: Mon Jul 06, 2020 3:49 pm
by novamanus
Awesome, I'm glad to hear it!

Re: Torrents won't delete

Posted: Wed Aug 24, 2022 2:15 am
by GoodNewsEveryone
This was happening to me as well. I tried the previous suggestion, but was getting the missing libtorrent module no matter what I tried.

I found a solution though, incredibly simple it's kind of funny. Just go to the state folder and delete the torrent there.

First you need to find the hash of the torrent you want to delete by clicking on the torrent and going to details in the bottom panel. Like novamanus said it might disappear. If that happens just hard reset Deluge and you should be able to find it.

If you're on windows navigate to C:\Users\YOURUSERNAME\AppData\Roaming\deluge\state

You'll see a list of torrent files there, find the one that has the same hash as the torrent you want to delete then delete that file.

It worked for me so far with no problems.