diff --git a/README.md b/README.md index 9d9f642..68cce29 100644 --- a/README.md +++ b/README.md @@ -39,6 +39,10 @@ For more examples, please visit the [examples](https://github.com/SeoulSKY/ytnot ```python from ytnoti import YouTubeNotifier, Video +from pyngrok import ngrok + +# Create your ngrok token free from https://dashboard.ngrok.com/get-started/setup +ngrok.set_auth_token("Your ngrok token here") notifier = YouTubeNotifier() diff --git a/docs/index.rst b/docs/index.rst index 89548e2..35556d7 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -52,6 +52,10 @@ For more examples, please visit the `examples None: if __name__ == "__main__": + ngrok.set_auth_token("Your ngrok token here") + LOG_FORMAT = "%(asctime)s - %(name)s - %(levelname)s - %(message)s" LOG_LEVEL = logging.INFO logging.basicConfig(level=LOG_LEVEL, format=LOG_FORMAT) diff --git a/examples/docker/Dockerfile b/examples/docker/Dockerfile deleted file mode 100644 index c5e8c4e..0000000 --- a/examples/docker/Dockerfile +++ /dev/null @@ -1,7 +0,0 @@ -FROM python:3.12 - -RUN pip install ytnoti - -COPY . . - -CMD ["python", "main.py"] diff --git a/examples/docker/docker-compose.yml b/examples/docker/docker-compose.yml deleted file mode 100644 index 85b98ba..0000000 --- a/examples/docker/docker-compose.yml +++ /dev/null @@ -1,4 +0,0 @@ -services: - ytnoti: - build: . - container_name: ytnoti diff --git a/examples/docker/main.py b/examples/docker/main.py deleted file mode 100644 index 96f5421..0000000 --- a/examples/docker/main.py +++ /dev/null @@ -1,28 +0,0 @@ -""" -This is a basic script that will be run inside a docker container -""" - -import logging - -from ytnoti import YouTubeNotifier, Video - - -def main(): - """ - Main function - """ - - logging.basicConfig(level=logging.INFO, format="%(asctime)s - %(name)s - %(levelname)s - %(message)s") - - notifier = YouTubeNotifier() - - @notifier.upload() - async def listener(video: Video): - print(f"New video from {video.channel.name}: {video.title}") - - notifier.subscribe("UC9EEyg7QBL-stRX-7hTV3ng") # Channel ID of SpeedyStyle - notifier.run() - - -if __name__ == "__main__": - main() diff --git a/examples/history.py b/examples/history.py index d377e2e..4978636 100644 --- a/examples/history.py +++ b/examples/history.py @@ -8,6 +8,8 @@ from pathlib import Path +from pyngrok import ngrok + from ytnoti import YouTubeNotifier, Video from ytnoti.models.history import FileVideoHistory @@ -17,6 +19,8 @@ def main(): Main function """ + ngrok.set_auth_token("Your ngrok token here") + # This will create a new folder called "videoHistory" in the current directory video_history = FileVideoHistory(dir_path=Path("./videoHistory")) diff --git a/examples/logger.py b/examples/logger.py index 0b3278c..c18f8ec 100644 --- a/examples/logger.py +++ b/examples/logger.py @@ -5,6 +5,8 @@ import logging +from pyngrok import ngrok + from ytnoti import YouTubeNotifier, Video @@ -13,6 +15,8 @@ def main(): Main function """ + ngrok.set_auth_token("Your ngrok token here") + logger = logging.getLogger(__name__) notifier = YouTubeNotifier() diff --git a/examples/multithreading.py b/examples/multithreading.py index c272a75..30b8109 100644 --- a/examples/multithreading.py +++ b/examples/multithreading.py @@ -5,6 +5,8 @@ import time from threading import Thread +from pyngrok import ngrok + from ytnoti import YouTubeNotifier, Video @@ -13,6 +15,8 @@ def main(): Main function """ + ngrok.set_auth_token("Your ngrok token here") + notifier = YouTubeNotifier() @notifier.any()