Skip to content

A set of command line scripts to automate repetitive tasks when producing podcasts

License

Notifications You must be signed in to change notification settings

Thomasorus/botoz

Repository files navigation

🤖 BOTOZ 🤖

A bunch of command line scripts to automate repetitive tasks podcasters have to do.

The tasks

Botoz can execute 3 tasks:

  • Turn a youtube video to an mp3 file, create an xml file with the <item> part pre-filled, then update the main xml file.
  • Create an xml file with the <item> part prefilled with the metadata found inside an existing mp3 file, then update the main xml file.
  • Create an xml file with the <channel> part automatically written from the config file.

How to use

BOTOZ needs some configuration steps before being used. Once they are done, those configurations steps can be reused indefinitely.

The config.py file

This file contains the configuration for all your podcasts. You can have just one or 100. Inside of it, you will see this:

podcasts = {
    "default": {

Followed by a lot of text. This is the sample/example of a podcast. Copy paste everything starting from line 4 and paste it at the end before the final bracket. Rename the default you just pasted to the podcast you want to manage.

Then fill in everything:

  • general contains general informations and configurations you will need to do certain tasks.
  • mp3 contains configuration for the quality of encoding of your mp3 files
  • channel contains the podcast <channel> informations required to build an XML podcast file.
  • item contains the podcast <item> informations required to generate an entry.

Each line has an explanation about what it's used for. If a line does not have an explanation, it means you don't have to touch it and it will be filled by Botoz.

The command line

The tasks commands are:

  • yt-mp3 to turn a youtube video to an mp3
  • mp3-xml to create an xml from an mp3
  • conf-xml to create a channel xml file from the config file

Once the podcast configuration is done, use the command line this way:

  • ./botoz3000.sh your_command your_podcast file_or_url

For example, to download a youtube video and turn it into a podcast using the default config:

  • ./botoz3000.sh yt-mp3 default https://www.youtube.com/watch?v=yBLdQ1a4-JI

Requirements

You need to install some dependencies.

System (ise brew on mac or apt-get on linux):

  • yt-dlp
  • ffmpeg

Python deps (use pip3 install):

  • yt_dlp
  • requests
  • feedparser
  • paramiko

About the youtube_automate.py file

The youtube_automate.py is used to do the following tasks:

  • Check for a new entry inside a youtube playlist RSS Feed
  • If a new video exists, launch botoz to convert it to mp3 + xml
  • Open an FTP or SFTP connection and upload the new files to a distant server

Both the youtube playlist RSS feed and FTP connection settings can be filled inside the config.py file. Its initial use is automating a daily show made on youtube into a podcast version. This program will only treat the last video added, even if there are others not in the RSS feed, so it's NOT a way to convert an entire playlist into a podcast.

The automation is not for everyone and you should not use it if you have no experience using FTP, SFTP, CRON Tasks and overall linux servers.

About MP3 quality

VBR table

Use this table to choose the quality of your mp3 files.

More info

LAME Bitrate Overview
lame option Average kbit/s Bitrate range kbit/s ffmpeg option
-b 320 320 320 CBR (non VBR) example -b:a 320k (NB this is 32KB/s, or its max)
-V 0 245 220-260 -q:a 0 (NB this is VBR from 22 to 26 KB/s)
-V 1 225 190-250 -q:a 1
-V 2 190 170-210 -q:a 2
-V 3 175 150-195 -q:a 3
-V 4 165 140-185 -q:a 4
-V 5 130 120-150 -q:a 5
-V 6 115 100-130 -q:a 6
-V 7 100 80-120 -q:a 7
-V 8 85 70-105 -q:a 8
-V 9 65 45-85 -q:a 9

License

Botoz is a free to use by individuals and organizations that do not operate by capitalist principles. For more information see the license file.

About

A set of command line scripts to automate repetitive tasks when producing podcasts

Topics

Resources

License

Stars

Watchers

Forks