Download a file from the webui #2353

Closed
opened 2026-02-21 16:10:17 -05:00 by deekerman · 13 comments
Owner

Originally created by @racam on GitHub (Apr 7, 2015).

Hi,

I just install qBittorrent on my VPS with no X and only the Web GUI. I just love it : really simple and ergonomic !
But I really miss the fact that i can't download my files when they are finished.

So, is it possible to add a feature that allow us to download a file (when he is finished) from the WebUI ?

Maybe a disable/enable option with the right click on a torrent ?

Originally created by @racam on GitHub (Apr 7, 2015). Hi, I just install qBittorrent on my VPS with no X and only the Web GUI. I just love it : really simple and ergonomic ! But I really miss the fact that i can't download my files when they are finished. So, is it possible to add a feature that allow us to download a file (when he is finished) from the WebUI ? Maybe a disable/enable option with the right click on a torrent ?
Author
Owner

@chrishirst commented on GitHub (Apr 7, 2015):

javascript and HTML are not allowed any kind of access to the host filing system outside of the HTTP server context.

@chrishirst commented on GitHub (Apr 7, 2015): javascript and HTML are not allowed any kind of access to the host filing system outside of the HTTP server context.
Author
Owner

@racam commented on GitHub (Apr 8, 2015):

Just to understand,
what are the main reasons of this restriction ?

It's a real drag if you want to install qBittorrent as a seebox.

@racam commented on GitHub (Apr 8, 2015): Just to understand, what are the main reasons of this restriction ? It's a real drag if you want to install qBittorrent as a seebox.
Author
Owner

@pmzqla commented on GitHub (Apr 8, 2015):

It's not something impossible to implement.

I'm not familiar with seedboxes and such, but don't these usually have an HTTP/FTP server for a direct access?

@pmzqla commented on GitHub (Apr 8, 2015): It's not something impossible to implement. I'm not familiar with seedboxes and such, but don't these usually have an HTTP/FTP server for a direct access?
Author
Owner

@chrishirst commented on GitHub (Apr 8, 2015):

Browser and OS security, javascript simply does not have any methods built into it for accessing host machine filing systems [or server side filing systems]. On the host machine (yours) the only locations javascript is allowed to access are cookie and 'history' (the browser cache) storage locations, everything else is 'off limits' to js and on the server CANNOT access anything at all because javascript runs in a HTTP context on the machine the browser is on (even if the are one and the same).

One way it could be done would be to create http: of ftp: links in the webui that exposed the payload storage location, but this has to be done by the client code not by the HTTP context javascript. Then of course that is most likely going to raise permission issues, particularly if you are running qBT on a 'seedbox'.
I've not spent a lot of time looking at the HTTP: server but I assume that it creates a 'virtual'/temporary HTTP: context for client communication and because of it's virtual nature does not have "file handling" capability.

It's a real drag if you want to install qBittorrent as a seebox.

If you are I would suggest using scp (Secure CoPy) on Linux or Mac machines, WinSCP for Windows rather than HTTP.

@chrishirst commented on GitHub (Apr 8, 2015): Browser and OS security, javascript simply does not have any methods built into it for accessing host machine filing systems [or server side filing systems]. On the host machine (yours) the only locations javascript is allowed to access are cookie and 'history' (the browser cache) storage locations, everything else is 'off limits' to js and on the server CANNOT access anything at all because javascript runs in a HTTP context on the machine the browser is on (even if the are one and the same). One way it could be done would be to create http: of ftp: links in the webui that exposed the payload storage location, but this has to be done by the client code not by the HTTP context javascript. Then of course that is most likely going to raise permission issues, particularly if you are running qBT on a 'seedbox'. I've not spent a lot of time looking at the HTTP: server but I assume that it creates a 'virtual'/temporary HTTP: context for client communication and because of it's virtual nature does not have "file handling" capability. > It's a real drag if you want to install qBittorrent as a seebox. If you are I would suggest using scp (Secure CoPy) on Linux or Mac machines, WinSCP for Windows rather than HTTP.
Author
Owner

@racam commented on GitHub (Apr 8, 2015):

  • but don't these usually have an HTTP/FTP server for a direct access?
  • If you are I would suggest using scp (Secure CoPy) on Linux or Mac machines, WinSCP for Windows rather than HTTP.

