This forum has been archived. All content is frozen. Please use KDE Discuss instead.

How to change announce interval?

Tags: None
(comma "," separated)
tarp404
Registered Member
Posts
15
Karma
0

How to change announce interval?

Tue Jun 19, 2012 4:20 am
Is there a way to do this? I'm on a flaky connection that drops the connection and reconnects a minute later; obviously the torrents stall out and I have to do a manual announce or if I'm not around, wait for the countdown on the tracker update to reach zero, when I guess it announces again. So I would like to change how often it announces from the arbitrary number of every fifteen minutes or whatever it is to a much lower number. Surely there is a config file or something I can edit to change this, right? I already checked ktorrentrc and didn't see anything like that.
George
Moderator
Posts
5421
Karma
1
This isn't configurable, the tracker determines the interval.
paulrosu
Registered Member
Posts
2
Karma
0
George wrote:This isn't configurable, the tracker determines the interval.


Hello!

I really need to override the announe interval; is there any way to do it from ktorrent api? can I write a script or something? how hard would it be to modify from source code?

sorry for bad english, thanks, Paul
paulrosu
Registered Member
Posts
2
Karma
0
Well, thank you kde community for helping me so kindly, even tough I resuccitated a so old topic;

I found a solution by myself, and I share it with other lonesome noob dudes like me:
You must know the scripting plugin; enable it, create a folder named "update" or whatever in /usr/share/kde4/apps/ktorrent/scripts/ , and create a update.py script file there and put this code in it:

Code: Select all
#!/usr/bin/env kross
# -*- coding: utf-8 -*-
import KTorrent
import KTScriptingPlugin
import Kross
#from PyQt4 import QtCore

t = Kross.module("kdetranslation")

class updatetracker:
   def __init__(self):
      self.timer = KTScriptingPlugin.createTimer(True)
      self.timer.connect('timeout()',self.start)


   def start (self):
      tors = KTorrent.torrents()
      for t in tors:
         tor = KTorrent.torrent(t)
         tor.restoreDefaultTrackers()
         self.timer.start(300000)
   
       
s = updatetracker()
s.start()


Take care, indentation matters; you can change the interval here: self.timer.start(300000) , time is in miliseconds; the tor.restoreDefaultTrackers() part does update tracker; also, you can expand the script if you care, put configuration gui, triggers and what you python experirnce let you; also I put a file named "update.desktop" in that "update" folder with this content:

Code: Select all
 
[Desktop Entry]
Name=Update Tracker
Type=KTorrentScript
X-KTorrent-Script-File=update.py


I do'nt know if this is mandatory, but all other scripts have oane of this; after this restart ktorrent and you will find an "Update Tracker" entry in scripts list; check it and it will work ok;

This greatly improves my download and even more the upload speed on a private tracker, from wich I add torrents automatically immediatley whed they appear with syndication plugin, having a real 100Mb/s optical fiber internet connection.

Sorry for my bad english, poor expression and explanation skills, and for not bothering even to use google translate; I know the code is far from being professional, beautyfull and ellegant but I am no programmer, and if it works i do'nt care any further.

I hope this will be usefull. Have a good day, Paul.


Bookmarks



Who is online

Registered users: bancha, Bing [Bot], Google [Bot], Sogou [Bot]