gnu-social/plugins/StoreRemoteMedia
Diogo Peralta Cordeiro fbeadc1d49 [StoreRemoteMedia][SCRIPTS] Fix typo in query
This was introduced in 11ebb98919f56f7dcf888adfbebf9e8826f995b4#diff-96141878409d7418ea5a9eefbde509b43482c01R70
The arg number should have been one, as there's only one...
2021-07-16 15:46:25 +01:00
..
locale [VersionBump] 2.0.0alpha0 2020-08-04 05:31:44 +01:00
scripts [StoreRemoteMedia][SCRIPTS] Fix typo in query 2021-07-16 15:46:25 +01:00
README.md [MEDIA] Allow thumbnail only entries 2021-02-21 16:03:47 +00:00
StoreRemoteMediaPlugin.php [StoreRemoteMedia] Fix failing to show remote thumbnails on first load 2021-04-13 14:58:55 +01:00

The StoreRemoteMedia plugin downloads remotely attached files to local server.

IMPORTANT: If using both Embed and StoreRemoteMedia plugins, Embed should be added first.

Installation

add addPlugin('StoreRemoteMedia'); to the bottom of your config.php

Settings

  • domain_whitelist: Array of regular expressions. Always escape your dots and end your strings.
  • check_whitelist: Whether to check the domain_whitelist.

When check_whitelist is set, only images from URLs matching a regex in the domain_whitelist array are accepted for local storage.

  • thumbnail_width: Maximum width of the thumbnail in pixels. Defaults to global [thumbnail][width].
  • thumbnail_height: Maximum height of the thumbnail in pixels. Defaults to global [thumbnail][height].
  • crop: Crop to the size (not preserving aspect ratio). Defaults to global [thumbnail][crop].
  • max_size: Max media size. Anything bigger than this is rejected. Defaults to global [attachments][file_quota].
  • store_original: Whether to maintain a copy of the original media or only a thumbnail of it. Defaults to false.

Example

addPlugin('StoreRemoteMedia', [
    'domain_whitelist' => [
        '^i\d*\.ytimg\.com$' => 'YouTube',
        '^i\d*\.vimeocdn\.com$' => 'Vimeo'
    ],
    'check_whitelist' => true,
]);