"Simple Python script to get notified about the latest YouTube video from any specific channel that you prefer on Discord!"
-
Go to the Google Cloud Console.
-
Create a new project (or select an existing one).
-
Enable the YouTube Data API v3 for your project.
-
Create API credentials (API key).
-
Open your Discord server.
-
Go to Server Settings > Integrations > Webhooks.
-
Click "New Webhook" and customize it as you like.
-
Copy the Webhook URL.
-
Install Python: Make sure Python is installed on your system. You can download it from the official Python website.
-
Install Required Libraries: You'll need the 'requests' library to make HTTP requests. You can install it using pip:
pip install requests
-
Create the Python Script
-
Create a New File: Open your favorite text editor or an Integrated Development Environment (IDE) like VS Code, PyCharm, or any other.
-
Save the Script: Copy the provided script and save it as
yt-vid-notifier.py
-
Replace Placeholder Values
Open the
yt-vid-notifier.py
file and replaceYOUR_YOUTUBE_API_KEY
,TARGET_CHANNEL_ID
, andYOUR_DISCORD_WEBHOOK_URL
- The Program is meant to run every 15 minutes and check for a new video , inorder to do that run it on a cloud server
- You can use Google Console , AWS or Heroku e.t.c
- "Instead, you choose to run it locally, create a cron job so that it can automatically run at specified intervals of time."
crontab -e
0 */8 * * * /usr/bin/python /home/samsep10l/Desktop/yt-vid-notifier.py
- to list cron jobs
crontab -l