Author Topic: [Solved] whether qbittorrent opens a local file or URL  (Read 4414 times)

kydeza

  • Guest
[Solved] whether qbittorrent opens a local file or URL
« on: September 16, 2010, 01:13:13 pm »
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]
    qbittorrent afile.torrent and qbittorrent is already opened, nothing happens
  • If I launch the command
    Code: [Select]
    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 Edit: September 27, 2010, 11:16:29 am by kydeza »

nevernow

  • Member
  • **
  • Posts: 28
  • Karma: +0/-0
    • View Profile
Re: Depending on whether qbittorrent opens a local file or U
« Reply #1 on: September 16, 2010, 02:57:07 pm »
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.
« Last Edit: January 01, 1970, 01:00:00 am by Guest »

kydeza

  • Guest
Re: Depending on whether qbittorrent opens a local file or U
« Reply #2 on: September 16, 2010, 03:54:03 pm »
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)
« Last Edit: January 01, 1970, 01:00:00 am by Guest »

christophe.dumez

  • Administrator
  • Veteran
  • *****
  • Posts: 179
  • Karma: +10/-0
    • View Profile
Re: Depending on whether qbittorrent opens a local file or U
« Reply #3 on: September 25, 2010, 09:11:27 pm »
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?)
« Last Edit: January 01, 1970, 01:00:00 am by Guest »
qBittorrent author

christophe.dumez

  • Administrator
  • Veteran
  • *****
  • Posts: 179
  • Karma: +10/-0
    • View Profile
Re: Depending on whether qbittorrent opens a local file or U
« Reply #4 on: September 25, 2010, 09:15:43 pm »
For example, according to my changelog, there was a bug in qBittorrent < v2.2.11 causing issues when command line parameters contained whitespaces.
« Last Edit: January 01, 1970, 01:00:00 am by Guest »
qBittorrent author

kydeza

  • Guest
Re: Depending on whether qbittorrent opens a local file or U
« Reply #5 on: September 26, 2010, 11:20:07 pm »
I was using qbittorrent v2.4.0 also, now v2.4.2
« Last Edit: September 27, 2010, 02:07:31 am by kydeza »

kydeza

  • Guest
Re: Depending on whether qbittorrent opens a local file or U
« Reply #6 on: September 26, 2010, 11:33:08 pm »
removed
« Last Edit: September 27, 2010, 02:06:54 am by kydeza »

kydeza

  • Guest
Re: Depending on whether qbittorrent opens a local file or U
« Reply #7 on: September 27, 2010, 01:17:23 am »
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]
message += argv[a]; you must write
Code: [Select]
message += QString::fromLocal8Bit(argv[a]); or
Code: [Select]
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
« Last Edit: January 01, 1970, 01:00:00 am by Guest »

christophe.dumez

  • Administrator
  • Veteran
  • *****
  • Posts: 179
  • Karma: +10/-0
    • View Profile
Re: Depending on whether qbittorrent opens a local file or U
« Reply #8 on: September 27, 2010, 07:19:53 am »
thanks! I'll apply the patch today.
« Last Edit: January 01, 1970, 01:00:00 am by Guest »
qBittorrent author