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
374 stars 85 forks source link

Unable to retrieve true YouTube video URL & Unable to retrieve true YouTube audio URL #216

Open etyrnal opened 3 years ago

etyrnal commented 3 years ago

Steps to reproduce

  1. find youtube url, such as https://www.youtube.com/watch?v=xcQbdpm9hZo
  2. enter url into ocDownloader URL field
  3. massively fail to dl..
  4. understand that if i login to the machine and run the youtube-dl commands from the command line youtube-dl does download the video or audio.

Expected behaviour

ocDownloader should immediately hand the url to youtube-dl, and youtube-dl should start start downloading to the default download directory

Actual behaviour

nothing but these errors Unable to retrieve true YouTube audio URL Unable to retrieve true YouTube video URL

Server configuration

Operating system: ubuntu 20.10 [Linux 5.8.0-63-generic x86_64]

Web server: apache [the one sudo snap install nextcloud installs]

Database: mysql 8.0.26

PHP version: 7.4.21

**Nextcloud version: 21.0.3

**Updated from an older Nextcloud/ownCloud or fresh install: FRESH

**Where did you install Nextcloud from: sudo snap install nextcloud

Login as admin user into your Nextcloud and access 
http://example.com/index.php/settings/integrity/failed 
paste the results here.

"No errors have been found."

List of activated apps: Accessibility 1.7.0 Featured
Activities for shared file downloads 1.11.1
Activities for shared file downloads, visible to all admins 1.10.0
Activity 2.14.3 Featured
Analytics 3.6.0
AppOrder 0.13.0
Automated media conversion 1.2.10
Automated PDF conversion 1.6.0
Bookmarks 4.4.1
Breeze Dark 21.0.10
Brute-force settings 2.2.0 Featured
Calendar 2.3.2 Featured
Carnet 0.24.2
Checksum 1.1.2
Collabora Online 4.2.2 Featured
Collabora Online - Built-in CODE Server 6.4.1004
Collaborative tags 1.11.0 Featured
Comments 1.11.0 Featured
Contacts 4.0.2 Featured
Contacts Interaction 1.2.0 Featured
Dashboard 7.1.0 Featured
Deleted files 1.11.0 Featured
Draw.io 1.0.1
DropIt 0.4.0
EPUB/CBZ/PDF ebook reader 1.4.6
External sites 3.8.2 Featured
External storage support 1.12.0 Featured
Extract 1.3.2
Favorites Quickaccess Sorting 1.1.2
Federation 1.11.0 Featured
File sharing 1.13.1 Featured
Files clipboard 0.7.1
First run wizard 2.10.0 Featured
Full text search - Bookmarks 1.2.0
Group folders 9.0.2 Featured
Impersonate 1.8.0 Featured
Log Reader 2.6.0 Featured
Maps 0.1.9 Featured
Mind Map 0.0.25
Monitoring 1.11.0 Featured
Music 1.3.1
Nextcloud announcements 1.10.0 Featured
Notes 4.1.1 Featured
Notifications 2.9.0 Featured
Notifications for calendar event updates 1.3.0
ocDownloader 1.7.12
Password policy 1.11.0 Featured
PDF viewer 2.1.0 Featured
Photos 1.3.0 Featured
Privacy 1.5.0 Featured
Quota warning 1.11.0
RainLoop 7.1.2
Recommendations 1.0.0 Featured
Right click 1.0.0 Featured
Share by mail 1.11.0 Featured
Sharing Path 0.3.0
Social sharing via email 2.2.0 Featured
Support 1.4.0 Featured
Suspicious Login 4.0.0
Talk 11.3.1 Featured
Tasks 0.14.1 Featured
Text 3.2.0 Featured
Theming 1.12.0 Featured
Usage survey 1.9.0 Featured
User status 1.1.1 Featured
Versions 1.14.0 Featured
Video player 1.10.0 Featured
Weather status 1.1.0

