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

Some Settings (Proxy User, Password and Audio Format) being ignored or not sent to the youtube-dl #187

Open GAS85 opened 4 years ago

GAS85 commented 4 years ago

Steps to reproduce

  1. Configure audio and video quality as you wish grafik

  2. Configure Proxy settings as you need grafik

  3. See that nothing will happens, because not all settings are forwarded to the command (youtube-dl):

ps -ef | grep youtube
sh -c /usr/local/bin/youtube-dl -i 'https://www.youtube.com/watch?v=xxxxxxxxxx' --get-url --get-filename -f 'best[width<=1280]' -4 --proxy https://127.0.0.1:9092

As you see there is no audio parameter bestaudio[abr<=85] and nor Proxy user and password being send. All parameters marked as green are forwarded to the command by change. All parameters marked as red are not forwarded to the cmd: grafik

Expected behavior

Settings correctly send to the shell

Actual behavior

Not all settings being send to the shell so that download is acting not as expected

Server configuration

Operating system: Ubuntu 18.04

Web server: Apache/2.4.46

Database: 10.1.44-MariaDB

PHP version: 7.3.23

Nextcloud version: 19.0.4

Updated from an older Nextcloud/ownCloud or fresh install: Update

Where did you install Nextcloud from: Official

Signing status:

Signing status ``` No errors have been found. ```

List of activated apps:

App list ``` Enabled: - accessibility: 1.5.0 - activity: 2.12.1 - admin_audit: 1.9.0 - audioplayer: 2.12.0 - bruteforcesettings: 2.0.1 - calendar: 2.0.4 - checksum: 0.4.5 - cloud_federation_api: 1.2.0 - comments: 1.9.0 - contactsinteraction: 1.0.0 - data_request: 1.6.0 - dav: 1.15.0 - deck: 1.1.0 - drawio: 0.9.7 - external: 3.6.0 - extract: 1.2.4 - facerecognition: 0.6.3 - federatedfilesharing: 1.9.0 - federation: 1.9.0 - files: 1.14.0 - files_automatedtagging: 1.9.0 - files_external: 1.10.0 - files_mindmap: 0.0.22 - files_pdfviewer: 1.8.0 - files_retention: 1.8.2 - files_rightclick: 0.16.0 - files_sharing: 1.11.0 - files_trashbin: 1.9.0 - files_versions: 1.12.0 - files_videoplayer: 1.8.0 - firstrunwizard: 2.8.0 - flowupload: 1.0.0 - forms: 2.0.4 - gpxedit: 0.0.13 - gpxmotion: 0.0.11 - gpxpod: 4.2.2 - keeweb: 0.6.3 - logreader: 2.4.0 - lookup_server_connector: 1.7.0 - mail: 1.4.1 - maps: 0.1.6 - nextcloud_announcements: 1.8.0 - notes: 3.6.4 - notifications: 2.7.0 - oauth2: 1.7.0 - ocdownloader: 1.7.8 - password_policy: 1.9.1 - phonetrack: 0.6.4 - photos: 1.1.0 - polls: 1.5.4 - previewgenerator: 2.3.0 - privacy: 1.3.0 - provisioning_api: 1.9.0 - recommendations: 0.7.0 - serverinfo: 1.9.0 - settings: 1.1.0 - sharebymail: 1.9.0 - spreed: 9.0.4 - survey_client: 1.7.0 - systemtags: 1.9.0 - text: 3.0.1 - theming: 1.10.0 - twofactor_backupcodes: 1.8.0 - twofactor_totp: 5.0.0 - unsplash: 1.1.6 - updatenotification: 1.9.0 - video_converter: 0.1.4 - viewer: 1.3.0 - weather: 1.7.3 - workflowengine: 2.1.0 Disabled: - encryption - facerecognition.git - files_antivirus - impersonate - ocr - radio - support - user_ldap ```

Nextcloud configuration:

