This Python project allows users to automate subscribing to YouTube channels via the YouTube Data API v3. It reads a list of channels from a JSON file and automatically subscribes to them using a Google Colab environment.
- Authenticate with the YouTube API using OAuth 2.0.
- Read YouTube channel URLs from a subscriptions.json file.
- Automatically subscribe to the listed channels.
- Handles duplicate subscriptions and provides error handling.
Before running the script, ensure you have:
- Enable the YouTube Data API v3.
- Create OAuth 2.0 credentials and download the client_secret.json file.
- The code is designed to run in Google Colab.
- You can upload the necessary files directly into the notebook.
Required Files:
- client_secret.json: OAuth credentials from Google Cloud Console.
- subscriptions.json: A file that contains the YouTube channel URLs you want to subscribe to.
Example format:
{
"subscriptions": [
{"url": "https://www.youtube.com/channel/CHANNEL_ID_1"},
{"url": "https://www.youtube.com/channel/CHANNEL_ID_2"}
]
}
- Clone the Repository:
First, clone the repository to your local machine:git clone https://github.com/deepanshumidha5140/Newpipe-To-Youtube cd youtube-subscription-manager
- Google Cloud Setup:
Go to Google Cloud Console.
Enable YouTube Data API v3.
Create OAuth credentials and download the client_secret.json file. - Run the Script in Google Colab:
Open a Google Colab notebook.
Upload the client_secret.json and subscriptions.json files when prompted. - Execute the Code:
Run the provided code in Colab.
You will be asked to authenticate using Google OAuth.