Export selected torrents to a list / import a torrent list

Other platforms, generic questions.
Post Reply
akem

Export selected torrents to a list / import a torrent list

Post by akem »

Hello,

Not sure where to post, so i post it there...

I'm working a bit on qBittorrent because i'd like to add Export/Import capabilities:

    -Export all selected torrents to an XML list with all important informations.
        The magnet links and tracker informations i think.
        If possible the torrent files themselves to a folder or zipped archive...
        Also current save path, so that when reimporting it, it will get the different paths for each an every torrent to sync back what's already finished/downloaded.

    -Import torrents from an XML file.
        Import listed torrents, the downloaded paths should be available in the list.
        Also it would be nice to be able to scan drives for the torrent files; if they are already somwhere on the disk even partialy, ask for using this as download folder.
          (As much as it is fesable)

So my question is regarding the informations needed for exporting, i was looking at:

Code: Select all

"base/bittorrent/torrenthandle.h"
But it's not so clear what i should export, because i think i need to choose only data that are needed when reimporting/recreating the torrent files.
But on the other hand some informations could be usefull for other purposes than just reimporting.
So if some of the devs can tell me what they think about my project, cause i could have missed something ofc, and if you think it is interesting and
have some informations about the data to be exported or other informations.

Actually i added the options in the "Tools" section, and i can list selected torrent names/paths to the log window:

Image

It's just minimal additions to the code, and adding the icons files.
I build it with MSYS2 on Windows 7 64b (Chocobo1 build instructions).
Last edited by akem on Sun Sep 22, 2019 11:23 pm, edited 1 time in total.
akem

Re: Export selected torrents to a list / import a torrent list

Post by akem »

I got the XML(basic torrents data) -and .torrent files- import/export functionnal.  8)
But for the .torrent files, i would like them to be zipped in one archive ultimately, but it's not so important for now.
I can reload the torrents keeping the download paths and infos, and it synchronise the torrent list correctly even offline.
I still have to do some cleaning and testing, for example i'm not sure it will behave correctly with renamed torrents or filenames.
Also i need to export trackers infos and filenames to XML, just export current tracker atm.
Anyway i'm pretty satisfied with it at the moment.  ;)
akem

Re: Export selected torrents to a list / import a torrent list

Post by akem »

[EDIT]

Here is a first look at my import/export functions for qBittorrent.
Added entries in the menubar, check "Tools >" then "Export.../Import...".

What is it used for:
        Let says you downloaded a bunch of torrents in different directories on your external hard drives, and you want to
        seed all or part of that from another computer; you export from computer A and you import on computer B, and you are
        done, the torrents will be added to the list and synchronised, download paths are preserved.

        Another example is if you reinstalled your computer OS, you just re-import on your new installation.

Export: Export an XML file listing selected torrents and all their .torrent files to the selected directory
        (ultimately everything in a .zip would be better i guess)

Import: Import the XML file and load the .torrents with maintained save paths, categories, tags...
        (or load the magnet links if torrent files cannot be loaded)

Limitations:

        SUPPORTED:
        -Export torrents to XML with some -but not all- data, and .torrent files.
        -Import torrents from XML and .torrent files or hash(fallback).
        -Save path (download location).
        -Category.
        -Tags.
        -Download/upload limits.
        -Paused/Forced.
        -First last pieces priority.
        -Sequential download.
        -Automatic(AutoTMM)

        UNTESTED/UNSUPPORTED YET:
        -Trackers XML import/export.
        -Renamed torrent files.
        -Create subfolders.
        -Partial torrent files selection(only download selected files).

How to test it:
        -->Run the app and load few torrents with different download folders (save path).
        (Choose some small sized ones so you can have few of them completed quikly).
        -->Wait for the fast/small ones to complete at least.
        -->Select some torrents and click "Tool>Export..."
        -->Remove the selected torrents from qBittorrents' list
        (but keep the files, don't check the box in the remove dialog).
        -->Optionnaly disconnect from network for testing purposes.
        -->Click "Tool>Import..." and choose the XML file that was exported.

        All the torrents will be back with their specific paths. You can also import on another computer or a virtual machine of course,
        It should synchronise as long as the downloaded files are there with the correct paths(ex: E:\Ebooks\, F:\Music ...)
        Note: Don't forget to select "All" for "Categories"/"Tags"/"Trackers" to see all the torrents in the list.
                If you don't see the torrents... :P

Download and video: https://qbforums.shiki.hu/index.php/topic,7557.msg32334.html#msg32334

[EDIT]

I think maybe the "Generic" section of the forum was not very adapted for my thread...  :-X
Do you think my feature could make it to the official qBittorrent when ready? @ sledgehammer999, chobobo1, glassez and devs?
About the code it's basicly just 2 methods and few lines to add up the icons or menu entries. There is a bit of translation to do ofc for the message boxes etc.
But i didn't touch any other part of the code.
I'm learning how to use git, i don't know much about it, i know i can do my own qBittorrent fork and start from there i think, any tips about this is appreciated.

Thanks.
Last edited by akem on Sat Sep 28, 2019 11:22 pm, edited 1 time in total.
User avatar
Nemo
Administrator
Administrator
Posts: 1730
Joined: Sat Jul 24, 2010 6:24 pm

Re: Export selected torrents to a list / import a torrent list

Post by Nemo »

Do you think my feature could make it to the official qBittorrent when ready? @ sledgehammer999, chobobo1, glassez and devs?
akem, read my pm I have sended you :).
akem

Re: Export selected torrents to a list / import a torrent list

Post by akem »

I answered your PM Nemo  ;)

Seems like i cannot create a single .zip file export(with the .torrent files and the .XML inside) without adding another depency (like libzip)
which i don't want to. So i'll have to keep the export method exporting all the .torrent to the choosen directory + the .XML file.
akem

Re: Export selected torrents to a list / import a torrent list

Post by akem »

So i think i got the bases for Git,  ::)

Now i think - and one the dev tell me if i'm right please -,
In order to try to get my feature to qBittorrent later, i fork the main qBittorrent source tree on my Git,
I push my changes to my forked version, and when ready it could be reviewed, discussed and ultimatly merged to the original source tree ?

That's the process right?  ???

Regards.
akem

Re: Export selected torrents to a list / import a torrent list

Post by akem »

A little update: i got nearly all basic parameters import/export working now,
including automatic, upload limit, download limit, first last piece priority,  paused, forced ...

Here is the build, if you want to test it, i'm interested in feedback:

https://drive.google.com/open?id=1aZ04fE5BM_TGiE6506hBf4uc60ibS8Le

Here is a video demo:

https://www.youtube.com/watch?v=q_vnwxnhL70


Thanks!  ;)
Last edited by akem on Sun Sep 29, 2019 12:14 am, edited 1 time in total.
vettexl

Re: Export selected torrents to a list / import a torrent list

Post by vettexl »

akem wrote: Sat Sep 28, 2019 9:42 pm A little update: i got nearly all basic parameters import/export working now,
including automatic, upload limit, download limit, first last piece priority,  paused, forced ...

Here is the build, if you want to test it, i'm interested in feedback:

https://drive.google.com/open?id=1aZ04fE5BM_TGiE6506hBf4uc60ibS8Le

Here is a video demo:

https://www.youtube.com/watch?v=q_vnwxnhL70


Thanks!  ;)
apologies to staff for posting in a year old thread, but this seems to be exactly what i'm looking for.
i even registered just to post here! :)

what is the current status of this project? is it still active?

I was hoping to find some way of exporting my torrents, etc. before re-installing Windows

thanks in advance.
Post Reply