A tool for encoding and publishing podcast content and assets. Inspired by bv-publish and the talk Stuart Langridge gave at Oggcamp 2015.
Project created by Ubuntu Podcast and released under the GPLv2 license.
Eventually this will be added to PyPi (or something) for simplier installation. But for now the following steps are required, which requires you're running Ubuntu 16.04 or newer.
sudo apt-get install ffmpeg git libavcodec-extra python3-dev python3-pip
There is also a good quality statically compiled ffmpeg
available from John Van Sickle
sudo apt-get install liblcms2-dev libfreetype6-dev libjpeg8-dev \
libopenjp2-7-dev libtiff5-dev libwebp-dev zlib1g-dev
sudo apt install libffi-dev libssl-dev
git clone git@bitbucket.org:flexiondotorg/podpublish.git
sudo pip3 install -r podpublish/requirements.txt
These are the steps for installing on Ubuntu 16.04.
sudo apt-get install python-setuptools python-virtualenv python-pip virtualenvwrapper
sudo apt-get install libpython3.5 python3.5 python3.5-dev python3.5-minimal
mkdir ~/Snakepit
Using virtualenv
:
virtualenv -p /usr/bin/python3.5 ~/Snakepit/podpublish
source ~/Snakepit/podpublish/bin/activate
Or using mkvirtualenv
:
mkvirtualenv -p /usr/bin/python3.5 podpublish
workon podpublish
Or using virtualfish
:
vf new -p /usr/bin/python3.5 podpublish
workon podpublish
Install podpublish.
pip3 install -r podpublish/requirements.txt
This project is a work in progress and still somewhat hardcoded but will soon be made into a generic tool useful to other podcasters.
To encode an audio file to .mp3
, .ogg
and .mkv
(for uploading to
YouTube, do the following.
The skip
options, in the .ini
file, will bypass encoding if set to
True
.
- Edit the example
podcast.ini
. - Execute
./encode_podcast podcast.ini
.
The skip
options, in the .ini
file, will bypass publishing if set to
True
.
- Edit the example
podcast.ini
. - Execute
./publish_podcast podcast.ini
.
To encode a season of audio files, from existing .mp3
or .ogg
files
, encode them to .mkv
and upload them to YouTube, do the following.
- Edit the example
season-to-youtube.ini
. - Execute
./season-to-youtube season-to-youtube.ini
.
The season encoder/uploader expects derive the each Episode number from the source audio filename and each episode Title from tags embedded in the source audio files.
The reference YouTube API provided by Google doesn't support playlists, nor setting a publishing date, so youtube-upload is used instead.
To upload to YouTube you'll need a Google account with associated YouTube channel, the YouTube Data API will need to be enabled and OAuth 2.0 client-secret generated.
The Youtube API uses OAuth 2.0
to authenticate the upload. The first time you try to upload a video,
you will be asked to follow a URL in your browser to get an authentication
token. You can use multiple credentials, just use edit the option
credentials-file=
. Also, check the token expiration
policies.
If you plan to make a heavy use of the script, please create and use your own OAuth 2.0 file, it's a free service. Steps:
- Go to the Google console.
- Create project.
- Side menu: APIs & auth -> APIs
- Top menu: Enabled API(s): Enable all Youtube APIs.
- Side menu: APIs & auth -> Credentials.
- Create a Client ID: Add credentials -> OAuth 2.0 Client ID -> Other -> Name: youtube-upload -> Create -> OK
- Download JSON: Under the section "OAuth 2.0 client IDs". Save the file to your local system.
- Use this JSON as your credentials file:
client-secrets=CLIENT_SECRETS
The following video may also be helpful in enabling the YouTube Data API and creating client secrets.
This is how to create an account, on Ubuntu, that has sftp access via key based authentication.
Generate a ssh key pair. This will create ~/PodPublish.key
(the private key) and ~/PodPublish.pub
(the public key).
ssh-keygen -b 4096 -t rsa -N yoursupersecretpassphrase -C "Podcast Publisher" -f ~/PodPublish
sudo apt-get install ssh
sudo adduser --gecos "Podcast Publisher" --disabled-password yourusername
As root
do the following on the server to create the authorized_keys
file.
mkdir /home/yourusername/.ssh
Add the content of ~/PodPublish.pub
to /home/yourusername/.ssh/authorized_keys
nano /home/yourusername/.ssh/authorized_keys
Set the ~/.ssh
file/directory permissions.
chmod 600 /home/yourusername/.ssh/authorized_keys
chmod 700 /home/yourusername/.ssh/
chown -R yourusername: /home/yourusername/.ssh
Source code is available from BitBucket.
The Snap home
interface munges ${HOME}
and my use cae for podpublish is to
use configuration files that contain relative paths to podcast assets, such as
audio files and artwork.
The Ubuntu Podcast team use Dropbox to sync all the show assets, therefore the Dropbox directory needs to be symlinked into the podpublish snap data directory.
Run the following, which will create the data directory.
/snap/bin/podpublish.encode-podcast --version
Now symlink Dropbox.
ln -s ~/Dropbox ~/snap/podpublish/x{*}/
To encode a podcast.
/snap/bin/podpublish.encode_podcast ~/Dropbox/UbuntuPodcast/Configs/S09/s09exx.ini
To upload a podcast.
/snap/bin/podpublish.publish_podcast ~/Dropbox/UbuntuPodcast/Configs/S09/s09exx.ini