allows synching podcast episodes to creative tonies
Project description
tonie-podcast-sync
tonie-podcast-sync allows synching podcast episodes to creative tonies.
This is a purely private project and has no association with Boxine GmbH.
Constraints and Limitations
- currently limited to podcasts providing mp3 files
- tested with the following podcasts:
- ... but in general, it should hopefully work with all podcasts out there
Prerequisites
- requires Python >= 3.10.11
- if you use the
volume_adjustment
feature for a Podcast,ffmpeg
needs to be installed
Usage
tonie-podcast-sync is available as a pip package on pypi. Install via
pip install tonie-podcast-sync
You then have two options of using this: via its CLI or as a python library.
via CLI
The most convienent way is to just use the CLI:
A first step is to configure tonie-podcast-sync
tonie-podcast-sync create-settings-file
The command will guide you through the process. The settings and optionally also a secret file will be stored in ~/.toniepodcastsync
.
Afterwards, you can run
tonie-podcast-sync update-tonies
to fetch new podcast episodes and download them onto the tonies.
If you want to perform changes (e.g. switch to another podcast), you can edit the settings file ~/.toniepodcastsync/settings.toml
in a text editor.
To periodically fetch for new episodes, you can schedule tonie-podcast-sync
e.g. via systemd (on a Linux OS).
In addition,
tonie-podcast-sync --help
provides an overview about these and other available commands.
in your own Python scripts
You can use tonie-podcast-sync
by importing it into your own Python scripts, as in this example code:
from toniepodcastsync import ToniePodcastSync, Podcast, EpisodeSorting
# Create some Podcast objects, providing the feed URL to each
pumuckl = Podcast("https://feeds.br.de/pumuckl/feed.xml")
# By default, podcasts are placed onto Tonies by newest episode first
# If you want to change the episode sorting, following options are available
# - EpisodeSorting.BY_DATE_NEWEST_FIRST (default)
# - EpisodeSorting.BY_DATE_OLDEST_FIRST
# - EpisodeSorting.RADNOM
maus_60min = Podcast(
"https://kinder.wdr.de/radio/diemaus/audio/diemaus-60/diemaus-60-106.podcast",
episode_sorting = EpisodeSorting.BY_DATE_NEWEST_FIRST
)
maus_gute_nacht = Podcast(
"https://kinder.wdr.de/radio/diemaus/audio/gute-nacht-mit-der-maus/diemaus-gute-nacht-104.podcast",
episode_sorting = EpisodeSorting.RANDOM
)
# If you want to adjust the volume of a podcast, set volume_adjustment to an integer other than 0
# The audio will be adjusted (+/-) by that amount in dB
anne_und_die_wilden_tiere = Podcast(
"https://feeds.br.de/anna-und-die-wilden-tiere/feed.xml",
episode_sorting = EpisodeSorting.RANDOM,
volume_adjustment = -2
)
# Some Podcasts inject episodes that are very short (e.g. announcing a holiday break).
# `episode_min_duration_sec` can be used to filter out all episodes shorter then this value.
# the example below will skip all episodes shorter then 30 seconds.
checker_tobi = Podcast(
"https://feeds.br.de/checkpod-der-podcast-mit-checker-tobi/feed.xml",
episode_sorting = EpisodeSorting.RANDOM,
episode_min_duration_sec = 30
)
# Create instance of ToniePodcastSync
tps = ToniePodcastSync("<toniecloud-username>", "<toniecloud-password>")
# For an overview of your creative Tonies and their IDs
# The IDs are needed to address specific Tonies in the next step
tps.print_tonies_overview()
# Define creative Tonies based on their ID
greenTonie = "<your-tonieID>"
orangeTonie = "<your-tonieID>"
# Fetch new podcast episodes and copy them to greenTonie.
# The tonie will be filled with as much episodes as fit (90 min max).
tps.sync_podcast_to_tonie(pumuckl, greenTonie)
# Kid's should fall asleep, so let's limit the podcast
# Episodes on this tonie to 60 minutes in total.
# Use the optional parameter for this:
tps.sync_podcast_to_tonie(maus_gute_nacht, orangeTonie, 60)
For the tonie to fetch new content from tonie-cloud, you have to press one ear for 3s (until the "ping" sound) with no tonie on the box (refer also to TonieBox manual).
Contributors
Alexander Hartmann 💻 🤔 🚧 |
Wilhelmsson177 💻 🤔 🚧 ⚠️ |
Malte Bär 🐛 |
Use the all-contributors github bot to add contributors here.
builds upon work of / kudos to
- moritj29's awesome tonie_api
- Tobias Raabe
- Matthew Wimberly
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file tonie_podcast_sync-3.0.0.tar.gz
.
File metadata
- Download URL: tonie_podcast_sync-3.0.0.tar.gz
- Upload date:
- Size: 13.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.7.1 CPython/3.11.7 Darwin/23.3.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 460608224d1c698d79815955cb3967be6a8d1b3c4cddc6f62d3603c6aea53a3c |
|
MD5 | 5fb2004d0b728fb0e342a4f9343a4040 |
|
BLAKE2b-256 | 08ea34f2e21b0ca77e9cbfc8d81a48f3199a48b49f69e2c40b25e3d6af518488 |
File details
Details for the file tonie_podcast_sync-3.0.0-py3-none-any.whl
.
File metadata
- Download URL: tonie_podcast_sync-3.0.0-py3-none-any.whl
- Upload date:
- Size: 12.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.7.1 CPython/3.11.7 Darwin/23.3.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 91f87b0ec61cd3226abc0a6178ce6401088a9bd916f7f1008b70e20872213676 |
|
MD5 | e93bee755582047516dc09b6b77eac11 |
|
BLAKE2b-256 | aa56b6131bca01ac14d5742d51d59283e1081bd929c0e3e9f65e44705991bf36 |