mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2026-03-02 22:57:32 -05:00
Download a file from the webui #2353
Labels
No labels
Accessibility
AppImage
Bounty
Build system
CI
Can't reproduce
Code cleanup
Confirmed bug
Confirmed bug
Core
Crash
Data loss
Discussion
Docker
Documentation
Duplicate
Feature
Feature request
Feature request
Feature request
Filters
Flatpak
GUI
Has workaround
I2P
Invalid
Libtorrent
Look and feel
Meta
NSIS
Network
Not an issue
OS: *BSD
OS: Linux
OS: Windows
OS: macOS
PPA
Performance
Project management
Proxy/VPN
Qt bugs
Qt6 compat
RSS
Search engine
Security
Temp folder
Themes
Translations
Triggers
Waiting diagnosis
Waiting info
Waiting upstream
Waiting web implementation
Watched folders
WebAPI
WebUI
autoCloseOldIssue
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/qBittorrent#2353
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
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 ?
@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.
@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.
@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?
@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.
If you are I would suggest using scp (Secure CoPy) on Linux or Mac machines, WinSCP for Windows rather than HTTP.
@racam commented on GitHub (Apr 8, 2015):
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:
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 ?
@pmzqla commented on GitHub (Apr 8, 2015):
As I said, it's possible.
@chrishirst commented on GitHub (Apr 8, 2015):
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):
Certainly possible, but may not be as simple as you are thinking.
@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.
It's why I opened this issue: to know if It's this feature is enought simple and interesting to be implement.
@pmzqla commented on GitHub (Apr 8, 2015):
I can't answer this.
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 ofsave_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@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']
@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.
@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.