YouTube Channel Subscriber Tool
This page allows you to input a list of YouTube channel links and generates a script that you can run in your Chrome console to subscribe to those channels.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>YouTube Channel Subscriber Tool</title>
<style>
body {
font-family: Arial, sans-serif;
max-width: 800px;
margin: 0 auto;
padding: 20px;
line-height: 1.6;
}
h1 {
color: #c00;
}
textarea {
width: 100%;
height: 200px;
margin: 10px 0;
padding: 10px;
border: 1px solid #ccc;
border-radius: 4px;
font-family: monospace;
}
button {
background-color: #c00;
color: white;
border: none;
padding: 10px 15px;
border-radius: 4px;
cursor: pointer;
font-size: 16px;
}
button:hover {
background-color: #900;
}
#output {
background-color: #f5f5f5;
padding: 15px;
border-radius: 4px;
margin-top: 20px;
white-space: pre-wrap;
font-family: monospace;
display: none;
}
.instructions {
background-color: #fffde7;
padding: 15px;
border-left: 4px solid #ffd600;
margin: 20px 0;
}
.warning {
color: #c00;
font-weight: bold;
}
</style>
</head>
<body>
<h1>YouTube Channel Subscriber Tool</h1>
<div class="instructions">
<h3>Instructions:</h3>
<ol>
<li>Enter YouTube channel URLs (one per line) in the text area below</li>
<li>Click "Generate Script"</li>
<li>Copy the generated script</li>
<li>Navigate to <a href="https://www.youtube.com" target="_blank">YouTube.com</a></li>
<li>Open Chrome DevTools (F12 or Right-click > Inspect)</li>
<li>Paste the script in the Console tab and press Enter</li>
</ol>
<p class="warning">Note: This tool is for educational purposes. Use responsibly and in accordance with YouTube's Terms of Service.</p>
</div>
<h3>Enter YouTube Channel URLs (one per line):</h3>
<textarea id="channelUrls" placeholder="https://www.youtube.com/c/channelname
https://www.youtube.com/@username
https://www.youtube.com/channel/UCxxxxxxxxxxxxxxxx"></textarea>
<button onclick="generateScript()">Generate Script</button>
<div id="output"></div>
<script>
function generateScript() {
const channelUrls = document.getElementById('channelUrls').value.trim().split('\n').filter(url => url.trim() !== '');
if (channelUrls.length === 0) {
alert('Please enter at least one YouTube channel URL');
return;
}
const channelUrlsArray = JSON.stringify(channelUrls);
const script = `// YouTube Channel Subscriber Script
// Generated on ${new Date().toLocaleString()}
(async function() {
// List of channel URLs to subscribe to
const channelUrls = ${channelUrlsArray};
// Function to extract channel ID from URL
function extractChannelId(url) {
let match;
// Handle /channel/UC... format
match = url.match(/youtube\\.com\\/channel\\/([^/?&]+)/);
if (match) return match[1];
// For other formats, we'll need to fetch the page and extract the ID
return null;
}
// Function to check if already subscribed
function isSubscribed(channelId) {
return new Promise((resolve) => {
// We'll use a temporary iframe to check subscription status
const iframe = document.createElement('iframe');
iframe.style.display = 'none';
iframe.src = \`https://www.youtube.com/channel/\${channelId}\`;
iframe.onload = () => {
try {
const subscribeButton = iframe.contentDocument.querySelector('[aria-label^="Subscribe to"]');
const isAlreadySubscribed = !subscribeButton || subscribeButton.getAttribute('subscribed') === '' ||
subscribeButton.getAttribute('aria-label').includes('Unsubscribe');
resolve(isAlreadySubscribed);
} catch (e) {
// CORS error likely occurred
console.log('Could not check subscription status due to CORS, will attempt to subscribe anyway');
resolve(false);
} finally {
document.body.removeChild(iframe);
}
};
document.body.appendChild(iframe);
});
}
// Function to subscribe to a channel
async function subscribeToChannel(url) {
console.log(\`Processing: \${url}\`);
// Extract channel ID if possible
const channelId = extractChannelId(url);
// If we have a channel ID, check if already subscribed
if (channelId) {
try {
const alreadySubscribed = await isSubscribed(channelId);
if (alreadySubscribed) {
console.log(\`Already subscribed to \${url}\`);
return { url, status: 'already subscribed' };
}
} catch (e) {
console.log(\`Error checking subscription status: \${e.message}\`);
}
}
// Create a hidden iframe to navigate to the channel
return new Promise((resolve) => {
const iframe = document.createElement('iframe');
iframe.style.display = 'none';
iframe.src = url;
iframe.onload = () => {
try {
// Try to find and click the subscribe button
const subscribeButton = iframe.contentDocument.querySelector('[aria-label^="Subscribe to"]');
if (subscribeButton) {
// Check if already subscribed
const isAlreadySubscribed = subscribeButton.getAttribute('subscribed') === '' ||
subscribeButton.getAttribute('aria-label').includes('Unsubscribe');
if (isAlreadySubscribed) {
console.log(\`Already subscribed to \${url}\`);
resolve({ url, status: 'already subscribed' });
} else {
// Click to subscribe
subscribeButton.click();
console.log(\`Subscribed to \${url}\`);
resolve({ url, status: 'subscribed' });
}
} else {
console.log(\`Could not find subscribe button for \${url}\`);
resolve({ url, status: 'button not found' });
}
} catch (e) {
// Handle CORS issues
console.log(\`CORS issue with \${url}, opening in new tab\`);
// Alternative approach: open in a new tab
const newTab = window.open(url, '_blank');
// Provide instructions to the user
console.log('Please manually subscribe in the newly opened tab, then close it and continue');
// We can't programmatically interact with the new tab due to CORS
resolve({ url, status: 'manual intervention required' });
} finally {
document.body.removeChild(iframe);
}
};
document.body.appendChild(iframe);
});
}
// Process all channels with a delay between each
const results = [];
for (const url of channelUrls) {
try {
const result = await subscribeToChannel(url);
results.push(result);
// Add a delay to avoid triggering YouTube's rate limits
await new Promise(resolve => setTimeout(resolve, 2000));
} catch (error) {
console.error(\`Error processing \${url}: \${error.message}\`);
results.push({ url, status: 'error', message: error.message });
}
}
// Show summary
console.log('=== Subscription Summary ===');
console.table(results);
// Handle CORS alternative instructions
const manualChannels = results.filter(r => r.status === 'manual intervention required');
if (manualChannels.length > 0) {
console.log('\\n=== Channels requiring manual subscription ===');
manualChannels.forEach((channel, i) => {
console.log(\`\${i+1}. \${channel.url}\`);
});
console.log('\\nPlease subscribe to these channels manually due to browser security restrictions.');
}
})();`;
const outputDiv = document.getElementById('output');
outputDiv.textContent = script;
outputDiv.style.display = 'block';
}
</script>
</body>
</html>
How to Use This Tool
- Copy the HTML code above and save it as an HTML file on your computer.
- Open the file in your web browser.
- Enter the YouTube channel URLs you want to subscribe to, one per line.
- Click "Generate Script" to create the JavaScript code.
- Copy the generated script.
- Navigate to YouTube.com in Chrome.
- Open the Chrome DevTools console (F12 or right-click > Inspect > Console).
- Paste the script and press Enter to run it.
Important Notes
- The script handles CORS issues by attempting to use iframes first, and if that fails, it opens channels in new tabs with instructions for manual subscription.
- It checks if you're already subscribed to avoid duplicate subscriptions.
- There's a 2-second delay between subscription attempts to avoid triggering YouTube's rate limits.
- The script provides a summary table of results in the console when finished.
- This tool is for educational purposes only. Use responsibly and in accordance with YouTube's Terms of Service.