https://github.com/ray-1337/youtube-discord-embed
Embed YouTube video on Discord, inspired by FixTweet.
https://github.com/ray-1337/youtube-discord-embed
discord embed fixtweet next oembed opengraph twitter youtube
Last synced: 2 months ago
JSON representation
Embed YouTube video on Discord, inspired by FixTweet.
- Host: GitHub
- URL: https://github.com/ray-1337/youtube-discord-embed
- Owner: ray-1337
- License: mit
- Created: 2023-10-14T17:44:12.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-04-01T00:33:54.000Z (3 months ago)
- Last Synced: 2025-04-01T01:30:15.176Z (3 months ago)
- Topics: discord, embed, fixtweet, next, oembed, opengraph, twitter, youtube
- Language: TypeScript
- Homepage: https://yt.cdn.13373333.one/watch?v=dOZBUnaBN6A
- Size: 313 KB
- Stars: 30
- Watchers: 1
- Forks: 4
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# YouTube Discord Embed
Embed YouTube video on Discord by pulling off YouTube video, and make it playable through embeds with OpenGraph/Twitter meta tags.This project is highly inspired by [FixTweet](https://fixupx.com), and powered with [Next.js](https://nextjs.org)/[Vercel](https://vercel.app).

# Setup
- Run `pnpm install` to install the dependencies.
- Edit `.env.example` to `.env`
- Edit `COOKIE_BYPASS` value by:
- following the [instructions here](https://github.com/distubejs/ytdl-core?tab=readme-ov-file#how-to-get-cookies),
- [stringify the JSON value](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify),
- and, paste the value.
- Then, use:
- `pnpm dev` for development.
- `pnpm build` and then `pnpm start` for production-ready.# Error Handling
In a week or two, YouTube starts to show an error such as '`Sign in to confirm you’re not a bot`'.You can handle this by:
- Open your browser (a browser where you previously export those cookies above), login to your YouTube account, and starts by doing something such as watching a YouTube video.
- Or, reset the `COOKIE_BYPASS` key value by redoing the **Setup** above.# Self-host
You can fork the repository, host it somewhere else, and change the domain.# Cloud-hosted domain
I also hosted the project for free on the cloud. You can use it by replacing `youtube.com/watch` or `youtu.be` with my domain.- **`youtube.com/watch`**, normal route:
- https://yt.cdn.13373333.one/watch?v=dQw4w9WgXcQ
- https://yourdomain.com/watch?v=dQw4w9WgXcQ
- **`youtu.be`**, YouTube URL shortener route:
- https://yt.cdn.13373333.one/dQw4w9WgXcQ
- https://yourdomain.com/dQw4w9WgXcQ
- **`youtube.com/shorts`**, shorts route:
- https://yt.cdn.13373333.one/shorts/b1hnji5jPRE
- https://yourdomain.com/shorts/b1hnji5jPRE## License
[MIT](LICENSE)