Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/simonw/datasette-youtube-embed
Turn YouTube URLs into embedded players in Datasette
https://github.com/simonw/datasette-youtube-embed
Last synced: 27 days ago
JSON representation
Turn YouTube URLs into embedded players in Datasette
- Host: GitHub
- URL: https://github.com/simonw/datasette-youtube-embed
- Owner: simonw
- License: apache-2.0
- Created: 2023-01-27T17:52:05.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2023-01-27T20:09:30.000Z (almost 2 years ago)
- Last Synced: 2024-10-06T20:29:15.614Z (about 1 month ago)
- Language: JavaScript
- Homepage:
- Size: 10.7 KB
- Stars: 6
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# datasette-youtube-embed
[![PyPI](https://img.shields.io/pypi/v/datasette-youtube-embed.svg)](https://pypi.org/project/datasette-youtube-embed/)
[![Changelog](https://img.shields.io/github/v/release/simonw/datasette-youtube-embed?include_prereleases&label=changelog)](https://github.com/simonw/datasette-youtube-embed/releases)
[![Tests](https://github.com/simonw/datasette-youtube-embed/workflows/Test/badge.svg)](https://github.com/simonw/datasette-youtube-embed/actions?query=workflow%3ATest)
[![License](https://img.shields.io/badge/license-Apache%202.0-blue.svg)](https://github.com/simonw/datasette-youtube-embed/blob/main/LICENSE)Turn YouTube URLs into embedded players in Datasette
## Installation
Install this plugin in the same environment as Datasette.
datasette install datasette-youtube-embed
## Usage
Once installed, any columns containing URLs that look like one of these:
- `https://www.youtube.com/watch?v=xyz`
- `https://www.youtube.com/watch?v=xyz&start=30`
- `https://www.youtube.com/watch?v=xyz&start=30&end=50`Will be turned into YouTube embeds like this:
```html
```
These will then be rendered using [Lite YouTube Embed](https://github.com/paulirish/lite-youtube-embed), which avoids loading the full YouTube embed until someone interacts with it.## Development
To set up this plugin locally, first checkout the code. Then create a new virtual environment:
cd datasette-youtube-embed
python3 -m venv venv
source venv/bin/activateNow install the dependencies and test dependencies:
pip install -e '.[test]'
To run the tests:
pytest