Yes but It adds other dependancies. When I install the webUI on my VPS, I want my friends/family to be able to download a torrent on the VPS and get the final file back on their computers.
Currently, you have to use Filezilla, or WinSCP, or a HTTP server.

@chrishirst I'm not speaking about Javascript. Javascript is client-side and this feature will be on the server-side. As the WebUI API allows us to do these actions:

  • Shutdown qBittorrent
  • Get torrent list
  • Get torrent generic properties
  • Get torrent trackers
  • Get torrent contents
  • Get global transfer info
  • Get qBittorrent preferences

I mean, all this features have to manage with the qBittorrent "daemon". And it's qBittorrent who create the final file, so the "daemon" can be the gateway/pipe between the file and the HTTP server.

It's the same application who manage the torrent and the http server, isn't it ?
So, is it really impossible to download the final file ?

@racam commented on GitHub (Apr 8, 2015): > - but don't these usually have an HTTP/FTP server for a direct access? > - If you are I would suggest using scp (Secure CoPy) on Linux or Mac machines, WinSCP for Windows rather than HTTP. Yes but It adds other dependancies. When I install the webUI on my VPS, I want my friends/family to be able to download a torrent on the VPS and get the final file back on their computers. Currently, you have to use Filezilla, or WinSCP, or a HTTP server. @chrishirst I'm not speaking about Javascript. Javascript is client-side and this feature will be on the server-side. As the WebUI API allows us to do these actions: - Shutdown qBittorrent - Get torrent list - Get torrent generic properties - Get torrent trackers - Get torrent contents - Get global transfer info - Get qBittorrent preferences I mean, all this features have to manage with the qBittorrent "daemon". And it's qBittorrent who create the final file, so the "daemon" can be the gateway/pipe between the file and the HTTP server. It's the same application who manage the torrent and the http server, isn't it ? So, is it really impossible to download the final file ?
Author
Owner

@pmzqla commented on GitHub (Apr 8, 2015):

As I said, it's possible.

@pmzqla commented on GitHub (Apr 8, 2015): As I said, it's possible.
Author
Owner

@chrishirst commented on GitHub (Apr 8, 2015):

I'm not speaking about Javascript. Javascript is client-side and this feature will be on the server-side. As the WebUI API allows us to do these actions:

Open the webUI, right click -> Select "View Source" and you will see how much javascript the webui uses.

@chrishirst commented on GitHub (Apr 8, 2015): > I'm not speaking about Javascript. Javascript is client-side and this feature will be on the server-side. As the WebUI API allows us to do these actions: Open the webUI, right click -> Select "View Source" and you will see how much javascript the webui uses.
Author
Owner

@chrishirst commented on GitHub (Apr 8, 2015):

As I said, it's possible.

Certainly possible, but may not be as simple as you are thinking.

@chrishirst commented on GitHub (Apr 8, 2015): > As I said, it's possible. Certainly possible, but may not be as simple as you are thinking.
Author
Owner

@racam commented on GitHub (Apr 8, 2015):

@pmzqla
Do I have a chance to see the feature appear in qBittorent ?
Do I have to develop it myself and pull request it ?

@chrishirst
WebUI API
https://github.com/qbittorrent/qBittorrent/wiki/WebUI-API-Documentation

You can create a REST software that communicate with the HTTP server without using the webUI and any form of Javascript. You can create a simple program in Python that can communicate with the HTTP server without javascript.

Javascript is off topic. Javascript just call server-side methods in ajax. I speak about add a new method like "Get torrent trackers" but this method will allow you to download the final file.

Certainly possible, but may not be as simple as you are thinking.

It's why I opened this issue: to know if It's this feature is enought simple and interesting to be implement.

@racam commented on GitHub (Apr 8, 2015): @pmzqla Do I have a chance to see the feature appear in qBittorent ? Do I have to develop it myself and pull request it ? @chrishirst WebUI **API** https://github.com/qbittorrent/qBittorrent/wiki/WebUI-API-Documentation You can create a REST software that communicate with the HTTP server without using the webUI and any form of Javascript. You can create a simple program in Python that can communicate with the HTTP server without javascript. Javascript is off topic. Javascript just call server-side methods in ajax. I speak about add a new method like "Get torrent trackers" but this method will allow you to download the final file. > Certainly possible, but may not be as simple as you are thinking. It's why I opened this issue: to know if It's this feature is enought simple and interesting to be implement.
Author
Owner

