e-alfred / ocdownloader

ocDownloader - AGPL-licensed multi-protocol download manager for Nextcloud using ARIA2, youtube-dl and Curl (supports Youtube, BitTorrent, HTTP, FTP)
https://github.com/e-alfred/ocdownloader
GNU Affero General Public License v3.0
375 stars 85 forks source link

aria2/curl selection setting doesn't take effect #72

Closed ifoolb closed 4 years ago

ifoolb commented 6 years ago
### Steps to reproduce 1. select curl under additional settings ocdownloader section 2. navigate to ocdownloader it still says "using ARIA2" 3. ### Expected behaviour using CURL instead ### Actual behaviour still using aria2 to do downloads ### Server configuration **Operating system**: CentOS 7 **Web server:** Apache 2.4 **Database:** Sqlite, in which I have: sqlite> select * from oc_ocdownloader_adminsettings; 1|AllowProtocolBT|N 2|WhichDownloader|CURL **PHP version:** php 71w **Nextcloud version:** (see Nextcloud admin page) 13 **Updated from an older Nextcloud/ownCloud or fresh install:** fresh install, only did chmod +x fallback.*, without touching anything else **Where did you install Nextcloud from:** official tarball
e-alfred commented 6 years ago

Does the setting work if you change it in the SQLite database using the CLI? Otherwise I am not too confident to support a DBMS that isn't even really supported by Nextcloud:

https://docs.nextcloud.com/server/13/admin_manual/configuration_database/linux_database_configuration.html

ifoolb commented 6 years ago

I suppose not, because when I open the database, I find duplicate rows in it, such as 2|WhichDownloader|CURL 3|WhichDownloader|ARIA2 4|WhichDownloader|CURL After switching to MariaDB the settings work well, so it does seem to be a problem because of SQLite. But SQLite is convenient, if it's supported then I won't need to run another daemon on my 'micro' server.

e-alfred commented 6 years ago

This will probably be solved by https://github.com/e-alfred/ocdownloader/issues/73. Rework will take some time probably, but if you want to help out pull requests are always welcome.

DocSniper commented 5 years ago

I've updated to 1.7.0 but still the same problem.

DB is sqlite, I've set the execute permissions for the fallback and I have selected cURL as downloader in the settings.

I had the same DB problem as @ifoolb and used the following commands to correct it: delete from oc_ocdownloader_adminsettings where id = X; insert into oc_ocdownloader_adminsettings values (1,'AllowProtocolBT','N'); insert into oc_ocdownloader_adminsettings values (2,'WhichDownloader','CURL');

to this: select * from oc_ocdownloader_adminsettings; 1 | AllowProtocolBT | N 2 | whichDownloader | CURL

However, the problem still exists with the new version 1.7.0

Edit: Forgot to write, the download page indicates that aria2 is still being used for downloads, and prints this error message: _Returned GID is null ! Is Aria2c running as a daemon ?

DocSniper commented 5 years ago

Here a quick solution to use curl instead of aria2:

In the file apps/ocdownloader/controller/libs/settings.php add to the function public function getValue() as first line after the { this new line: if ($this->Key == 'WhichDownloader') return 'CURL';

Don't forget to adjust the path to the youtube-dl binary $this->YTDLBinary = '/usr/local/bin/youtube-dl'; // default path in the file apps/ocdownloader/controller/ytdownloader.php (I had to delete local).

Edit:

Instead of modifying ytdownloader.php you can add a second line to lib/settings.php with if ($this->Key == 'YTDLBinary') return '/usr/bin/youtube-dl'; directly after the the first added line.

settings.php could look like this: public function getValue() { if ($this->Key == 'WhichDownloader') return 'CURL'; elseif ($this->Key == 'YTDLBinary') return '/usr/bin/youtube-dl'; elseif ($this->Key == 'AllowProtocolBT') return 'N'; ... }

e-alfred commented 4 years ago

Nextcloud officially doesn't support SQLite anymore, this app cannot support things that aren't supported by Nextcloud directly, so only Mariadb/Mysql and Postgresql are supported for now: https://docs.nextcloud.com/server/18/admin_manual/configuration_database/linux_database_configuration.html