Get Course Resource / File
virtuale_get_resourceRetrieve Virtuale files and resources via cmid or URL, following redirects with authenticated cookies. Returns metadata, inline text for text-like files, or saves to disk.
Instructions
Fetches a Virtuale file/resource by cmid (builds /mod/resource/view.php?id=) or an explicit url, following the redirect to the protected pluginfile.php content with the authenticated MoodleSession cookie. Always returns metadata (final URL, content-type, size, filename). If save_to (an absolute file path) is given, streams the file to disk and returns the path + byte size. Otherwise returns text inline for text-like files (text/JSON/XML/HTML) and extracts + returns the text of PDFs; very long text is truncated (pass save_to for the full file). Read-only.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| url | No | ||
| cmid | No | ||
| cookies | No | ||
| save_to | No | ||
| base_url | No | ||
| session_id | No |