[Plugin] CopyMagnetURI v0.2

Suggest, post, or discuss plugins for Deluge
SeriousHoax
Member
Member
Posts: 18
Joined: Sat May 27, 2017 10:40 am

Re: [Plugin] CopyMagnetURI v0.2

Post by SeriousHoax »

Doesn't it work anymore? Tried it on the latest 1.3.15 version. Not showing up in the plugins menu. Tried both automatically & manually, python 2.6 & 2.7 but same result.
pawamoy
New User
New User
Posts: 1
Joined: Sun Dec 09, 2018 1:50 pm

Re: [Plugin] CopyMagnetURI v0.2

Post by pawamoy »

I am SO uninstalling Deluge...

First it was such a pain to configure it in daemon mode to be able to use both GTK and console. Had to read pages of tutorials/manuals. Had to edit a file in /etc. Then the service file itself to point to the right config location. Then modify auth files to set another user:password. Damn. You don't make it easy.

Then Deluge made my whole system lag/freeze with ONLY 100 torrents, 92% of them queued (not seeding, not downloading). What the hell is that?

Now I'm trying to switch to something less problematic, so I want to copy the torrents files or magnets. I CAN'T. Oh there is a plugin. IT DOES NOT WORK. The ticket about this feature for the webui points to this non-working plugin. Tried both 2.6 and 2.7 versions. My system Python is 2.7 so it should work. It does not. Maybe the plugin is too old? I don't know. All I know is that in the end I will have to manually re-create the magnets URI from the hashes and list of trackers...

Bye bye Deluge.

PS: had to express myself. I'm feeling better now. My apologies.

EDIT: found a partial solution: grep "^S'magnet" ~/.config/deluge/state/torrents.state.
Cumva
New User
New User
Posts: 1
Joined: Sat Aug 31, 2019 1:56 am

Re: [Plugin] CopyMagnetURI v0.2

Post by Cumva »

tlm wrote:For anyone desperate to get this working, the fix for 0.2 is actually really simple, but it took me a while to figure out just because I'm not very familiar with the whole Python development thing and these "eggs" and whatnot. Since the developer has since abandoned the plugin, here's the steps to get it working...
viewtopic.php?f=9&t=47501&start=10#p226013

Works like a charm on Windows 10 v1903!
Thanks!
KosherKingOfIsrael
New User
New User
Posts: 1
Joined: Thu Oct 01, 2020 4:40 pm

Re: [Plugin] CopyMagnetURI v0.2

Post by KosherKingOfIsrael »

tlm wrote:For anyone desperate to get this working, the fix for 0.2 is actually really simple, but it took me a while to figure out just because I'm not very familiar with the whole Python development thing and these "eggs" and whatnot. Since the developer has since abandoned the plugin, here's the steps to get it working...
It appears in the plugins list but I can't actually enable it.
own3mall
New User
New User
Posts: 2
Joined: Wed Apr 27, 2022 10:28 pm

Re: [Plugin] CopyMagnetURI v0.2

Post by own3mall »

I'm trying to convert this plugin to be compatible with Deluge 2.X, but I'm running into issues.

I followed this deluge plugin conversion guide, but I'm unable to make the plugin work.

It shows up in the plugin list after I install it, but it won't do anything when I try to activate it.

How do I debug what's going wrong? I've tried deluge -L info and using log.info in my python code, but I'm not seeing any output.

I've attached what I've made so far... hopefully someone can help.
CopyMagnetURI-0.3-py3.8.egg
(13.38 KiB) Downloaded 152 times
mhertz
Moderator
Moderator
Posts: 2191
Joined: Wed Jan 22, 2014 5:05 am
Location: Denmark

Re: [Plugin] CopyMagnetURI v0.2

Post by mhertz »

I checked it, and you just missed a few small things i.e. the 'core' module reference in '__init__.py' also needing preceeded with a dot, like you did with the gtk3ui reference, and I did to webUI likewise. Then same for the 'common' reference in gtk3ui.py and webui.py, Last, there where some space vs tabs diffs in a couple of lines in the gtk3ui.py, so I deleted the tabs and made spaces instead, as per the other adjacent lines.

Good job otherwise mate :)

As per your question of how see the errors, then I just start deluge from a terminal, which will print the errors in that terminal, or could start deluge with debug logging to file enabled, like e.g. 'deluge -L debug -l deluge.log'.

CopyMagnetURI-0.3.egg (I deleted the 'py3.x' part of filename to avoid having to need rename if having other py3 version - not needed for most plugins on deluge 2.0.4+, but regardless)

Last, this functionality has been added to deluge development branch already, and in there implementation they bypass the add-torrent dialog that otherwise would pop up whenever copying magnet, as per the new functionality of deluge 2.0.4 or deluge 2.0,5 cannot remember. I wanted to add this fix to this plugin, but i'm not able to, because it needs to be done in the deluge code itself, as I cannot change the relevant function call of deluge from an external plugin as far as I know atleast(it's called unrelated to plugin from deluge itself in gtkui's mainwindow.py's magnet_copied() function), so whenever copying magnet, then need press cancel to the add-torrent dialog that pops up, well only needed on deluge 2.0.4+.
own3mall
New User
New User
Posts: 2
Joined: Wed Apr 27, 2022 10:28 pm

Re: [Plugin] CopyMagnetURI v0.2

Post by own3mall »

Thank you so much mhertz for all of the help! It works perfectly now on Deluge 2.0.3 in Ubuntu 20.04! This functionality is very much needed, and I'm happy it now works with Deluge 2.x.

Thanks for catching the mistakes I made in my version. I ran the code through a comparison utility just to make sure I was able to see all of the minor changes and fixes you made. Ah yes, tabs and space issues in Python, but I should have checked that. Strange because I thought I had run those files through pylint, and it didn't complain at the time, but the one line that was tabbed was probably added after I had run it through pylint.

Anyways, thanks again! I'm very happy right now. As for the explanation of it being already built-in in Deluge 2.0.4 or in another developer version, the behavior you describe seems strange because with this plugin, no add-torrent dialog pops up. It just copies the magnet link to the clipboard, which is pretty simple, straight-forward, and all I need. :)

Hopefully, when this functionality is built-in, it will be as simple as the way it works in this plugin. I appreciate the work the deluge team does!
mhertz
Moderator
Moderator
Posts: 2191
Joined: Wed Jan 22, 2014 5:05 am
Location: Denmark

Re: [Plugin] CopyMagnetURI v0.2

Post by mhertz »

You're very welcome and thanks likewise mate :)

Yes, it's as simple as this plugin in deluge develop branch, and sorry for the confusion with add-torrent dialog, that is only something to note on newer versions than 2.0.3, and fixed in deluge develop(upcoming deluge 2.0.6), and was about new functionality of there automatically comes up an "add new torrent" dialog up when seeing you have a magnet in your clipboard, which then also would come up when using this plugin(as thinking you copied the magnet from a web page and wanting it added to deluge).
Post Reply