Skip to main content
logo

ytnoti

Easy-to-use Python library for receiving real-time YouTube push notifications for video uploads, edits, deletions, and live streams.
Downloads License PyPI version Python versions GitHub stars
Coverage pytest ruff ty uv

Documentation  •  Quickstart  •  Examples  •  Changelog  •  Discord

ytnoti is designed to help you receive YouTube push notifications in real-time for video upload, edit, delete, and live stream easily and efficiently.

✨ Features

  • Real-time push, not polling. YouTube's hub calls you the moment a video changes.
  • No API key, no quota. There is nothing to provision and nothing to run out of.
  • Async and sync. Use AsyncYouTubeNotifier, or YouTubeNotifier if you don't run an event loop.
  • Listeners for every event. Register @notifier.upload(), @notifier.edit(), @notifier.delete() or @notifier.any(), globally or per channel.
  • Brings its own server, or joins yours. Pass your existing FastAPI app and ytnoti mounts onto it.
  • Verified callbacks. Every notification is checked against an HMAC signature before a listener sees it.

🛠️ How it works

This library uses YouTube Data API v3 via WebSub (called PubSubHubbub in YouTube's docs) to receive push notifications, so you can receive notifications in real time without constantly polling the YouTube API.

💻 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

🤝 Contributing

Contributions of every size are welcome, whether it's a bug report, a typo fix in the docs, or a new feature. Read CONTRIBUTING.md to set up the project with uv in a few commands, or browse the good first issues to find somewhere to start.

🌟 Contributors

Thanks to everyone who has contributed to ytnoti!

contributors

📄 License

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

Metadata

Release files for ytnoti 3.0.4

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

Source distribution (sdist)

Source distribution for ytnoti 3.0.4
File Size Uploaded
ytnoti-3.0.4.tar.gz 25.2 kB Details

Built distribution (wheel)

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

Total release size: 42.7 kB

Release files / ytnoti-3.0.4.tar.gz

Download URL ytnoti-3.0.4.tar.gz
Size 25.2 kB
Tags Source
SHA-256 checksum
How to use checksums
bdc95f1637ffb39dc28b1ecf137638868eee294f1d0d95d6c96f389ddc21b91b
BLAKE2b-256 checksum
How to use checksums
9033f36a9192de95734e7ca82cbad088a55f2613b6b6579afb20c4fe25ba8317
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.19 {"installer":{"name":"uv","version":"0.12.19","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}

Release files / ytnoti-3.0.4-py3-none-any.whl

Download URL ytnoti-3.0.4-py3-none-any.whl
Size 17.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0c940aa1ce5764b8a4e87f8177d72ff33adf08a57aab55632f5c7aa3f9faf6be
BLAKE2b-256 checksum
How to use checksums
d77bc4933868be6c4bf7fda4ccb2d9d8ba6dbf61b231c9b5a325459660f2e163
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.19 {"installer":{"name":"uv","version":"0.12.19","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}

Release history Release notifications | RSS feed

This release

3.0.4 This release

2 release files

3.0.3

2 release files

3.0.2

2 release files

3.0.1

2 release files

3.0.0

2 release files

2.1.4

2 release files

2.1.3

2 release files

2.1.2

2 release files

2.1.1

2 release files

2.1.0

2 release files

2.0.1

2 release files

2.0.0

2 release files

1.1.2

2 release files

1.1.1

2 release files

1.1.0

2 release files

1.0.1

2 release files

1.0.0

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

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