Easy-to-use Python library for receiving YouTube push notification for video upload and edit in real-time
Project description
ytnoti
Easy-to-use Python library for receiving real-time YouTube push notifications for video uploads, edits, deletions, and live streams.
ytnoti is designed to help you receive YouTube push notifications in real-time for video
upload, edit, delete, and live stream easily and efficiently.
🛠️ How it works
This library uses YouTube Data API v3 via PubSubHubbub to receive push notifications, so you can receive notifications in real time without constantly polling the YouTube API.
In addition, this method doesn't require any API key for YouTube Data API, so you can use this library without any quota limit.
💻 Installation
This library requires Python 3.11 or higher.
pip install ytnoti
📖 Simple Example
Following is a simple example of how to use ngrok to receive push notifications (not recommended for production).
from pyngrok import ngrok
from ytnoti import YouTubeNotifier, Video
ngrok.set_auth_token("Your ngrok token here")
notifier = YouTubeNotifier()
@notifier.upload()
async def listener(video: Video) -> None:
print(f"New video from {video.channel.name}: {video.title}")
notifier.subscribe("UCuFFtHWoLl5fauMMD5Ww2jA") # Channel ID of CBC News
notifier.run()
Following is a simple example of how to use your domain to receive push notifications.
from ytnoti import YouTubeNotifier, Video
notifier = YouTubeNotifier(callback_url="https://yourdomain.com")
@notifier.upload()
async def listener(video: Video) -> None:
print(f"New video from {video.channel.name}: {video.title}")
notifier.subscribe("UCuFFtHWoLl5fauMMD5Ww2jA") # Channel ID of CBC News
notifier.run()
For more examples, please visit the examples folder.
📚 Documentation
Please read the documentation before asking questions. Your question may already be answered there.
👥 Community
If you are having any problems with using this library, please feel free to ask for help in the issues section or on my Discord server.
📄 License
This project is licensed under the MIT License - see the LICENSE.md file for details.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file ytnoti-3.0.0.tar.gz.
File metadata
- Download URL: ytnoti-3.0.0.tar.gz
- Upload date:
- Size: 18.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.10.3 {"installer":{"name":"uv","version":"0.10.3","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3c6668e67fb888485ab9ed430226309ca8c76dc045fe06ade73c6d283a829321
|
|
| MD5 |
343c08b6d52193f8022aa967eacbaae5
|
|
| BLAKE2b-256 |
18a580ee6bb137264c6bff56e1002fbd6dcf29ce50d898261e1d48a2492c3392
|
File details
Details for the file ytnoti-3.0.0-py3-none-any.whl.
File metadata
- Download URL: ytnoti-3.0.0-py3-none-any.whl
- Upload date:
- Size: 14.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.10.3 {"installer":{"name":"uv","version":"0.10.3","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
445fb75120f6cd1a36ee42c875300aeb2660736cd6d2b42ceff3bdaac759e64a
|
|
| MD5 |
560ce5fb111eaa921113bb7e46d294b4
|
|
| BLAKE2b-256 |
219c97fe438ff74f3ef07bf4481afd9c9f5984f50d1c457f501aed80f000c108
|