Suggest, post, or discuss plugins for Deluge
New User
New User
Posts: 3
Joined: Fri Jan 20, 2017 10:13 am
OS or Distro: Ubuntu


Postby Kaavi » Sat Jul 22, 2017 10:36 am

I made this through cut'n'paste and hack'n'slash - so this is not very pretty code im sure.

What it does is that it keeps updating the tracker until tracker status is "OK", it as some of the trackers im on returns "Error: unregistered torrent" when adding it fast with autodl-irssi.

It works for 1.3.x - it doesn't work for 2.0, as "component.get('TorrentManager').session_started:" gives an error. Not sure why and not going to spend time making it.

So if anyone want to make a plugin based on the ideas on this feel free - im not going to do anytihng with it myself. :)

Code: Select all

# Basic plugin template created by:
# Copyright (C) 2008 Martijn Voncken <>
# Copyright (C) 2007-2009 Andrew Resch <>
# Copyright (C) 2009 Damien Churchill <>
# Deluge is free software.
# You may redistribute it and/or modify it under the terms of the
# GNU General Public License, as published by the Free Software
# Foundation; either version 3 of the License, or (at your option)
# any later version.
# deluge is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# See the GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with deluge.    If not, write to:
#    The Free Software Foundation, Inc.,
#    51 Franklin Street, Fifth Floor
#    Boston, MA  02110-1301, USA.
#    In addition, as a special exception, the copyright holders give
#    permission to link the code of portions of this program with the OpenSSL
#    library.
#    You must obey the GNU General Public License in all respects for all of
#    the code used other than OpenSSL. If you modify file(s) with this
#    exception, you may extend this exception to your version of the file(s),
#    but you are not obligated to do so. If you do not wish to do so, delete
#    this exception statement from your version. If you delete this exception
#    statement from all source files in the program, then also delete it here.

import time
import logging
from twisted.internet.task import LoopingCall

from deluge.log import LOG as log
from deluge.plugins.pluginbase import CorePluginBase
import deluge.component as component
import deluge.configmanager
from deluge.core.rpcserver import export
from deluge.ui.client import client


class Core(CorePluginBase):

    timer = {}

    def update_tracker(self, torrent_id):
        tid = component.get('TorrentManager').torrents[torrent_id]
        tid_status = tid.get_status(['tracker_status','time_added'])"[AddTrackerCheck](%s)(%s) : %s", torrent_id, time.time() - tid_status['time_added'], tid_status['tracker_status'])

        if tid_status['tracker_status'].find("Announce OK") != -1:
        elif time.time() - tid_status['time_added'] > 300:
  "[AddTrackerCheck](%s) : Updating Tracker", torrent_id)
    def post_torrent_add(self, torrent_id, *from_state):
        if not component.get('TorrentManager').session_started:
            return"[AddTrackerCheck](%s) : Adding New Torrent", torrent_id)
        Core.timer[torrent_id] = LoopingCall(self.update_tracker, torrent_id)

    def enable(self):
        # Go through the commands list and register event handlers
        self.config = deluge.configmanager.ConfigManager("addtorrentcheck.conf", DEFAULT_PREFS)
        component.get("EventManager").register_event_handler("TorrentAddedEvent", self.post_torrent_add)

    def disable(self):

    def update(self):

    def set_config(self, config):
        """Sets the config dictionary"""
        for key in config.keys():
            self.config[key] = config[key]

    def get_config(self):
        """Returns the config dictionary"""
        return self.config.config

Return to “Plugins”

Who is online

Users browsing this forum: No registered users and 16 guests