Skip to main content

wagtailembedpeertube

Embed PeerTube videos into Wagtail.

Introduction

Wagtail has a great support of oEmbed for embedding content. Unfortunately, the oEmbed mechanism is based on services domain names and URI; and this is prone to centralization since it limits to a short list of selected providers.

By the way, there is already hundreds instances and it will probably grow with years - see PeerTube instances.

This app brings oEmbed support for decentralized PeerTube instances. To do this, it only focuses on a string URI filtering, allowing all services from any domain name.

Installation

  1. Install using pip:

    pip install wagtailembedpeertube
    
  2. Add wagtailembedpeertube to your INSTALLED_APPS setting somewhere after wagtail.embeds:

    INSTALLED_APPS = [
        ...
        "wagtail.embeds",
        ...
        "wagtailembedpeertube",
        ...
    ]
    
  3. Configure embed finders in WAGTAILEMBEDS_FINDERS setting to add PeerTube's one at the end, i.e.:

    WAGTAILEMBEDS_FINDERS = [
        {
            "class": "wagtail.embeds.finders.oembed",
        },
        {
            "class": "wagtailembedpeertube.finders",
        },
    ]
    

    Since the first matching finder will be used, wagtailembedpeertube should be declared as last because others finders are matching domain names and may be more precise. See Configuring embed “finders” for more details.

Usage

That's it! You should now be able to embed any PeerTube content using the EmbedBlock:

from wagtail.embeds.blocks import EmbedBlock

class MyStreamField(blocks.StreamBlock):
    ...

    embed = EmbedBlock()

Development

To setup a development environment, clone this repository and follow the installation steps but replace the installation from PyPi by:

pip install -e .[test]

The Python code is formatted and linted thanks to flake8, isort and black. To ease the use of this tools, the following commands are available:

  • make lint: check the Python code syntax and imports order
  • make format: fix the Python code syntax and imports order

License

This extension is mainly developed by Cliss XXI and licensed under the AGPLv3+. Any contribution is welcome!

Metadata

Release files for wagtailembedpeertube 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for wagtailembedpeertube 0.2.0
File Size Uploaded
wagtailembedpeertube-0.2.0.tar.gz 20.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for wagtailembedpeertube 0.2.0
File Interpreter ABI Platform
wagtailembedpeertube-0.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 36.8 kB

Release files / wagtailembedpeertube-0.2.0.tar.gz

Download URL wagtailembedpeertube-0.2.0.tar.gz
Size 20.6 kB
Tags Source
SHA-256 checksum
How to use checksums
431ffe09a9ccedd6c69906ff342c37582cf5ee32da421a8fc79aae071bb57a27
BLAKE2b-256 checksum
How to use checksums
4aa1ad032fe6df7d52cb07b0a1329d734373a1e8f1adca2ce71e3f40f75ae4f2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.3.0 pkginfo/1.4.2 requests/2.25.1 setuptools/52.0.0 requests-toolbelt/0.9.1 tqdm/4.57.0 CPython/3.9.2

Release files / wagtailembedpeertube-0.2.0-py3-none-any.whl

Download URL wagtailembedpeertube-0.2.0-py3-none-any.whl
Size 16.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
175555312e1a9cfefea86bf72a189b73c601733d3952a3bbcd9ecfc9d55430b4
BLAKE2b-256 checksum
How to use checksums
542f09048b9bff0ea9d3bfae4f35540b51e1ca860e88cfb48a04bd356b207ffa
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.3.0 pkginfo/1.4.2 requests/2.25.1 setuptools/52.0.0 requests-toolbelt/0.9.1 tqdm/4.57.0 CPython/3.9.2

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files

0.1.1

2 release files

0.1.0

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page