If you have access to your command line run e.g.:
sudo -u www-data php occ app:list
from within your Nextcloud installation folder

Enabled:

Nextcloud configuration: <?php $CONFIG = array ( 'apps_paths' => array ( 0 => array ( 'path' => '/snap/nextcloud/current/htdocs/apps', 'url' => '/apps', 'writable' => false, ), 1 => array ( 'path' => '/var/snap/nextcloud/current/nextcloud/extra-apps', 'url' => '/extra-apps', 'writable' => true, ), ), 'supportedDatabases' => array ( 0 => 'mysql', ), 'memcache.locking' => '\OC\Memcache\Redis', 'memcache.local' => '\OC\Memcache\Redis', 'redis' => array ( 'host' => '/tmp/sockets/redis.sock', 'port' => 0, ), 'log_type' => 'file', 'logfile' => '/var/snap/nextcloud/current/logs/nextcloud.log', 'logfilemode' => 416,

'trusteddomains' => array ( 0 => '127.0.0.1:2225', 1 => '', 2 => '', ), 'datadirectory' => '/var/snap/nextcloud/common/nextcloud/data', 'dbtype' => 'mysql', 'version' => '21.0.3.1', 'overwrite.cli.url' => 'http://127.0.0.1:2225', 'dbname' => 'nextcloud', 'dbhost' => 'localhost:/tmp/sockets/mysql.sock', 'dbport' => '', 'dbtableprefix' => 'oc', 'mysql.utf8mb4' => true, 'dbuser' => 'nextcloud', 'dbpassword' => '', 'installed' => true, 'app_install_overwrite' => array ( 0 => 'dropit', 1 => 'files_clipboard', 2 => 'whiteboard', 3 => 'admin_notifications', 4 => 'pdfdraw', 5 => 'bookmarks_fulltextsearch', 6 => 'files_fulltextsearch_tesseract', ), 'maintenance' => false, 'has_rebuilt_cache' => true, 'theme' => '', 'mail_smtpmode' => 'smtp', 'mail_sendmailmode' => 'smtp', );

If you have access to your command line run e.g.:
sudo -u www-data php occ config:list system
from within your Nextcloud installation folder

or 

Insert your config.php content here. 
Make sure to remove all sensitive content such as passwords. (e.g. database password, passwordsalt, secret, smtp password, …)