Config report ``` { "system": { "instanceid": "***REMOVED SENSITIVE VALUE***", "passwordsalt": "***REMOVED SENSITIVE VALUE***", "secret": "***REMOVED SENSITIVE VALUE***", "trusted_domains": [ "***REMOVED SENSITIVE VALUE***", "***REMOVED SENSITIVE VALUE***", "***REMOVED SENSITIVE VALUE***" ], "datadirectory": "***REMOVED SENSITIVE VALUE***", "overwrite.cli.url": "***REMOVED SENSITIVE VALUE***", "dbtype": "mysql", "version": "19.0.4.2", "dbname": "***REMOVED SENSITIVE VALUE***", "dbhost": "***REMOVED SENSITIVE VALUE***", "dbport": "", "dbtableprefix": "oc_", "mysql.utf8mb4": true, "dbuser": "***REMOVED SENSITIVE VALUE***", "dbpassword": "***REMOVED SENSITIVE VALUE***", "installed": true, "filesystem_check_changes": 0, "filelocking.enabled": true, "memcache.local": "\\OC\\Memcache\\APCu", "memcache.locking": "\\OC\\Memcache\\Redis", "memcache.distributed": "\\OC\\Memcache\\Redis", "redis": { "host": "***REMOVED SENSITIVE VALUE***", "port": 0, "timeout": 1.5 }, "mail_smtpmode": "smtp", "mail_smtpauthtype": "LOGIN", "mail_from_address": "***REMOVED SENSITIVE VALUE***", "mail_domain": "***REMOVED SENSITIVE VALUE***", "maintenance": false, "theme": "", "logfile": "\/var\/nextcloud\/data\/nextcloud.log", "loglevel": 1, "trashbin_retention_obligation": "14, auto", "versions_retention_obligation": "14, auto", "data-fingerprint": "7be51475e95ea13b254cd880319d98ec", "enable_previews": true, "enabledPreviewProviders": [ "OC\\Preview\\PNG", "OC\\Preview\\JPEG", "OC\\Preview\\GIF", "OC\\Preview\\BMP", "OC\\Preview\\XBitmap", "OC\\Preview\\Movie", "OC\\Preview\\PDF", "OC\\Preview\\MP3", "OC\\Preview\\TXT", "OC\\Preview\\MarkDown" ], "preview_max_x": 1920, "preview_max_y": 1080, "jpeg_quality": 90, "auth.bruteforce.protection.enabled": true, "simpleSignUpLink.shown": false, "mail_smtpsecure": "tls", "mail_smtpauth": 1, "mail_smtphost": "***REMOVED SENSITIVE VALUE***", "mail_smtpport": "587", "mail_smtpname": "***REMOVED SENSITIVE VALUE***", "mail_smtppassword": "***REMOVED SENSITIVE VALUE***", "twofactor_enforced": true, "twofactor_enforced_groups": [ "admin" ], "twofactor_enforced_excluded_groups": [], "has_rebuilt_cache": true, "updater.release.channel": "stable", "app_install_overwrite": [ "keeweb", "radio" ] } }```

Are you using external storage, if yes which one (currently not supported by ocDownloader): local, Webdav

Are you using encryption (currently not supported by ocDownloader): no

Are you using an external user-backend, if yes which one: No

ocDownloader configuration:

Which downloader are you using: Curl

Do you use a proxy: Yes and No

Which protocols do you allow: FTP/HTTP/Youtube

Logs

Web server error log

Web server error log ``` Insert your webserver log here ```

Nextcloud log (data/nextcloud.log)

Nextcloud log ``` Nothing related ```
changemenemo commented 3 years ago

I will add that best[height<=1080] where it should since youtube-dl is totally capable of doing it... So I think that @GAS85 is wrong because he didn't try to change the width. It keeps getting downloaded in 1280 where it should be downloading in 1920

EDIT: unfortunately I don't have the command from youtube. The command provided before or even with -eo args under debian gives me only youtube as a result

