# KTorrent: Moving data in a shell script

I'm attempting to make a manuscript for my magic folder that will certainly relocate documents to a seeding directory site without KTorrent misplacing where the information is, comparable to the "Move Data" context food selection activity in the application. I've jabbed around the dbus API and also this is what I have until now:

for x in qdbus org.ktorrent.ktorrent /core org.ktorrent.core.torrents; do
name=qdbus org.ktorrent.ktorrent /torrent/$x org.ktorrent.torrent.name if [ "$name" = "\$1" ]; then
# Tell KTorrent to move the data to the seeding directory
fi
done


The trouble is that I can not find anything in The API to do that, or perhaps to set the new area after relocate by hand.

I had fun with the suggestion of doing it by straight adjusting to GUI to turn on the context food selection activity (if I can get that much I would certainly be completely satisfied) and also located this:

qdbus org.ktorrent.ktorrent /ktorrent/MainWindow_1 org.kde.KMainWindow.activateAction view_move_data


Which does what I desire yet constantly for the presently picked gush, and also I can not also identify the very first step to picking the gush I in fact intend to relocate.

Any kind of suggestions?

4
2022-06-07 14:40:39
Source Share

I located a far better remedy to my trouble. As opposed to having my finished downloads relocated to a details directory site and afterwards returned when I'm performed with them, I made a KTorrent Script that captures the completed signal and also develops a symbolic link to the documents in the directory site I intend to see them in. When I'm performed with them I can simply delete the symbolic link and also never ever need to relocate the real information, which is far more reliable anyhow.

yet I'll upload the materials of the major manuscript below simply in instance.

#!/usr/bin/env kross
# -*- coding: utf-8 -*-
import KTorrent
import KTScriptingPlugin
import Kross

import os
import socket

def __init__(self):
tors = KTorrent.torrents()
# bind to signals for each torrent
for t in tors:

def torrentFinished(self,tor):

def connectSignals(self,tor):
KTorrent.log("connectSignals " + tor.name())
tor.connect("finished(QObject* )",self.torrentFinished)