Skip to content

a python script that checks for new videos in a youtube playlist, then posts them to a discord webhook.

License

Notifications You must be signed in to change notification settings

12beesinatrenchcoat/yt-playlist-discord-webhook

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

yt-playlist-discord-webhook

GitHub last commit quality Maintenance

A Python script that when run, takes all the newest videos in a YouTube playlist, and POSTs it to a discord webhook. Or at least, it's supposed to.

A note: I wrote this to introduce myself to Python. The code is a mess, and whether it'll work is... iffy. Use at your own risk.
Additionally, I have no real intention of maintaining this. things may be broken down the line. Apologies.

Usage

Look over the YouTube Data API Overview in order to obtain your API key, alternatively the necessary steps have been copied below.

  1. Create a new project in the Google Developers Console and obtain authorization credentials so your application can submit API requests.
  2. After creating your project, make sure the YouTube Data API is one of the services that your application is registered to use:
    1. Go to the API Console and select the project that you just registered.
    2. Visit the Enabled APIs page. In the list of APIs, make sure the status is ON for the YouTube Data API v3.
  3. Edit the .env (or set up your environment variables):
ApiKey = # youtube api key...
PlaylistID = # the youtube playlist ID (the part after `playlist?list=`)
WebhookUrl = # the webhook url.
EmbedText = # the message you want to be sent with the embed. defaults to: `New video in playlist!` you can also say `videoURL` to send the video's URL.

Running

  1. Install all dependencies with pip install -r requirements.txt
  2. Run main.py.
    • Optionally, use --offset [seconds] to filter videos added [seconds] ago.

Consider running a cron job, using GitHub Actions, or just some looping script to run this at a regular interval.

License

The Unlicense. Do whatever you want with it.

About

a python script that checks for new videos in a youtube playlist, then posts them to a discord webhook.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages