This script will allow you to extract all youtube links send in a discord channel and gather then into a single .csv
file with some metadata like the title, publication date and start of the description.
- A discord account with access to the channel you want to extract the links from connected on the web app (not the desktop or mobile one)
- An API key for the YouTube Data API (v3 at this time)
- Run
npm install
at this project's root directory - Go on your browser, open Discord, open the DevTools (usually F12 works), open the Network tab
- Reload the discord page, open a request that has been made to any discord api endpoint and extract the value of the Authorization header
- Past it as the value for
DISCORD_TOKEN
ingetVideos.js
- Open the channel you want to target, check the call made to
https://discord.com/api/v9/channels/{DISCORD_CHANNEL_ID}/messages
- Copy the channel ID from this url into
DISCORD_CHANNEL_ID
ingetVideos.js
- Get your YouTube API key value and put it into
YOUTUBE_API_KEY
ingetVideos.js
- Run with
npm start
- Use the generated
videos.csv
file
For a channel with arround 1080 messages:
- Execution time: < 30 seconds
- Found: 808 videos
- Private/deleted: 63 videos
- CSV file size: 246ko