Introduction
Welcome to the future of digital content creation, where automating YouTube videos upload transforms the way you manage your channel.
Imagine having the power to schedule and upload multiple shorts effortlessly, all while sipping your morning coffee. This automation not only saves time but also significantly boosts your reach, ensuring that your content is consistently seen by your audience.
What Real-World Problem Does This Script Solve?
In the fast-paced digital world, consistency is key. Content creators often struggle to maintain a steady flow of uploads, especially when juggling multiple platforms. This YouTube Shorts auto-upload bot addresses that challenge by automating YouTube videos uploading process.
The Pain of Manual Uploading
I personally faced the frustration of having to upload around 50 to 100 YouTube Shorts manually to one of my channel. If you’re a YouTuber, you know how painfully repetitive and boring it can be to do this one by one. That’s when I asked myself: Is there a smarter way to handle this?
Fortunately, I already had a CSV file automatically generated with all the necessary metadata — including titles, descriptions, hashtags, and more. This gave me a solid foundation to automate the process.
How AI and Prompt Engineering Helped Me to create automating youtube video script
Instead of wasting hours on manual uploads, I turned to AI for help. This is exactly where prompt engineering came into play. I used AI to help me design and build a script that could read the metadata from the CSV file and handle the entire upload process.
With the help of AI, I was able to build this project within just a couple of hours. The result? A fully functional automation tool that saved me an incredible amount of time.
In this tutorial, I’ll show you exactly how I built it — and give you access to the tool. Whether you’re a solo creator or managing multiple channels, this solution can save you countless hours and eliminate the hassle of manual uploads.
How This Script Works
Automating youtube videos uploads is simpler than you might think. Here’s a breakdown of how the script functions and how you can configure it to suit your workflow.

