Home
Softono
ytnoti

ytnoti

Open source MIT Python
26
Stars
1
Forks
1
Issues
2
Watchers
2 months
Last Commit

About ytnoti

Easy-to-use Python library for receiving real-time YouTube push notifications for video uploads, edits, deletions, and live streams.

Platforms

Web Self-hosted

Languages

Python
logo

ytnoti

Easy-to-use Python library for receiving real-time YouTube push notifications for video uploads, edits, deletions, and live streams.
PyPI version

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.

discord invite

๐Ÿ“„ License

This project is licensed under the MIT License - see the LICENSE.md file for details.