sudo nextcloud.occ config:list { "system": { "apps_paths": [ { "path": "\/snap\/nextcloud\/current\/htdocs\/apps", "url": "\/apps", "writable": false }, { "path": "\/var\/snap\/nextcloud\/current\/nextcloud\/extra-apps", "url": "\/extra-apps", "writable": true } ], "supportedDatabases": [ "mysql" ], "memcache.locking": "\OC\Memcache\Redis", "memcache.local": "\OC\Memcache\Redis", "redis": { "host": "REMOVED SENSITIVE VALUE", "port": 0 }, "log_type": "file", "logfile": "\/var\/snap\/nextcloud\/current\/logs\/nextcloud.log", "logfilemode": 416, "instanceid": "REMOVED SENSITIVE VALUE", "passwordsalt": "REMOVED SENSITIVE VALUE", "secret": "REMOVED SENSITIVE VALUE", "trusteddomains": [ "127.0.0.1:2225", "etyrnal.no-ip.com:2225", "etyrnal.com:2225" ], "datadirectory": "REMOVED SENSITIVE VALUE", "dbtype": "mysql", "version": "21.0.3.1", "overwrite.cli.url": "http:\/\/127.0.0.1:2225", "dbname": "REMOVED SENSITIVE VALUE", "dbhost": "REMOVED SENSITIVE VALUE", "dbport": "", "dbtableprefix": "oc", "mysql.utf8mb4": true, "dbuser": "REMOVED SENSITIVE VALUE", "dbpassword": "REMOVED SENSITIVE VALUE", "installed": true, "app_install_overwrite": [ "dropit", "files_clipboard", "whiteboard", "admin_notifications", "pdfdraw", "bookmarks_fulltextsearch", "files_fulltextsearch_tesseract" ], "maintenance": false, "has_rebuilt_cache": true, "theme": "", "mail_smtpmode": "smtp", "mail_sendmailmode": "smtp" }, "apps": { "accessibility": { "enabled": "yes", "installed_version": "1.7.0", "types": "" }, "activity": { "enabled": "yes", "installed_version": "2.14.3", "types": "filesystem" }, "admin_notifications": { "enabled": "yes", "installed_version": "1.0.2", "published-deprecation-notification": "yes", "types": "logging" }, "analytics": { "enabled": "yes", "installed_version": "3.6.0", "types": "" }, "appointments": { "enabled": "yes", "hk": "", "installed_version": "1.10.0", "new_backend": "4", "tiv": "", "types": "dav" }, "apporder": { "enabled": "yes", "installed_version": "0.13.0", "types": "" }, "audioplayer": { "enabled": "no", "installed_version": "3.2.1", "types": "filesystem" }, "backgroundjob": { "lastjob": "209" }, "bookmarks": { "enabled": "yes", "installed_version": "4.4.1", "types": "" }, "bookmarks_fulltextsearch": { "enabled": "yes", "installed_version": "1.2.0", "types": "" }, "breezedark": { "enabled": "yes", "installed_version": "21.0.10", "theme_cachebuster": "0", "theme_custom_styling": "", "theme_enabled": "1", "theme_login_page": "1", "types": "" }, "bruteforcesettings": { "enabled": "yes", "installed_version": "2.2.0", "types": "" }, "calendar": { "enabled": "yes", "installed_version": "2.3.2", "types": "" }, "carnet": { "enabled": "yes", "installed_version": "0.24.2", "types": "filesystem" }, "checksum": { "enabled": "yes", "installed_version": "1.1.2", "types": "filesystem" }, "circles": { "enabled": "yes", "installed_version": "0.21.4", "types": "filesystem,dav" }, "cloud_federation_api": { "enabled": "yes", "installed_version": "1.4.0", "types": "filesystem" }, "collectives": { "enabled": "yes", "installed_version": "0.12.21", "types": "filesystem" }, "comments": { "enabled": "yes", "installed_version": "1.11.0", "types": "logging" }, "contacts": { "enabled": "yes", "installed_version": "4.0.2", "types": "dav" }, "contactsinteraction": { "enabled": "yes", "installed_version": "1.2.0", "types": "dav" }, "core": { "backgroundjobs_mode": "cron", "installed.bundles": "[\"CoreBundle\"]", "installedat": "", "lastcron": "1630207520", "lastupdatedat": "1629151355.6816", "moveavatarsdone": "yes", "oc.integritycheck.checker": "[]", "previewsCleanedUp": "1", "public_files": "files_sharing\/public.php", "public_webdav": "dav\/appinfo\/v1\/publicwebdav.php", "theming.variables": "", "vendor": "nextcloud" }, "cospend": { "enabled": "yes", "installed_version": "1.3.7", "types": "" }, "dashboard": { "enabled": "yes", "installed_version": "7.1.0", "types": "" }, "dav": { "buildCalendarReminderIndex": "yes", "buildCalendarSearchIndex": "yes", "enabled": "yes", "installed_version": "1.17.1", "regeneratedBirthdayCalendarsForYearFix": "yes", "types": "filesystem" }, "deck": { "enabled": "yes", "installed_version": "1.4.3", "types": "dav" }, "drawio": { "enabled": "yes", "installed_version": "1.0.1", "types": "filesystem" }, "dropit": { "enabled": "yes", "installed_version": "0.4.0", "types": "" }, "epubreader": { "enabled": "yes", "installed_version": "1.4.6", "types": "" }, "event_update_notification": { "enabled": "yes", "installed_version": "1.3.0", "types": "logging,dav" }, "external": { "enabled": "yes", "installed_version": "3.8.2", "max_site": "3", "sites": "REMOVED SENSITIVE VALUE", "types": "" }, "extract": { "enabled": "yes", "installed_version": "1.3.2", "types": "" }, "federatedfilesharing": { "enabled": "yes", "installed_version": "1.11.0", "types": "" }, "federation": { "enabled": "yes", "installed_version": "1.11.0", "types": "authentication" }, "files": { "enabled": "yes", "installed_version": "1.16.0", "types": "filesystem" }, "files_clipboard": { "enabled": "yes", "installed_version": "0.7.1", "types": "" }, "files_downloadactivity": { "enabled": "yes", "installed_version": "1.11.1", "types": "filesystem" }, "files_external": { "allow_user_mounting": "yes", "enabled": "yes", "installed_version": "1.12.0", "types": "filesystem", "user_mounting_backends": "ftp,dav,owncloud,sftp,amazons3,swift,\OC\Files\Storage\SFTP_Key" }, "files_fulltextsearch": { "enabled": "yes", "installed_version": "21.0.4", "types": "filesystem" }, "files_mindmap": { "enabled": "yes", "installed_version": "0.0.25", "types": "" }, "files_pdfviewer": { "enabled": "yes", "installed_version": "2.1.0", "types": "" }, "files_rightclick": { "enabled": "yes", "installed_version": "1.0.0", "types": "" }, "files_sharing": { "enabled": "yes", "installed_version": "1.13.1", "types": "filesystem" }, "files_texteditor": { "enabled": "yes", "installed_version": "2.14.0", "types": "" }, "files_trackdownloads": { "enabled": "yes", "installed_version": "1.10.0", "types": "filesystem" }, "files_trashbin": { "enabled": "yes", "installed_version": "1.11.0", "types": "filesystem,dav" }, "files_versions": { "enabled": "yes", "installed_version": "1.14.0", "types": "filesystem,dav" }, "files_videoplayer": { "enabled": "yes", "installed_version": "1.10.0", "types": "" }, "firstrunwizard": { "enabled": "yes", "installed_version": "2.10.0", "types": "logging" }, "fulltextsearch": { "enabled": "yes", "installed_version": "21.0.3", "types": "" }, "fulltextsearch_elasticsearch": { "enabled": "yes", "installed_version": "21.0.2", "types": "" }, "geoblocker": { "enabled": "yes", "installed_version": "0.5.1", "types": "" }, "groupfolders": { "enabled": "yes", "installed_version": "9.0.2", "types": "filesystem,dav" }, "impersonate": { "enabled": "yes", "installed_version": "1.8.0", "types": "" }, "integration_dropbox": { "enabled": "yes", "installed_version": "1.0.1", "types": "" }, "integration_google": { "enabled": "yes", "installed_version": "1.0.2", "types": "" }, "logreader": { "enabled": "yes", "installed_version": "2.6.0", "types": "" }, "lookup_server_connector": { "enabled": "yes", "installed_version": "1.9.0", "types": "authentication" }, "mail": { "enabled": "no", "installed_version": "1.10.3", "types": "" }, "maps": { "enabled": "yes", "installed_version": "0.1.9", "lastAddressLookup": "", "types": "filesystem" }, "metadata": { "enabled": "yes", "installed_version": "0.14.0", "types": "" }, "music": { "enabled": "yes", "installed_version": "1.3.1", "types": "filesystem" }, "nextcloud_announcements": { "enabled": "yes", "installed_version": "1.10.0", "pub_date": "Thu, 24 Oct 2019 00:00:00 +0200", "types": "logging" }, "notes": { "enabled": "yes", "installed_version": "4.1.1", "types": "" }, "notifications": { "enabled": "yes", "installed_version": "2.9.0", "types": "logging" }, "oauth2": { "enabled": "yes", "installed_version": "1.9.0", "types": "authentication" }, "ocdownloader": { "enabled": "yes", "installed_version": "1.7.12", "types": "" }, "password_policy": { "enabled": "yes", "installed_version": "1.11.0", "types": "authentication" }, "pdfdraw": { "enabled": "yes", "installed_version": "0.1.2", "types": "" }, "photos": { "enabled": "yes", "installed_version": "1.3.0", "types": "" }, "previewgenerator": { "enabled": "yes", "installed_version": "3.1.1", "types": "filesystem" }, "privacy": { "enabled": "yes", "installed_version": "1.5.0", "types": "" }, "provisioning_api": { "enabled": "yes", "installed_version": "1.11.0", "types": "prevent_group_restriction" }, "quickaccesssorting": { "enabled": "yes", "installed_version": "1.1.2", "types": "" }, "quicknotes": { "enabled": "yes", "installed_version": "0.7.2", "types": "" }, "quota_warning": { "enabled": "yes", "installed_version": "1.11.0", "types": "filesystem" }, "rainloop": { "enabled": "yes", "installed_version": "7.1.2", "types": "" }, "recommendations": { "enabled": "yes", "installed_version": "1.0.0", "types": "" }, "richdocuments": { "disable_certificate_verification": "yes", "enabled": "yes", "installed_version": "4.2.2", "types": "filesystem,dav,prevent_group_restriction", "wopi_url": "" }, "richdocumentscode": { "enabled": "yes", "installed_version": "6.4.1004", "types": "" }, "serverinfo": { "cached_count_filecache": "109149", "cached_count_storages": "14", "enabled": "yes", "installed_version": "1.11.0", "types": "" }, "settings": { "enabled": "yes", "installed_version": "1.3.0", "types": "" }, "sharebymail": { "enabled": "yes", "installed_version": "1.11.0", "types": "filesystem" }, "sharingpath": { "enabled": "yes", "installed_version": "0.3.0", "types": "" }, "socialsharing_email": { "enabled": "yes", "installed_version": "2.2.0", "types": "" }, "spreed": { "enabled": "yes", "has_reference_id": "yes", "installed_version": "11.3.1", "project_access_invalidated": "1", "signaling_ticket_secret": "REMOVED SENSITIVE VALUE", "types": "dav,prevent_group_restriction" }, "support": { "SwitchUpdaterServerHasRun": "yes", "enabled": "yes", "installed_version": "1.4.0", "types": "session" }, "survey_client": { "enabled": "yes", "installed_version": "1.9.0", "types": "" }, "suspicious_login": { "enabled": "yes", "installed_version": "4.0.0", "types": "authentication" }, "systemtags": { "enabled": "yes", "installed_version": "1.11.0", "types": "logging" }, "tasks": { "enabled": "yes", "installed_version": "0.14.1", "types": "" }, "text": { "enabled": "yes", "installed_version": "3.2.0", "types": "dav" }, "theming": { "backgroundMime": "image\/jpeg", "cachebuster": "24", "color": "#24A2E0", "enabled": "yes", "installed_version": "1.12.0", "logoMime": "image\/png", "logoheaderMime": "image\/png", "name": "", "slogan": "REMOVED SENSITIVE VALUE", "types": "logging", "url": "REMOVED SENSITIVE VALUE" }, "twofactor_backupcodes": { "enabled": "yes", "installed_version": "1.10.0", "types": "" }, "user_status": { "enabled": "yes", "installed_version": "1.1.1", "types": "" }, "user_usage_report": { "enabled": "yes", "installed_version": "1.5.0", "types": "filesystem" }, "video_converter": { "enabled": "yes", "installed_version": "1.0.2", "types": "" }, "viewer": { "enabled": "yes", "installed_version": "1.5.0", "types": "" }, "weather_status": { "enabled": "yes", "installed_version": "1.1.0", "types": "" }, "whiteboard": { "enabled": "yes", "installed_version": "0.0.3", "types": "" }, "workflow_media_converter": { "enabled": "yes", "installed_version": "1.2.10", "types": "" }, "workflow_pdf_converter": { "enabled": "yes", "installed_version": "1.6.0", "types": "filesystem" }, "workflow_script": { "enabled": "yes", "installed_version": "1.6.0", "types": "filesystem" }, "workflowengine": { "enabled": "yes", "installed_version": "2.3.0", "types": "filesystem" } } }

