Skip to main content

A tool for adding YouTube video like/dislike counts to video descriptions.

Project description

YouTube Automation

Using YouTube's API, this repository will work toward automating tedious tasks for YouTube channels. The main objective is to update YouTube Descriptions with the number of likes, dislikes, likes/(likes+dislikes), timestamp up to the YouTube API limit. Check out my YouTube Like, Dislike Counter Playlist!

Requirements:

  • Python >= 3.7
pip install -r requirements.txt

Setup Requirements

  • Need YouTube account
  • Create .env file in root directory
# Contents of .env
CLIENT_SECRET_FILE=client_secret_web_app.json
CHANNEL_ID='YOUR_CHANNEL_ID'
  • Need to enable API (YouTube Data API V3)
  • You have the choice to choose which OAuth to use; In production, I used Web App
    • Need to create OAuth Client ID: > Web App > Name Web App App > Create > Download OAuth Client (JSON)
      • This will be your web app secret file. (Renamed downloaded OAuth Client to client_secret_web_app.json)
  • Setup up OAuth Consent Screen
    • Make sure to add your testing email as a test user to access your YouTube account (need to manually do this)
  • Ensure to verify your application! Run the following:
# creates a token.pickle file   
from ytad.authentication import Authenticate
auth = Authenticate()
youtube = auth.check_token_web_app_data_api()

Example: Command Line Interface (CLI) explained

python update_notifications.py --help
python .\update_notifications.py --update_df=Yes --verify_each_update=Yes

Cloud

I used AWS services to ensure a cron job (in production) is enacted. This is a low cost solution, utlizing lambda functions and minimial time on Ec2 instances.

  • The cloud setup and infrastructure can be found here

Goals of Library:

  • Scrape personal Likes/Dislikes from backend (YouTube Studio)
  • Automating the update(s) of descriptions in videos
  • Executable with parameters and pip installable
  • cron job
  • Minimization of YouTube Requests
  • Keygen for API calls
  • argparse: CLI enabled.
  • setup.py (on pypi) for installation

Remaining TODOs:

  • Verify setup with @SpencerPao
  • Overhaul CLI (maybe this should be another issue and version though)
  • Test API and authentication
  • Create PyPI and TestPyPI accounts
  • Build package wheel
  • Test package with twine
  • Upload package with twine
  • Try installing with pip

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ytad-0.0.3.tar.gz (23.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ytad-0.0.3-py3-none-any.whl (3.5 kB view details)

Uploaded Python 3

File details

Details for the file ytad-0.0.3.tar.gz.

File metadata

  • Download URL: ytad-0.0.3.tar.gz
  • Upload date:
  • Size: 23.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.0 CPython/3.8.12

File hashes

Hashes for ytad-0.0.3.tar.gz
Algorithm Hash digest
SHA256 30b81a322881e3506275755f0b649516162fc3db7a130757111fed30b71b3ab0
MD5 d9e0d3a0d14eccb2e8903366b0d2e62f
BLAKE2b-256 c87f6471603ded0d6cc3f3112dea8957aee47edf68fa872bc63f973958bfa5e7

See more details on using hashes here.

File details

Details for the file ytad-0.0.3-py3-none-any.whl.

File metadata

  • Download URL: ytad-0.0.3-py3-none-any.whl
  • Upload date:
  • Size: 3.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.0 CPython/3.8.12

File hashes

Hashes for ytad-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 6a7e6924c28a7630170f806167c8e2c3f7671fe449a7b53e3058f9182a99db1c
MD5 d41f3fdb67801ddc2ebf4723cc8be1f8
BLAKE2b-256 224fb0efda063e47d3c0a7d2a963fdfd7405c4ebfb3c8a6fc3ef020a235f0fa1

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page