]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blame - support/doc/plugins/guide.md
fix nginx units
[github/Chocobozzz/PeerTube.git] / support / doc / plugins / guide.md
CommitLineData
662e5d4f
C
1# Plugins & Themes
2
d8e9a42c
C
3<!-- START doctoc generated TOC please keep comment here to allow auto update -->
4<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
5
6
7- [Concepts](#concepts)
8 - [Hooks](#hooks)
9 - [Static files](#static-files)
10 - [CSS](#css)
11 - [Server helpers (only for plugins)](#server-helpers-only-for-plugins)
12 - [Settings](#settings)
13 - [Storage](#storage)
7545a094 14 - [Update video constants](#update-video-constants)
5e2b2e27 15 - [Add custom routes](#add-custom-routes)
1a2820e6 16 - [Add external auth methods](#add-external-auth-methods)
7545a094 17 - [Client helpers (themes & plugins)](#client-helpers-themes--plugins)
b3af2601
C
18 - [Plugin static route](#plugin-static-route)
19 - [Notifier](#notifier)
20 - [Markdown Renderer](#markdown-renderer)
21 - [Custom Modal](#custom-modal)
7545a094
C
22 - [Translate](#translate)
23 - [Get public settings](#get-public-settings)
8546fe87 24 - [Add custom fields to video form](#add-custom-fields-to-video-form)
2498aaea 25 - [Add new transcoding profiles](#add-new-transcoding-profiles)
d8e9a42c
C
26 - [Publishing](#publishing)
27- [Write a plugin/theme](#write-a-plugintheme)
28 - [Clone the quickstart repository](#clone-the-quickstart-repository)
29 - [Configure your repository](#configure-your-repository)
30 - [Update README](#update-readme)
31 - [Update package.json](#update-packagejson)
32 - [Write code](#write-code)
7545a094 33 - [Add translations](#add-translations)
8546fe87 34 - [Build your plugin](#build-your-plugin)
d8e9a42c
C
35 - [Test your plugin/theme](#test-your-plugintheme)
36 - [Publish](#publish)
7545a094 37- [Plugin & Theme hooks/helpers API](#plugin--theme-hookshelpers-api)
d8e9a42c
C
38- [Tips](#tips)
39 - [Compatibility with PeerTube](#compatibility-with-peertube)
40 - [Spam/moderation plugin](#spammoderation-plugin)
112be80e 41 - [Other plugin examples](#other-plugin-examples)
d8e9a42c
C
42
43<!-- END doctoc generated TOC please keep comment here to allow auto update -->
44
662e5d4f
C
45## Concepts
46
32d7f2b7 47Themes are exactly the same as plugins, except that:
662e5d4f
C
48 * Their name starts with `peertube-theme-` instead of `peertube-plugin-`
49 * They cannot declare server code (so they cannot register server hooks or settings)
50 * CSS files are loaded by client only if the theme is chosen by the administrator or the user
51
52### Hooks
53
54A plugin registers functions in JavaScript to execute when PeerTube (server and client) fires events. There are 3 types of hooks:
5831dbcb 55 * `filter`: used to filter functions parameters or return values.
662e5d4f
C
56 For example to replace words in video comments, or change the videos list behaviour
57 * `action`: used to do something after a certain trigger. For example to send a hook every time a video is published
58 * `static`: same than `action` but PeerTube waits their execution
662e5d4f
C
59
60On server side, these hooks are registered by the `library` file defined in `package.json`.
61
62```json
63{
64 ...,
65 "library": "./main.js",
66 ...,
67}
68```
69
7545a094
C
70And `main.js` defines a `register` function:
71
72Example:
73
74```js
75async function register ({
76 registerHook,
5831dbcb 77
7545a094
C
78 registerSetting,
79 settingsManager,
5831dbcb 80
7545a094 81 storageManager,
5831dbcb 82
7545a094
C
83 videoCategoryManager,
84 videoLicenceManager,
5e2b2e27 85 videoLanguageManager,
5831dbcb 86
5e2b2e27 87 peertubeHelpers,
5831dbcb
C
88
89 getRouter,
90
91 registerExternalAuth,
92 unregisterExternalAuth,
93 registerIdAndPassAuth,
94 unregisterIdAndPassAuth
7545a094
C
95}) {
96 registerHook({
97 target: 'action:application.listening',
98 handler: () => displayHelloWorld()
99 })
100}
101```
102
662e5d4f
C
103
104On client side, these hooks are registered by the `clientScripts` files defined in `package.json`.
105All client scripts have scopes so PeerTube client only loads scripts it needs:
106
107```json
108{
109 ...,
110 "clientScripts": [
111 {
112 "script": "client/common-client-plugin.js",
113 "scopes": [ "common" ]
114 },
115 {
116 "script": "client/video-watch-client-plugin.js",
117 "scopes": [ "video-watch" ]
118 }
119 ],
120 ...
121}
122```
123
7545a094
C
124And these scripts also define a `register` function:
125
126```js
127function register ({ registerHook, peertubeHelpers }) {
128 registerHook({
129 target: 'action:application.init',
130 handler: () => onApplicationInit(peertubeHelpers)
131 })
132}
133```
134
662e5d4f
C
135### Static files
136
5831dbcb
C
137Plugins can declare static directories that PeerTube will serve (images for example)
138from `/plugins/{plugin-name}/{plugin-version}/static/`
662e5d4f
C
139or `/themes/{theme-name}/{theme-version}/static/` routes.
140
141### CSS
142
143Plugins can declare CSS files that PeerTube will automatically inject in the client.
7545a094
C
144If you need to override existing style, you can use the `#custom-css` selector:
145
146```
147body#custom-css {
148 color: red;
149}
150
151#custom-css .header {
152 background-color: red;
153}
154```
662e5d4f 155
9fa6ca16 156### Server helpers (only for plugins)
662e5d4f
C
157
158#### Settings
159
160Plugins can register settings, that PeerTube will inject in the administration interface.
161
162Example:
163
164```js
165registerSetting({
166 name: 'admin-name',
167 label: 'Admin name',
168 type: 'input',
972de8f1 169 // type: input | input-checkbox | input-password | input-textarea | markdown-text | markdown-enhanced
662e5d4f
C
170 default: 'my super name'
171})
172
173const adminName = await settingsManager.getSetting('admin-name')
2db9c70f
C
174
175const result = await settingsManager.getSettings([ 'admin-name', 'admin-password' ])
176result['admin-name]
5831dbcb
C
177
178settingsManager.onSettingsChange(settings => {
179 settings['admin-name])
180})
662e5d4f
C
181```
182
d8e9a42c 183#### Storage
662e5d4f
C
184
185Plugins can store/load JSON data, that PeerTube will store in its database (so don't put files in there).
186
187Example:
188
189```js
190const value = await storageManager.getData('mykey')
9fa6ca16 191await storageManager.storeData('mykey', { subkey: 'value' })
662e5d4f
C
192```
193
7545a094
C
194#### Update video constants
195
196You can add/delete video categories, licences or languages using the appropriate managers:
197
198```js
199videoLanguageManager.addLanguage('al_bhed', 'Al Bhed')
200videoLanguageManager.deleteLanguage('fr')
201
202videoCategoryManager.addCategory(42, 'Best category')
203videoCategoryManager.deleteCategory(1) // Music
204
205videoLicenceManager.addLicence(42, 'Best licence')
206videoLicenceManager.deleteLicence(7) // Public domain
b3af2601
C
207
208videoPrivacyManager.deletePrivacy(2) // Remove Unlisted video privacy
209playlistPrivacyManager.deletePlaylistPrivacy(3) // Remove Private video playlist privacy
7545a094
C
210```
211
5e2b2e27
C
212#### Add custom routes
213
214You can create custom routes using an [express Router](https://expressjs.com/en/4x/api.html#router) for your plugin:
215
216```js
217const router = getRouter()
218router.get('/ping', (req, res) => res.json({ message: 'pong' }))
219```
220
221The `ping` route can be accessed using:
222 * `/plugins/:pluginName/:pluginVersion/router/ping`
223 * Or `/plugins/:pluginName/router/ping`
224
225
5831dbcb
C
226#### Add external auth methods
227
228If you want to add a classic username/email and password auth method (like [LDAP](https://framagit.org/framasoft/peertube/official-plugins/-/tree/master/peertube-plugin-auth-ldap) for example):
229
230```js
231registerIdAndPassAuth({
232 authName: 'my-auth-method',
233
234 // PeerTube will try all id and pass plugins in the weight DESC order
235 // Exposing this value in the plugin settings could be interesting
236 getWeight: () => 60,
237
238 // Optional function called by PeerTube when the user clicked on the logout button
239 onLogout: user => {
240 console.log('User %s logged out.', user.username')
241 },
242
243 // Optional function called by PeerTube when the access token or refresh token are generated/refreshed
244 hookTokenValidity: ({ token, type }) => {
245 if (type === 'access') return { valid: true }
246 if (type === 'refresh') return { valid: false }
247 },
248
249 // Used by PeerTube when the user tries to authenticate
250 login: ({ id, password }) => {
251 if (id === 'user' && password === 'super password') {
252 return {
253 username: 'user'
254 email: 'user@example.com'
255 role: 2
256 displayName: 'User display name'
257 }
258 }
259
260 // Auth failed
261 return null
262 }
263})
264
265// Unregister this auth method
266unregisterIdAndPassAuth('my-auth-method')
267```
268
269You can also add an external auth method (like [OpenID](https://framagit.org/framasoft/peertube/official-plugins/-/tree/master/peertube-plugin-auth-openid-connect), [SAML2](https://framagit.org/framasoft/peertube/official-plugins/-/tree/master/peertube-plugin-auth-saml2) etc):
270
271```js
272// result contains the userAuthenticated auth method you can call to authenticate a user
273const result = registerExternalAuth({
274 authName: 'my-auth-method',
275
276 // Will be displayed in a button next to the login form
277 authDisplayName: () => 'Auth method'
278
279 // If the user click on the auth button, PeerTube will forward the request in this function
280 onAuthRequest: (req, res) => {
281 res.redirect('https://external-auth.example.com/auth')
282 },
283
284 // Same than registerIdAndPassAuth option
285 // onLogout: ...
286
287 // Same than registerIdAndPassAuth option
288 // hookTokenValidity: ...
289})
290
291router.use('/external-auth-callback', (req, res) => {
292 // Forward the request to PeerTube
293 result.userAuthenticated({
294 req,
295 res,
296 username: 'user'
297 email: 'user@example.com'
298 role: 2
299 displayName: 'User display name'
300 })
301})
302
303// Unregister this external auth method
304unregisterExternalAuth('my-auth-method)
305```
306
7545a094
C
307### Client helpers (themes & plugins)
308
74c2dece 309#### Plugin static route
7545a094
C
310
311To get your plugin static route:
312
313```js
314const baseStaticUrl = peertubeHelpers.getBaseStaticRoute()
315const imageUrl = baseStaticUrl + '/images/chocobo.png'
316```
317
74c2dece
K
318#### Notifier
319
320To notify the user with the PeerTube ToastModule:
321
322```js
323const { notifier } = peertubeHelpers
324notifier.success('Success message content.')
325notifier.error('Error message content.')
326```
327
8c7725dc
K
328#### Markdown Renderer
329
330To render a formatted markdown text to HTML:
331
332```js
333const { markdownRenderer } = peertubeHelpers
334
335await markdownRenderer.textMarkdownToHTML('**My Bold Text**')
336// return <strong>My Bold Text</strong>
337
338await markdownRenderer.enhancedMarkdownToHTML('![alt-img](http://.../my-image.jpg)')
339// return <img alt=alt-img src=http://.../my-image.jpg />
340```
341
437e8e06
K
342#### Custom Modal
343
344To show a custom modal:
345
346```js
347 peertubeHelpers.showModal({
348 title: 'My custom modal title',
349 content: '<p>My custom modal content</p>',
350 // Optionals parameters :
351 // show close icon
352 close: true,
353 // show cancel button and call action() after hiding modal
354 cancel: { value: 'cancel', action: () => {} },
355 // show confirm button and call action() after hiding modal
356 confirm: { value: 'confirm', action: () => {} },
357 })
358```
359
7545a094
C
360#### Translate
361
362You can translate some strings of your plugin (PeerTube will use your `translations` object of your `package.json` file):
363
364```js
365peertubeHelpers.translate('User name')
366 .then(translation => console.log('Translated User name by ' + translation))
367```
368
369#### Get public settings
370
371To get your public plugin settings:
372
373```js
374peertubeHelpers.getSettings()
375 .then(s => {
376 if (!s || !s['site-id'] || !s['url']) {
377 console.error('Matomo settings are not set.')
378 return
379 }
5831dbcb 380
7545a094
C
381 // ...
382 })
5831dbcb 383```
7545a094 384
8546fe87 385#### Add custom fields to video form
e08a26e2
C
386
387To add custom fields in the video form (in *Plugin settings* tab):
388
8546fe87 389```js
e08a26e2
C
390async function register ({ registerVideoField, peertubeHelpers }) {
391 const descriptionHTML = await peertubeHelpers.translate(descriptionSource)
392 const commonOptions = {
393 name: 'my-field-name,
394 label: 'My added field',
395 descriptionHTML: 'Optional description',
396 type: 'input-textarea',
397 default: ''
398 }
399
400 for (const type of [ 'upload', 'import-url', 'import-torrent', 'update' ]) {
401 registerVideoField(commonOptions, { type })
402 }
403}
404```
405
406PeerTube will send this field value in `body.pluginData['my-field-name']` and fetch it from `video.pluginData['my-field-name']`.
407
408So for example, if you want to store an additional metadata for videos, register the following hooks in **server**:
409
8546fe87 410```js
e08a26e2
C
411async function register ({
412 registerHook,
413 storageManager
414}) {
415 const fieldName = 'my-field-name'
416
417 // Store data associated to this video
418 registerHook({
419 target: 'action:api.video.updated',
420 handler: ({ video, body }) => {
421 if (!body.pluginData) return
422
423 const value = body.pluginData[fieldName]
424 if (!value) return
425
426 storageManager.storeData(fieldName + '-' + video.id, value)
427 }
428 })
429
430 // Add your custom value to the video, so the client autofill your field using the previously stored value
431 registerHook({
432 target: 'filter:api.video.get.result',
433 handler: async (video) => {
434 if (!video) return video
435 if (!video.pluginData) video.pluginData = {}
436
437 const result = await storageManager.getData(fieldName + '-' + video.id)
438 video.pluginData[fieldName] = result
439
440 return video
441 }
442 })
443}
2498aaea
C
444```
445
446#### Add new transcoding profiles
447
448Adding transcoding profiles allow admins to change ffmpeg encoding parameters and/or encoders.
449A transcoding profile has to be chosen by the admin of the instance using the admin configuration.
e08a26e2 450
2498aaea
C
451```js
452async function register ({
453 transcodingManager
454}) {
455
456 // Adapt bitrate when using libx264 encoder
457 {
458 const builder = (options) => {
459 const { input, resolution, fps, streamNum } = options
460
461 const streamString = streamNum ? ':' + streamNum : ''
462
463 // You can also return a promise
464 return {
465 outputOptions: [
466 // Use a custom bitrate
467 '-b' + streamString + ' 10K'
468 ]
469 }
470 }
471
472 const encoder = 'libx264'
473 const profileName = 'low-quality'
474
475 // Support this profile for VOD transcoding
476 transcodingManager.addVODProfile(encoder, profileName, builder)
477
478 // And/Or support this profile for live transcoding
479 transcodingManager.addLiveProfile(encoder, profileName, builder)
480 }
481
482 {
483 const builder = (options) => {
484 const { streamNum } = options
485
486 const streamString = streamNum ? ':' + streamNum : ''
487
488 // Always copy stream when PeerTube use libfdk_aac or aac encoders
489 return {
490 copy: true
491 }
492 }
493
494 const profileName = 'copy-audio'
495
496 for (const encoder of [ 'libfdk_aac', 'aac' ]) {
497 transcodingManager.addVODProfile(encoder, profileName, builder)
498 }
499 }
500```
501
502PeerTube will try different encoders depending on their priority.
503If the encoder is not available in the current transcoding profile or in ffmpeg, it tries the next one.
504Plugins can change the order of these encoders and add their custom encoders:
505
506```js
507async function register ({
508 transcodingManager
509}) {
510
511 // Adapt bitrate when using libx264 encoder
512 {
513 const builder = () => {
514 return {
515 outputOptions: []
516 }
517 }
518
78995146 519 // Support libopus and libvpx-vp9 encoders (these codecs could be incompatible with the player)
2498aaea
C
520 transcodingManager.addVODProfile('libopus', 'test-vod-profile', builder)
521
522 // Default priorities are ~100
523 // Lowest priority = 1
524 transcodingManager.addVODEncoderPriority('audio', 'libopus', 1000)
525
526 transcodingManager.addVODProfile('libvpx-vp9', 'test-vod-profile', builder)
527 transcodingManager.addVODEncoderPriority('video', 'libvpx-vp9', 1000)
528
529 transcodingManager.addLiveProfile('libopus', 'test-live-profile', builder)
530 transcodingManager.addLiveEncoderPriority('audio', 'libopus', 1000)
531 }
e08a26e2
C
532```
533
7545a094 534
662e5d4f
C
535### Publishing
536
537PeerTube plugins and themes should be published on [NPM](https://www.npmjs.com/) so that PeerTube indexes
538take into account your plugin (after ~ 1 day). An official PeerTube index is available on https://packages.joinpeertube.org/ (it's just a REST API, so don't expect a beautiful website).
539
540## Write a plugin/theme
541
542Steps:
543 * Find a name for your plugin or your theme (must not have spaces, it can only contain lowercase letters and `-`)
544 * Add the appropriate prefix:
545 * If you develop a plugin, add `peertube-plugin-` prefix to your plugin name (for example: `peertube-plugin-mysupername`)
546 * If you develop a theme, add `peertube-theme-` prefix to your theme name (for example: `peertube-theme-mysupertheme`)
547 * Clone the quickstart repository
548 * Configure your repository
549 * Update `README.md`
550 * Update `package.json`
551 * Register hooks, add CSS and static files
552 * Test your plugin/theme with a local PeerTube installation
553 * Publish your plugin/theme on NPM
554
555### Clone the quickstart repository
556
557If you develop a plugin, clone the `peertube-plugin-quickstart` repository:
558
559```
560$ git clone https://framagit.org/framasoft/peertube/peertube-plugin-quickstart.git peertube-plugin-mysupername
561```
562
563If you develop a theme, clone the `peertube-theme-quickstart` repository:
564
565```
566$ git clone https://framagit.org/framasoft/peertube/peertube-theme-quickstart.git peertube-theme-mysupername
567```
568
569### Configure your repository
570
571Set your repository URL:
572
573```
574$ cd peertube-plugin-mysupername # or cd peertube-theme-mysupername
575$ git remote set-url origin https://your-git-repo
576```
577
578### Update README
579
580Update `README.md` file:
581
582```
583$ $EDITOR README.md
584```
585
586### Update package.json
587
588Update the `package.json` fields:
589 * `name` (should start with `peertube-plugin-` or `peertube-theme-`)
590 * `description`
591 * `homepage`
592 * `author`
593 * `bugs`
594 * `engine.peertube` (the PeerTube version compatibility, must be `>=x.y.z` and nothing else)
5831dbcb 595
662e5d4f 596**Caution:** Don't update or remove other keys, or PeerTube will not be able to index/install your plugin.
5831dbcb 597If you don't need static directories, use an empty `object`:
662e5d4f
C
598
599```json
600{
601 ...,
602 "staticDirs": {},
603 ...
604}
605```
606
9fa6ca16 607And if you don't need CSS or client script files, use an empty `array`:
662e5d4f
C
608
609```json
610{
611 ...,
612 "css": [],
9fa6ca16 613 "clientScripts": [],
662e5d4f
C
614 ...
615}
616```
617
618### Write code
619
620Now you can register hooks or settings, write CSS and add static directories to your plugin or your theme :)
621
5831dbcb 622**Caution:** It's up to you to check the code you write will be compatible with the PeerTube NodeJS version,
662e5d4f
C
623and will be supported by web browsers.
624If you want to write modern JavaScript, please use a transpiler like [Babel](https://babeljs.io/).
625
7545a094
C
626### Add translations
627
628If you want to translate strings of your plugin (like labels of your registered settings), create a file and add it to `package.json`:
629
630```json
631{
632 ...,
633 "translations": {
634 "fr-FR": "./languages/fr.json",
635 "pt-BR": "./languages/pt-BR.json"
636 },
637 ...
638}
639```
640
641The key should be one of the locales defined in [i18n.ts](https://github.com/Chocobozzz/PeerTube/blob/develop/shared/models/i18n/i18n.ts).
642You **must** use the complete locales (`fr-FR` instead of `fr`).
643
112be80e
C
644Translation files are just objects, with the english sentence as the key and the translation as the value.
645`fr.json` could contain for example:
646
647```json
648{
649 "Hello world": "Hello le monde"
650}
651```
652
36578353
C
653### Build your plugin
654
655If you added client scripts, you'll need to build them using webpack.
656
657Install webpack:
658
659```
660$ npm install
661```
662
663Add/update your files in the `clientFiles` array of `webpack.config.js`:
664
665```
666$ $EDITOR ./webpack.config.js
667```
668
669Build your client files:
670
671```
672$ npm run build
673```
674
675You built files are in the `dist/` directory. Check `package.json` to correctly point to them.
676
677
662e5d4f
C
678### Test your plugin/theme
679
680You'll need to have a local PeerTube instance:
5831dbcb 681 * Follow the [dev prerequisites](https://github.com/Chocobozzz/PeerTube/blob/develop/.github/CONTRIBUTING.md#prerequisites)
662e5d4f 682 (to clone the repository, install dependencies and prepare the database)
5831dbcb 683 * Build PeerTube (`--light` to only build the english language):
662e5d4f
C
684
685```
686$ npm run build -- --light
9fa6ca16
C
687```
688
689 * Build the CLI:
5831dbcb 690
9fa6ca16
C
691```
692$ npm run setup:cli
662e5d4f 693```
5831dbcb
C
694
695 * Run PeerTube (you can access to your instance on http://localhost:9000):
662e5d4f
C
696
697```
698$ NODE_ENV=test npm start
699```
700
5831dbcb 701 * Register the instance via the CLI:
662e5d4f
C
702
703```
704$ node ./dist/server/tools/peertube.js auth add -u 'http://localhost:9000' -U 'root' --password 'test'
705```
706
707Then, you can install or reinstall your local plugin/theme by running:
708
709```
710$ node ./dist/server/tools/peertube.js plugins install --path /your/absolute/plugin-or-theme/path
711```
712
713### Publish
714
715Go in your plugin/theme directory, and run:
716
717```
718$ npm publish
719```
720
721Every time you want to publish another version of your plugin/theme, just update the `version` key from the `package.json`
722and republish it on NPM. Remember that the PeerTube index will take into account your new plugin/theme version after ~24 hours.
723
d8e9a42c 724
bfa1a32b
C
725## Plugin & Theme hooks/helpers API
726
7cf88d09 727See the dedicated documentation: https://docs.joinpeertube.org/api-plugins
bfa1a32b
C
728
729
d8e9a42c
C
730## Tips
731
732### Compatibility with PeerTube
733
734Unfortunately, we don't have enough resources to provide hook compatibility between minor releases of PeerTube (for example between `1.2.x` and `1.3.x`).
735So please:
736 * Don't make assumptions and check every parameter you want to use. For example:
737
738```js
739registerHook({
740 target: 'filter:api.video.get.result',
741 handler: video => {
742 // We check the parameter exists and the name field exists too, to avoid exceptions
743 if (video && video.name) video.name += ' <3'
744
745 return video
746 }
747})
748```
a4879b53 749 * Don't try to require parent PeerTube modules, only use `peertubeHelpers`. If you need another helper or a specific hook, please [create an issue](https://github.com/Chocobozzz/PeerTube/issues/new/choose)
5831dbcb 750 * Don't use PeerTube dependencies. Use your own :)
d8e9a42c 751
51326912 752If your plugin is broken with a new PeerTube release, update your code and the `peertubeEngine` field of your `package.json` field.
5831dbcb 753This way, older PeerTube versions will still use your old plugin, and new PeerTube versions will use your updated plugin.
d8e9a42c
C
754
755### Spam/moderation plugin
756
757If you want to create an antispam/moderation plugin, you could use the following hooks:
758 * `filter:api.video.upload.accept.result`: to accept or not local uploads
759 * `filter:api.video-thread.create.accept.result`: to accept or not local thread
760 * `filter:api.video-comment-reply.create.accept.result`: to accept or not local replies
761 * `filter:api.video-threads.list.result`: to change/hide the text of threads
762 * `filter:api.video-thread-comments.list.result`: to change/hide the text of replies
763 * `filter:video.auto-blacklist.result`: to automatically blacklist local or remote videos
5831dbcb 764
112be80e
C
765### Other plugin examples
766
767You can take a look to "official" PeerTube plugins if you want to take inspiration from them: https://framagit.org/framasoft/peertube/official-plugins