Are you using external storage, if yes which one (currently not supported by ocDownloader): local/smb/sftp/...

NO

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

NO

Are you using an external user-backend, if yes which one: LDAP/ActiveDirectory/Webdav/...

NO

ocDownloader configuration:

Which downloader are you using: Curl

CURL

Do you use a proxy: Yes/No

NO

Which protocols do you allow: FTP/HTTP/Bittorrent/Youtube

HTTP / FTP / YOUTUBE

etyrnal commented 3 years ago

Why is i that no matter where the youtube-dl is put, and then that pathname given to ocDownloader, ocDownloader says it cannot find it?

z0ow commented 2 years ago

I have the same problem. This blog shows to pass the cookie to youtube-dl may be a solution

etyrnal commented 2 years ago

So, in a nextcloud installation, installed using snap, how do we link ocdownloader to the youtube-dl executable?

etyrnal commented 2 years ago

when i do a $ which youtube-dl my system does report /usr/local/bin/youtube-dl

So what's really going on here?

etyrnal commented 2 years ago

I have the same problem. This blog shows to pass the cookie to youtube-dl may be a solution

the videos links i am attempting to load aren't ager restricted.

also it happens on any and every youtube link i try.

e-alfred commented 2 years ago

Using ocDownloader on Nextcloud installations set up with Snap is not really supported. You would have to make Aria2c, Youtube-dl, Curl available inside the Snap package somehow which is not easy. If you can find a way to do it, you could submit a PR so this can be added to the Readme.