Step 1: Prepare Your Files
Start by uploading all your video files into the videos/
folder. Each video file name must exactly match the corresponding entry in your CSV file (excluding the file extension). This CSV should contain metadata like titles, descriptions, tags, and other required fields.
⚠️ Important: If you rename columns in the CSV, you’ll need to update the script to reflect those changes.
Step 2: Understand the Upload Limit
Due to YouTube API restrictions, the script can upload a maximum of 100 videos per day. If you have more than that, you’ll need to run the script after 24 hours.
Step 3: Configure the Settings
Before running the script, you can customize a few settings in the script file (app.py
) to fit your needs:
# Constants CLIENT_SECRETS_FILE = "yt_upload.json" TOKEN_FILE = "token.json" YOUTUBE_UPLOAD_SCOPE = ["https://www.googleapis.com/auth/youtube.upload"] YOUTUBE_API_SERVICE_NAME = "youtube" YOUTUBE_API_VERSION = "v3" VIDEO_CATEGORY = "15" # Change this as needed PRIVACY_STATUS = "private" # Videos will be scheduled as private VIDEO_DIRECTORY = "videos" CSV_FILE = "video_metadata.csv" SET_SIZE = 5 # Number of videos to upload per batch START_DATE = "2025-04-26" # Change this to your desired start date (YYYY-MM-DD) # Schedule timings in UTC (23:00 UTC to 03:30 UTC in 30-minute intervals) SCHEDULE_TIMINGS = [ (23, 0), # 1st video at 23:00 UTC (23, 30), # 2nd video at 23:30 UTC (0, 0), # 3rd video at 00:00 UTC (0, 30), # 4th video at 00:30 UTC (1, 0), # 5th video at 01:00 UTC (1, 30), # 6th video at 01:30 UTC (2, 0), # 7th video at 02:00 UTC (2, 30), # 8th video at 02:30 UTC (3, 0), # 9th video at 03:00 UTC (3, 30), # 10th video at 03:30 UTC ]
Step 4: Run the Script
Once everything is in place:
- Open your terminal or command prompt.
- Run the script using:
python app.py
- The script will prompt you to authorize access to your YouTube channel. After completing the authentication, a token file will be created inside your project directory for future access.
Step 5: Sit Back and Relax
Once the script is running, there’s nothing more for you to do. Personally, I like to scroll through Facebook while the bot takes care of everything.
Within just a few minutes, all your videos will be uploaded, scheduled, and ready to go — without you lifting a finger.
Step-by-Step Guide to Set Up the YouTube Shorts Auto-Upload Bot.
Setting up this project is straightforward. Follow the steps below to get everything working smoothly. First thing you have to do is download the project files from the given link below.
Step 1: Create a Virtual Environment
Before installing any packages, it’s good practice to isolate your project using a virtual environment.
python -m venv venv source venv/bin/activate # On Windows, use: venv\Scripts\activate
Step 2: Install Python and Required Libraries
Make sure Python is installed on your machine. And I am using VS Code on my machine. Then, install the required dependencies:
pip install google-auth google-auth-oauthlib google-auth-httplib2 google-api-python-client
These libraries allow the script to interact securely with the YouTube Data API.
Step 3: Create a Google Cloud Project and Get API Credentials
- Go to the Google Cloud Console.
- Create a new project.
- Navigate to APIs & Services > Library, and enable the YouTube Data API v3.
- Go to APIs & Services > Credentials, then click Create Credentials > OAuth client ID.
- Choose Desktop App as the application type.
- Download the credentials JSON file and rename it to
yt_upload.json
.
You’ll get a file that looks like this:
{ "installed": { "client_id": "your_client_id", "project_id": "your_project_id", "auth_uri": "https://accounts.google.com/o/oauth2/auth", "token_uri": "https://oauth2.googleapis.com/token", "auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs", "client_secret": "your_client_secret", "redirect_uris": ["http://localhost"] } }
Place this file in your project folder.
Step 4: Organize Your Video Files and Metadata
- Create a folder named
videos/
. - Place all your video files inside this folder.
- Make sure each video file name matches its entry in
video_metadata.csv
.
🔁 For example, if your video file is
funny_cat.mp4
, there should be a row invideo_metadata.csv
referencingfunny_cat.mp4
(with file extention) in thefile_name
column.
Step 5: Run the Script and Authenticate
Run the script using the command:
python app.py
On the first run, a browser window will open asking you to authenticate your Google account. Grant access, and the script will store your token locally for future runs.
You’re now all set! The script will take care of uploading your videos with the right metadata, schedule, and settings— freeing up your time to focus on content creation.
Detailed Explanation of the Script Structure and How to Create It
The script revolves around a few pivotal components:
Step 1: Authentication with YouTube API
Utilising OAuth 2.0, the script authenticates with YouTube, enabling uploads on your behalf. This authentication is crucial as it ensures secure access to your account. If credentials are expired or absent, the script prompts a browser login, ensuring seamless connectivity.
def get_authenticated_service(): creds = None if os.path.exists(TOKEN_FILE): creds = Credentials.from_authorized_user_file(TOKEN_FILE, YOUTUBE_UPLOAD_SCOPE) if not creds or not creds.valid: if creds and creds.expired and creds.refresh_token: creds.refresh(Request()) else: flow = InstalledAppFlow.from_client_secrets_file(CLIENT_SECRETS_FILE, YOUTUBE_UPLOAD_SCOPE) creds = flow.run_local_server(port=0) with open(TOKEN_FILE, "w") as token: token.write(creds.to_json()) return build(YOUTUBE_API_SERVICE_NAME, YOUTUBE_API_VERSION, credentials=creds)
Step 2: Scheduling Video Uploads
The script reads from a CSV file containing metadata, such as file names, titles, descriptions, and tags. It schedules uploads at precise times, ensuring your content is released when your audience is most active.
def main(): youtube = get_authenticated_service() # Read video metadata with open(CSV_FILE, mode="r", encoding="utf-8") as csvfile: reader = csv.DictReader(csvfile) videos = list(reader) start_date = datetime.datetime.strptime(START_DATE, "%Y-%m-%d") for i in range(0, len(videos), SET_SIZE): publish_date = start_date + datetime.timedelta(days=i // SET_SIZE) batch = videos[i:i + SET_SIZE] for idx, row in enumerate(batch): file_name = row["File_name"].strip() title = row["title"].strip() description = row["description"].strip() tags = [tag.strip() for tag in row["tags"].split(",")] file_path = os.path.join(VIDEO_DIRECTORY, file_name) # Schedule upload schedule_time = SCHEDULE_TIMINGS[idx] publish_time = publish_date.replace(hour=schedule_time[0], minute=schedule_time[1], second=0) if os.path.exists(file_path): schedule_upload(youtube, file_path, title, description, tags, publish_time)
Step 3: Uploading Videos
The schedule_upload
function manages the upload, using resumable_upload
to handle interruptions, ensuring reliability.
def schedule_upload(youtube, file_path, title, description, tags, publish_time): body = { "snippet": { "title": title, "description": description, "tags": tags, "categoryId": VIDEO_CATEGORY, "defaultLanguage": "en", }, "status": { "privacyStatus": PRIVACY_STATUS, "publishAt": publish_time.isoformat() + "Z", }, } media = MediaFileUpload(file_path, chunksize=-1, resumable=True) request = youtube.videos().insert(part="snippet,status", body=body, media_body=media) resumable_upload(request)
Step 4: Error Handling
Robust error handling ensures retries in case of network issues, enhancing the script’s reliability.
def resumable_upload(request): response = None error = None retry = 0 while response is None: try: print("Uploading file...") status, response = request.next_chunk() if response: print(f"✅ Video uploaded successfully! Video ID: {response['id']}") except HttpError as e: if e.resp.status in [500, 502, 503, 504]: error = f"A retriable HTTP error {e.resp.status} occurred: {e.content}" else: raise except Exception as e: error = f"A retriable error occurred: {e}" if error: print(error) retry += 1 if retry > 10: print("❌ Max retries reached. Upload failed.") return sleep_time = random.uniform(1, min(60, 2**retry)) print(f"🔄 Retrying in {sleep_time:.2f} seconds...") time.sleep(sleep_time)
Implementing This to Online Income
Automating YouTube videos upload can directly impact your revenue generation strategies. By ensuring consistent content delivery, you keep your audience engaged, which is crucial for maintaining viewer retention and attracting new subscribers.
More uploads can lead to more views, increasing ad revenue and enhancing sponsorship opportunities. Integrating this automation. Also, HubSpot can help streamline your marketing efforts, ensuring that your content reaches your target audience effectively.
Troubleshooting Tips
- Authentication Issues: If you encounter authentication problems, ensure your
client_secret.json
is correctly configured and re-run the authentication step. - Upload Failures: Check if the file paths are correct and the API credentials are valid. Ensure your internet connection is stable to avoid interruptions.
- Scheduling Conflicts: Double-check your CSV file for correct scheduling times and formats.
Benefits of Automating Uploads Over Manual Uploads
- Time Efficiency: Automating uploads frees up valuable time to focus on content creation and strategy.
- Consistency: Ensures a regular upload schedule, which is crucial for audience retention.
- Scalability: Easily manage multiple uploads across different channels without manual effort.
💬 Real Talk: A Friendly Push to Start Building Your Freedom
Let me leave you with something a bit more personal — something that comes from experience, not just code.
I know how easy it is to get stuck in the 8-to-5 cycle, chasing weekends, living for a paycheck. But listen — you don’t have to stay there. We’re living in the AI era, and the rules have changed. You now have tools that previous generations could only dream of. But tools alone aren’t enough.
You’ve got to experiment, You’ve got to build, You’ve got to learn something every day. Not because someone tells you to — but because that’s how you build real freedom.
This project you just saw? I built it because I hated the idea of uploading 50–100 YouTube Shorts manually. It was boring, repetitive work. And I thought: “There has to be a better way.” That’s when I let AI and automation step in. It saved me hours — and now I’m giving it to you, so you can save your time too.
But here’s the real takeaway:
👉 Use your knowledge to solve problems.
👉 Create things that matter.
👉 Give value through your content.
Don’t wait for someone to give you permission to start. Start now. Mess up. Learn. Grow. And slowly — or sometimes suddenly — you’ll build the life you’ve always wanted.
So don’t just read this and move on.
Take action. Try things. Share what you learn.
That’s how we all move forward — one line of code, one solved problem, one shared idea at a time.
Conclusion
Automating your YouTube video uploads not only saves time but also enhances your channel’s efficiency and potential for growth. By following the steps outlined above, you can maintain a consistent upload schedule, keeping your audience engaged and your content fresh. Embrace this automation, and watch as your productivity and channel performance skyrocket.
FAQs
How does automating YouTube videos uploads help with channel growth?
Automation ensures consistent content release, which keeps your audience engaged and can attract new viewers, ultimately aiding in channel growth.
Is it safe to use the YouTube API for video uploads?
Yes, the YouTube API is a secure and recommended method for managing content uploads, provided you adhere to Google’s usage policies.
Can I automate video uploads for multiple YouTube channels?
Yes, by creating separate API credentials for each channel, you can automate uploads across multiple accounts.