[Solved] whether qbittorrent opens a local file or URL

Linux specific questions, problems.
Post Reply
kydeza

[Solved] whether qbittorrent opens a local file or URL

Post by kydeza »

Hello,

I observed a curious behaviour of qbittorent but I do not know whether it is a bug or the normal behaviour.
Let us consider two situations: qbittorrent is already launched or it is not. In the last case the behaviour of qbittorrent is the same with the two commands below: qbittorrent is launched and the add torrent dialog box is automatically opened with the specified torrent. But, when qbittorrent is already launched, the behaviour differs Depending on whether we specificed a file or an URL.
  • If I launch the command (in a konsole for example)

    Code: Select all

    qbittorrent afile.torrent
    and qbittorrent is already opened, nothing happens
  • If I launch the command

    Code: Select all

    qbittorrent http://urltofile.torrent
    and qbittorrent is already opened,the add torrent dialog box is opened with the specified torrent
As I said I do not know whether it is a bug or the normal behaviour, or if it exists an options somewhere, so I prefer ask the question here before submitting a bug.

I found this because I used to use firefox to browse the web and the add torrent dialog box of qbittorrent opened automatically when I clicked on a torrent link. But I recently whenged my default browser to Chromium and I found that when qbittorrent is already launched the add torrent dialog box is not opened.

I supposed the difference is probably (but I'm not sure) that firefox send an URL to qbittorrent and Chromium sends to qbittorrent the path to the local file it downloaded. (However Firefox seems to download the file also, so I do not know what it sends exactly to qbittorrent).

What do you think?

Thank you
Last edited by kydeza on Mon Sep 27, 2010 9:16 am, edited 1 time in total.
nevernow

Re: Depending on whether qbittorrent opens a local file or U

Post by nevernow »

Firefox should download the file to a temporary directory and then invoke the helper application (in this case qB) with the file as a parameter.
kydeza

Re: Depending on whether qbittorrent opens a local file or U

Post by kydeza »

Actually it is what I was thinking until I discover that when we open a torrent link with firefox qbittorent behaves as if we launch it with a URL and not a file... So I do not know what happens exactly in firefox... I agree that firefox download the torrent file before launching qbittorrent, as Chromimum, but obviously the way this file is «sent» to qbittorrent is not the same.

I did this simple experiment: I have a local apache server on my linux (just to avoid to do the test with an online server), when I give to firefox the url of the torrent file on the server, it open the add torrent dialog box. However, if I use firefox to access directly my personnal folders (using an address as file:///home/user/) and clicking on the torrent file, it does not open the add torrent dialog box... So firefox does not call qbittorent in the same way in both cases.

Anyway, I do not know how firefox works exactly and this a question to ask on a firefox forum.

Just that, in my opinion, qbittorent should have the same behaviour and open the add torrent dialog box when qbittorrent is already in use, independently on whether we call it with a file or a URL, (and the way Chromium or firefox or anything else manage there files does not matter)
christophe.dumez

Re: Depending on whether qbittorrent opens a local file or U

Post by christophe.dumez »

kydeza> What version of qBittorrent is that?

I have just tried with qBittorrent v2.4.0 and it worked fine. if I run:
qbittorrent path_to_local_file/file.torrent

then qBittorrent actually loads the torrent.

Two possibilities:
- You are using an older version of qBittorrent which is possibly buggy.
- qBittorrent does not like something in the path to you local torrent file (what does the exact path look like?)
christophe.dumez

Re: Depending on whether qbittorrent opens a local file or U

Post by christophe.dumez »

For example, according to my changelog, there was a bug in qBittorrent < v2.2.11 causing issues when command line parameters contained whitespaces.
kydeza

Re: Depending on whether qbittorrent opens a local file or U

Post by kydeza »

I was using qbittorrent v2.4.0 also, now v2.4.2
Last edited by kydeza on Mon Sep 27, 2010 12:07 am, edited 1 time in total.
kydeza

Re: Depending on whether qbittorrent opens a local file or U

Post by kydeza »

removed
Last edited by kydeza on Mon Sep 27, 2010 12:06 am, edited 1 time in total.
kydeza

Re: Depending on whether qbittorrent opens a local file or U

Post by kydeza »

Hi,

I think I finally found the bug, I give the solution here but I will try put it on the bug report site:

I looked in the sources of v4_2_x in the svn repository:
in the file main.cpp , line 181, rather than

Code: Select all

message += argv[a];
you must write

Code: Select all

message += QString::fromLocal8Bit(argv[a]);
or

Code: Select all

message += p;
(p is already computed two lines before)

Actually qbittorrent just did not find the torrent file because the name of my folders uses french accents and are coded using utf8...

Doing this simple modification and all seems working correctly on my computer.

Thank you
christophe.dumez

Re: Depending on whether qbittorrent opens a local file or U

Post by christophe.dumez »

thanks! I'll apply the patch today.
Post Reply