etyrnal commented 2 years ago

Using ocDownloader on Nextcloud installations set up with Snap is not really supported. You would have to make Aria2c, Youtube-dl, Curl available inside the Snap package somehow which is not easy. If you can find a way to do it, you could submit a PR so this can be added to the Readme.

What folder does the ocDownloader have access to? Why couldn't we just copy the youtube-dl file into a directory that ocDownload CAN read from / has access to?

weeman1337 commented 2 years ago

@etyrnal you could copy it to the data directory and configure the path in the settings. Can you give that a try? youtube-dl requires Python. I wonder if that is accessible from inside the snap packages.

If that works "Why couldn't we just copy the youtube-dl file into a directory that ocDownload CAN read from / has access to?" would be an option.

etyrnal commented 2 years ago

root@nc75:/var/snap/nextcloud/common/nextcloud/data# ls -lA you* -rwxr-xr-x 1 root root 209 Dec 6 11:22 youtube-dl root@nc75:/var/snap/nextcloud/common/nextcloud/data#

Tried it. Doesn't seem to change anything.

image

etyrnal commented 2 years ago

Tried the same putting youtube-dl (not an link) in ocdownloader's root folder

ls /var/snap/nextcloud/28678/nextcloud/extra-apps/ocdownloader appinfo css ISSUE_TEMPLATE.md l10n LICENSE SERVER **youtube-dl** controller img js lib README.md templates root@nc75:/var/snap/nextcloud/common/nextcloud/data#

image

etyrnal commented 2 years ago

Any other info i could supply that would help resolution of this issue? Is there a way to include the necessary components in the actual plugin contents? is there a way to make a sort of static version that has the youtube-dl binary, and whichever dependencies in the plugin package?

petob77 commented 2 years ago

@etyrnal use yt-dlp, for me worked