• Stars
    star
    101
  • Rank 338,166 (Top 7 %)
  • Language
    Python
  • License
    MIT License
  • Created over 2 years ago
  • Updated almost 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

MARCELO: an AI powered bot to automate the editing and thumbnail creation for your Youtube clips channel

MARCELO: an AI bot to automate the editing and thumbnail creation for your Youtube clips channel

This project uses machine learning (AI) to automate the management of your Youtube clips channel by clipping, editing, creating of thumbnails and uploading to your YT channel

Requirements

  • Python 3
  • Youtube uploader
  • OpenCV
  • ffmpeg
  • Youtube API v3
  • ~50GB of free storage (depending of the size of the videos and cuts)

Setup

  1. Download the latest version of youtubeuploader and extract the executable go file in the project's ./ folder
  2. Configure Youtube API v3 accordingly Youtube Uploader instructions and save client_secrets.json in the repo root.
  3. Install python requirements
$ pip install -r requirements.txt
  1. Populate the folder ./backgrounds with images .png to be randomly selected to your thumbnail
  2. Leave a default_face.png on ./assets folder just in case the bot is not able to find a smiling face on your video. It will be used as a default face.
  3. Update description and metadata on marcelo.py:upload_video to fit your channel info
  4. [Optional] Leave a opening.mp4 and ending.mp4 videos (MP4 encoded, 1920x1080) on assets/ dir to automatically insert an intro and ending sessions on your edited video

Usage

  1. Prepare a spreadsheet with the following fields (example ./list-sample.csv):
url time_from time_to podcast title description tags
https://www.youtube.com/watch?v=[VIDEO_ID] 00:00:14 00:01:46 0 TITLE DESCRIPTION tag1 tag2 tag3 tag4
https://www.youtube.com/watch?v=[VIDEO_ID2] 0 TITLE DESCRIPTION tag1 tag2 tag3 tag4
  • URL: Youtube url
  • time_from: Clip start time (leave it blank for the entire video)
  • time_to: Clip end time (leave it blank for the entire video)
  • podcast: it will extract the edited audio for a podcast (NOT IMPLEMENTED YET - leave it 0)
  • title: Video clip title (don't use comma)
  • description: Video clip description (don't use comma)
  • tags: Video tags splitted by spaces (don't use comma)
  1. Save the spreadsheet as a csv and place the lists/list.csv file in the project folder

  2. Run marcelo.py

$ python marcelo.py
  1. [On first run only] it will open a page asking for authorization on Youtube

Docker

It is recommended to run youtubeuploader mannually and upload at least one video, to generate and store the authorisation file before building the container.

$ docker build -t marcelo .
$ docker run [-it] marcelo

Docker will copy all files to docker root, patch pytube bug and execute from there

  • Remember to have your lists/list.csv (clips and cuts list) and client_secrets.json (Youtube API v3 access) ready in the repo root

You can run Marcelo without building the entire image after updating lists/list.csv:

$ docker run [-it] -v "$(pwd)/lists:/app/lists" marcelo

PS: running from a container is slower than running on your physical machine. Video editing and machine learning does not perform well inside virtual environments.

How it works

This project execute is executed in 4 phases:

  1. Download and cut: Download and cut the video if needed
  2. Editing: A bot will scan the entire video to find audio silences, to cut and edit the video automatically
  3. Thumbnail: A bot will use machine learning through Computer Vision to find smiling faces in the video, to extract samples and build an unique thumbnail for your channel
  4. Upload: Prepare the metadata and Upload the video to your Youtube channel
  5. Marcelo: is a tribute to Marcelo Rezende, a Brazilian journalist and television presenter who used to say 'Corta pra mim'

DEMO

This bot is live, producing the clips channel of the Morning Crypto show.

References

Decentralised repo

This project can be found on Radicle

Known issues

  • Issue on cypher.py
    • Youtube changed some internal APIs, not fixed on pytube yet. Solution found on: https://stackoverflow.com/a/71922554
      • Line 264:
      r'a\.[a-zA-Z]\s*&&\s*\([a-z]\s*=\s*a\.get\("n"\)\)\s*&&\s*'
      r'\([a-z]\s*=\s*([a-zA-Z0-9$]{2,3})(\[\d+\])?\([a-z]\)'
      
      • Line 288: nfunc=re.escape(function_match.group(1))),

TO-DO

  • Automate the podcast creation
  • Use ffmpeg GPU
  • Select backgrounds based on title and description
  • Indexing captions for searching specific spoken phrase on the video
  • Automate the creation of the keywords (by using Watson or another NLP)

Buy me a coffee

Did you like it? Buy me a coffee

Buy me a coffee

Or drop me a tip through Lightning Network: âš¡ zbd.gg/eddieoz

More Repositories

1

haal

Hääl - Anonymous Electronic Voting System on Public Blockchains
JavaScript
100
star
2

openxrypt

OpenXrypt: Secure and Private Direct Messaging for Social Media
JavaScript
35
star
3

reels-clips-automator

Reelsfy is an advanced, AI-powered tool that automates the process of creating Instagram Reels from longer videos.
Python
32
star
4

OBS-live-translation

A bot to add a live translation into your live stream in OBS
HTML
29
star
5

bip39-bruteforce

Python
18
star
6

truffle-mercado-pokemon

Exemplo didático de smart-contracts Ethereum utilizando truffle.
JavaScript
17
star
7

nostr-stealth

Built on top of the Nostr protocol, specifically designed to ensure sender and receiver metadata full anonymity. Leveraging the concept of channels (or mixers), Nostr-Stealth ensures that individual messages between users cannot be distinguished or differentiated, thus enhancing user privacy.
JavaScript
8
star
8

twitter-sentiment-analysis

Twitter Sentiment Analysis in pt-BR
PHP
7
star
9

RSA-primes-resolution

Recover a Private Key from a given Public Key using the Right Triangle-based Constant time mathematical solution method.
Python
6
star
10

lmstudio-webpage-summarizer

JavaScript
5
star
11

workshop-1hackathon-BC-2016

Material didático para o Workshop no 1 Hackathon BC - 7-Set-2016
JavaScript
5
star
12

549-personal-dx-blog

A decentralised, unstoppable, privacy-by-design and censor-proof blog.
JavaScript
3
star
13

uEscrow

This is a prototype for an anon and trusty escrow service for trading digital assets, powered by smart-contracts.
HTML
2
star
14

liblinear-php

Liblinear-PHP is a PHP module to interface predicts over PHP. It try to solve predicting over big data, using cloud and Internet.
C++
2
star
15

youtube-transcripts

Download all transcripts from a Youtube channel, prepare a sqlite db to be used on a searxng customized engine (search.eddieoz.com)
Python
2
star
16

bloco

Conteúdo open-source do BLOCO
1
star
17

nostr-blokitos-sats

JavaScript
1
star
18

workshop-rootstock-labitconf2016

Workshop: A DEX and an NFT Marketplace for Pokemon trading - presented on LaBitConf 2016 - Buenos Aires
JavaScript
1
star
19

ethereum-whisper-messenger

Ethereum Whisper Messenger PoC
JavaScript
1
star
20

PhD-HCI-Proposal

PhD proposal for Cultural Influence on Building Trust in Human-Computer Interactions research approved in Tallinn University
1
star