Backup Yoto cards
Yoto
Yoto sells audiobook players for children.
I have played with a Yoto Mini, it’s kind of nice hardware, but personally, I don’t like the way it works:
- it requires a Wi-Fi and internet connection (to set it up and download the audiobooks);
- it requires having a big tech proprietary device (Android or iOS smartphone);
- it requires installing a proprietary application on said smartphone;
- it requires creating an account on Yoto’s website (that will be hacked at some point in time).
Basically, the day Yoto goes bankrupt, or decides to not support your device anymore, or decides to block your account for whatever reason, or gets badly hacked… it will become much more complicated to use the device you own. And let’s not forget that a connected device is a device potentially vulnerable to cyberattacks (cf. Hyppönen’s Law: If It’s Smart, It’s Vulnerable).
Yoto cards
Yoto sells cards that “contain” stories. Put the card in the Yoto, and the Yoto will start playing the story.
In fact, the Yoto card is an NFC tag containing a URL. That URL contains the story identifier and a key specific to that card (I guess to identify the owner/validate the purchase/license).
The Yoto player then downloads the story from there.
Backing up cards
Given that:
- I don’t like to be constrained to play content on specific devices;
- the NFC card can break;
- the Yoto player can break;
- Yoto can close its service for many reasons;
Then, I’d like to be able to do a backup of the cards content.
Existing solution
After a quick search, I found the Yoto Archival Downloader project. Basically, you scan the card with your smartphone, open the link on your computer and copy/paste the project code into the browser’s console. The program then changes the page to show download links.
It’s a nice trick, but not very easy to use without another tool to download all links on the page. And after that, the audio files still need to be tagged (to set the track metadata like the author and the title), and it’s a tedious task.
My solution
The existing solution seems quite simple. So why not do it myself?
What I want to do is to write a piece of command-line software that:
- takes the card URL;
- download the page;
- extract interesting information from it (card metadata, links to the content);
- download tracks and covers;
- and maybe generate a shell script to tag the audio file.
So I decided to write a software doing that using Python.
There are a lot of python libraries doing plenty of things, so in the end I mostly had to write glue code:
- use requests to do HTTP requests (download the web page and then the images and audio files);
- use beautifulsoup4 to extract data from the HTML page;
- use puremagic to guess the file type of the downloaded content;
- use mutagen to tag the audio files directly.
And of course, the various libraries that python directly provides.
It has been quite easy to end up with a working solution.
The result of that experiment is the toto-backup software.
Notes
I didn’t think of checking if youtube-dl (or forks of it) already handles Yoto URLs before starting writing this software. I was kind of relieved to see I didn’t waste my time as youtube-dl, in fact, cannot download Yoto stories.
But that could be a future development: add a plugin for youtube-dl.
I used the same idea as Yoto Archival Downloader, without looking if there was a Yoto API… And Yoto does provide an API. But I’m not sure cards can be backed up using it.
Another future idea could be to support an NFC reader, so swiping a card would directly start the download.