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.
snap install podpublish
snap connect podpublish:gpg-keys
snap connect podpublish:hardware-observe
snap connect podpublish:removable-media
snap connect podpublish:ssh-keys
The snap home
interface munges ${HOME}
and my use case 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 Syncthing to sync all the show assets, therefore the Syncthing directory needs to be symlinked into the podpublish snap data directory.
Run the following, which will create the data directory.
podpublish.encode-podcast --version
Now symlink the Syncthing folder containing all the assets and configuration.
mkdir -p ~/snap/podpublish/current/Syncthing
ln -s ~/Syncthing/UbuntuPodcast ~/snap/podpublish/current/Syncthing/UbuntuPodcast
To encode a podcast.
podpublish.encode-podcast ~/Syncthing/UbuntuPodcast/Configs/S11/s11exx.ini
To upload a podcast.
podpublish.publish-podcast ~/Syncthing/UbuntuPodcast/Configs/S11/s11exx.ini
- Sanity check the number of tags before attempting a POST. 19 tags or fewer.
- Add support for Mastodon links.
- Add support for chapter markers.
Here are the legacy install instructions which assume 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
You can install podpublish system-wide or in a virtualenv
.
git clone [email protected]: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 Credentials page.
- Create project.
- Project name:
YouTube Uploader
- Click Create
- Project name:
- Click Dashboard in the side panel under API Manager.
- Click + ENABLE API
- Click the YouTube Data API v3
- Click > ENABLE at the top of the screen.
- Click the Credentials in the side panel under API Manager.
- Click OAuth consent screen from the top menu.
- Email address:
[email protected]
- Product name shown to users:
Yourname YouTube Uploader
- Homepage URL:
http://example.org
(optional) - Product logo URL:
http://example.org/favicon_128.png
(optional) - Privacy policy URL: blank
- Privacy policy URL: blank
- Click Save.
- Email address:
- Click OAuth consent screen from the top menu.
- Click the Credentials in the side panel under API Manager.
- Click the Create credentials pull down.
- Select OAuth client ID.
- Application type:
Other
- Name:
youtube-upload
- Click Create.
- The client ID and client secret will be displayed. No need to save them. Click OK.
- To the right of the client ID you just created click the download icon. Save the file to your local system.
- Use this JSON as your client secrets file:
client-secrets=CLIENT_SECRETS
- Application type:
- Create project.
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