maubot-youtube/README.md

45 lines
1.7 KiB
Markdown
Raw Permalink Normal View History

2025-02-06 19:53:28 -05:00
# maubot-youtube
A [maubot](https://github.com/maubot/maubot) plugin to display YouTube video details.
## Installation
Either download an `.mbp` file from the [release assets](https://laboon.dev/brad/maubot-youtube/releases) or [build one yourself](#building).
Then, [upload](https://docs.mau.fi/maubot/usage/basic.html#uploading-plugins) it to your maubot instance.
## Configuration
Before configuring your instance, you must first create an API token at the [Google Developer Console](https://console.developers.google.com) via the following steps:
1. Create a new project
2. Click "Enable APIs and Services", select the "YouTube Data API v3", and click "Enable"
3. Click "Create Credentials", select "YouTube Data API v3", and choose "Public data" and copy your key into the `api_key` config setting.
Additionally, if you have URL previews enabled on your homeserver you may want to consider blacklisting youtube to prevent double previews.
Example config for synapse:
```
url_preview_url_blacklist:
- netloc: 'youtube.com'
- netloc: 'www.youtube.com'
- netloc: 'youtu.be'
```
## Usage
Once configured, you can use `!youtube <video>` to view the details of the specified video (can be a raw ID or a full URL).
`!yt <video>` can also be used as a shortcut.
## Building
Use the `mbc` tool to build this plugin:
```
mbc build
```
Optionally, use the `-u` switch to upload it to your maubot instance, if configured:
```
mbc build -u
```
Since `.mbp` files are just zip archives with a different name, you can also just zip the files of this repository:
```
2025-02-06 19:54:37 -05:00
zip -r youtube.mbp *
2025-02-06 19:53:28 -05:00
```
## License
<img align="right" src="https://www.gnu.org/graphics/agplv3-155x51.png" />
This project is licensed under the GNU Affero General Public License v3.0, see [LICENSE](LICENSE).