GAS85 commented 3 years ago

I'm liming width, not height. It helps a lot in case of vertical videos. For "normal" videos it does not really matter, in both cases the same file will be downloaded:

youtube-dl https://www.youtube.com/watch?v=xxxxxxxxxxxx -f 'best[width<=1280]' -4
[youtube] xxxxxxxxxxxx: Downloading webpage
[download] Destination: xxxxxxxxxxxx.mp4

[download]   0.0% of 12.00MiB at Unknown speed ETA Unknown ETA
[download]   0.0% of 12.00MiB at Unknown speed ETA Unknown ETA
[download]   0.1% of 12.00MiB at Unknown speed ETA Unknown ETA
[download]   0.1% of 12.00MiB at 11.11MiB/s ETA 00:01
[download]   0.3% of 12.00MiB at  1.91MiB/s ETA 00:06
[download]   0.5% of 12.00MiB at  2.15MiB/s ETA 00:05
[download]   1.0% of 12.00MiB at  2.96MiB/s ETA 00:04
[download]   2.1% of 12.00MiB at  4.56MiB/s ETA 00:02
[download]   4.2% of 12.00MiB at  6.69MiB/s ETA 00:01
[download]   8.3% of 12.00MiB at  8.66MiB/s ETA 00:01
[download]  16.7% of 12.00MiB at 10.10MiB/s ETA 00:00
[download]  33.3% of 12.00MiB at 10.97MiB/s ETA 00:00
[download]  66.7% of 12.00MiB at 11.44MiB/s ETA 00:00
[download] 100.0% of 12.00MiB at 11.68MiB/s ETA 00:00
[download] 100% of 12.00MiB in 00:01

youtube-dl https://www.youtube.com/watch?v=xxxxxxxxxxxx -f 'best[height<=1080]' -4
[youtube] xxxxxxxxxxxx: Downloading webpage
[download] Destination: xxxxxxxxxxxx.mp4

[download]   0.0% of 12.00MiB at Unknown speed ETA Unknown ETA
[download]   0.0% of 12.00MiB at Unknown speed ETA Unknown ETA
[download]   0.1% of 12.00MiB at Unknown speed ETA Unknown ETA
[download]   0.1% of 12.00MiB at  7.26MiB/s ETA 00:01
[download]   0.3% of 12.00MiB at  1.73MiB/s ETA 00:06
[download]   0.5% of 12.00MiB at  2.09MiB/s ETA 00:05
[download]   1.0% of 12.00MiB at  2.91MiB/s ETA 00:04
[download]   2.1% of 12.00MiB at  4.53MiB/s ETA 00:02
[download]   4.2% of 12.00MiB at  6.64MiB/s ETA 00:01
[download]   8.3% of 12.00MiB at  8.59MiB/s ETA 00:01
[download]  16.7% of 12.00MiB at 10.04MiB/s ETA 00:00
[download]  33.3% of 12.00MiB at 10.94MiB/s ETA 00:00
[download]  66.7% of 12.00MiB at 11.40MiB/s ETA 00:00
[download] 100.0% of 12.00MiB at 11.64MiB/s ETA 00:00
[download] 100% of 12.00MiB in 00:01

Point of this ticket is that not all parameters are parsed to the command. So, e.g. Proxy with user authentication does not work at all.

changemenemo commented 3 years ago

Still no news about it?

GAS85 commented 3 years ago

Any update here? Half of parameters are not forwarded to the command Line: YTDLAudioFormat ProxyUser ProxyPassword


Just found a Workaround for Proxy, you can put Proxy User and Proxy Password directly to the Proxy Address in format:

http://ProxyUser:ProxyPassword@127.0.0.1

This will be correctly forwarded to the youtube-dl and works with Security remark: you will see you password in UI in a plane text. For socks5 simply use it as:

socks5://ProxyUser:ProxyPassword@127.0.0.1