youtube-to-w2g

YouTube to Watch2Gether (Y2W)

Y2W Logo **Send YouTube videos to your Watch2Gether room with a single click!** _Because copy-pasting URLs is so 2020_ ๐Ÿ˜Ž [![Chrome Web Store](https://img.shields.io/badge/Chrome%20Web%20Store-Available-green?style=flat-square&logo=google-chrome)](https://chromewebstore.google.com/detail/y2w-youtube-to-watch2geth/afgajabndpahomibkdlpgejbfmlfckig) [![License](https://img.shields.io/badge/license-MIT-blue.svg?style=flat-square)](LICENSE) [![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square)](CONTRIBUTING.md) [![JavaScript](https://img.shields.io/badge/JavaScript-ES6+-yellow?style=flat-square&logo=javascript)](https://developer.mozilla.org/en-US/docs/Web/JavaScript) [![Manifest](https://img.shields.io/badge/Manifest-V3-green?style=flat-square)](https://developer.chrome.com/docs/extensions/mv3/)
Y2W Promotional Banner
Install from Chrome Web Store

๐Ÿ“– Why This Exists

You know that moment when youโ€™re watching YouTube and find the perfect video to share with your friends on Watch2Gether? Yeah, me too. The whole copy URL โ†’ switch tabs โ†’ paste โ†’ hope it works thing got old real fast.

So I built Y2W โ€“ a simple Chrome extension that adds a โ€œY2Wโ€ button right in the YouTube player. One click and boom, your video is in the W2G room. No more tab juggling!

๐Ÿ“‹ What is Y2W?

YouTube to Watch2Gether (Y2W) is a Chrome extension that seamlessly integrates with YouTube. Itโ€™s literally just a button that does one thing really well: sends videos to your Watch2Gether room instantly.

โœจ Features

๐Ÿš€ Installation

๐ŸŽ‰ Y2W is now available on the Chrome Web Store!

  1. Install Y2W from Chrome Web Store
  2. Click โ€œAdd to Chromeโ€
  3. The extension will be installed automatically
  4. Follow the configuration steps below

Manual Installation (Developer Mode)

  1. Download the Extension
    git clone https://github.com/fedevgonzalez/youtube-to-w2g.git
    cd youtube-to-w2g
    
  2. Load in Chrome
    • Open Chrome and navigate to chrome://extensions/
    • Enable Developer mode (toggle in top right)
    • Click Load unpacked
    • Select the youtube-to-w2g folder
  3. Configure Your Credentials
    • Click the Y2W extension icon in your toolbar
    • Enter your Watch2Gether API key and Room Access Key
    • Click Save Configuration

๐Ÿ”‘ Getting Watch2Gether Credentials

API Key

  1. Visit Watch2Gether API
  2. Log in to your W2G account
  3. Navigate to the API section
  4. Generate or copy your API key

Room Access Key

  1. Create or join a W2G room
  2. Open the room settings
  3. Look for โ€œRoom Access Keyโ€ or โ€œRoom API Accessโ€
  4. Copy the key

Pro tip: Keep these keys safer than your Netflix password. Seriously, donโ€™t share them!

๐Ÿ’ป Usage

Once installed and configured:

  1. Navigate to any YouTube video
  2. Look for the โ€œY2Wโ€ button in the video player controls
  3. Click the button to instantly send the video to your Watch2Gether room
  4. The button will show a checkmark (โœ“) when successful

Button States (aka The Buttonโ€™s Mood Ring)

๐Ÿ› ๏ธ Development

Prerequisites

Project Structure

youtube-to-w2g/
โ”œโ”€โ”€ manifest.json         # Extension manifest (V3)
โ”œโ”€โ”€ popup.html            # Configuration popup
โ”œโ”€โ”€ css/                  # Styles
โ”‚   โ””โ”€โ”€ popup.css
โ”œโ”€โ”€ js/                   # JavaScript files
โ”‚   โ”œโ”€โ”€ background.js     # Service worker
โ”‚   โ”œโ”€โ”€ content.js        # Content script
โ”‚   โ””โ”€โ”€ popup.js          # Popup logic
โ””โ”€โ”€ assets/               # Resource files
    โ”œโ”€โ”€ icons/            # Extension icons
    โ”‚   โ””โ”€โ”€ y2w.svg       # Source icon
    โ””โ”€โ”€ images/           # Promotional images

Making Changes

  1. Edit the relevant files
  2. Reload the extension in chrome://extensions/
  3. Refresh YouTube to test changes

๐Ÿ”ง Troubleshooting

Common Issues (aka โ€œHalp, itโ€™s broken!โ€)

โ€œWhereโ€™s my button?!โ€

โ€œConfiguration Missingโ€ (aka you forgot to set it up):

โ€œFailed to sendโ€ (the dreaded red button):

โ€œIt worked yesterday!โ€ syndrome:

๐Ÿ—บ๏ธ Roadmap

๐Ÿ”Œ API Reference

The extension uses the Watch2Gether API v1:

Endpoint: POST https://api.w2g.tv/rooms/{roomKey}/playlists/current/playlist_items/sync_update

Headers:

{
  "Accept": "application/json",
  "Content-Type": "application/json",
  "Authorization": "Bearer {apiKey}"
}

Request Body:

{
  "w2g_api_key": "{apiKey}",
  "add_items": [{
    "url": "https://www.youtube.com/watch?v={videoId}",
    "title": "{videoTitle}"
  }]
}

๐Ÿค Contributing

Found a bug? Have an idea? Want to make the button do a backflip? Iโ€™d love your help! Check out the Contributing Guidelines to get started.

Seriously though, this project is better with your input. Donโ€™t be shy!

Quick Start

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

๐Ÿ› Found a Bug? Got an Idea?

First, check if someone beat you to it in the issue tracker. If not, create a new issue and letโ€™s make Y2W better together!

I actually read these, promise. ๐Ÿ‘€

๐Ÿ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

๐Ÿ™ Shoutouts

๐Ÿ’ฌ Need Help?

๐Ÿ’– Support

If Y2W saved you some time and you want to say thanks:


Made with โค๏ธ (and lots of YouTube videos) by fedevgonzalez
If you're reading this, you're awesome! ๐ŸŽ‰