@pmzqla commented on GitHub (Apr 8, 2015):

Do I have a chance to see the feature appear in qBittorent ?

I can't answer this.

Do I have to develop it myself and pull request it ?

It wouldn't hurt.

Really hacky patch: https://gist.github.com/pmzqla/db84464b359437b1e045
It has several problems: given params are not checked, printFile() is not intended to stream data and doesn't do it (it uses a huge amout of RAM with big files or when several requests are performed, plus it's slow), HTTP header is not correct, inconsistent behavior of save_path() with single file torrents, "query" is probably not the right "place" and so on.

I wrote the patch in few minutes with no intention on properly implementing the feature.

GET /query/getfile?hash=XXXXXXXXXXXX&filenum=0

@pmzqla commented on GitHub (Apr 8, 2015): > Do I have a chance to see the feature appear in qBittorent ? I can't answer this. > Do I have to develop it myself and pull request it ? It wouldn't hurt. Really hacky patch: https://gist.github.com/pmzqla/db84464b359437b1e045 It has several problems: given params are not checked, `printFile()` is not intended to stream data and doesn't do it (it uses a huge amout of RAM with big files or when several requests are performed, plus it's slow), HTTP header is not correct, inconsistent behavior of `save_path()` with single file torrents, "query" is probably not the right "place" and so on. I wrote the patch in few minutes with no intention on properly implementing the feature. `GET /query/getfile?hash=XXXXXXXXXXXX&filenum=0`
Author
Owner

@chrishirst commented on GitHub (Apr 8, 2015):

The API is nothing to do with it, what I am talking about are the limitations imposed by necessity in the browsers that will be accessing the http site. No matter what the API could do does not mean that browsers are allowed to do that. You may or may not have noticed but you cannot load a metadata file that is located on the machine that the client is running [assuming the access is not from 'localhost']

@chrishirst commented on GitHub (Apr 8, 2015): The API is nothing to do with it, what I am talking about are the limitations imposed by necessity in the browsers that will be accessing the http site. No matter what the API **could** do does not mean that browsers are allowed to do that. You may or may not have noticed but you **cannot** load a metadata file that is located on the machine that the client is running [assuming the access is not from 'localhost']
Author
Owner

@racam commented on GitHub (Apr 9, 2015):

@pmzqla
Ok, thank you a lot for the advices and the gist:) I will investigate this week end if I can. Even if i'm not a expert in C++, I will try.

@chrishirst
As I said, I will try to do something this week end. We will see if I found a good solution.

@racam commented on GitHub (Apr 9, 2015): @pmzqla Ok, thank you a lot for the advices and the gist:) I will investigate this week end if I can. Even if i'm not a expert in C++, I will try. @chrishirst As I said, I will try to do something this week end. We will see if I found a good solution.
Author
Owner

@sledgehammer999 commented on GitHub (Apr 10, 2015):

I am not sure I should leave this open.
qBittorrent shouldn't implement a fileserver. There are tons of other programs out there that do this job a lot better. We would be reinventing the wheel. qBittorrent's job is to download the torrent data to the location it is instructed. How you obtain the data from that location is your issue.
Now that I have written the above, it is clear to me that this request is out of scope for a bt client. So I am closing this.
Try FileZilla(and similar programs). Or write a script for your local machine to copy the completed torrents from the seedbox locally.
Maybe tools like rsync could be helpful here too.

@sledgehammer999 commented on GitHub (Apr 10, 2015): I am not sure I should leave this open. qBittorrent shouldn't implement a fileserver. There are tons of other programs out there that do this job a lot better. We would be reinventing the wheel. qBittorrent's job is to download the torrent data to the location it is instructed. How you obtain the data from that location is your issue. Now that I have written the above, it is clear to me that this request is out of scope for a bt client. So I am closing this. Try FileZilla(and similar programs). Or write a script for your local machine to copy the completed torrents from the seedbox locally. Maybe tools like rsync could be helpful here too.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/qBittorrent#2353
No description provided.