This python script is to work with LingQ API, specifically to upload a long list of audio files.
To help me better prepare for my DELF B2 exam I decided to listen and read "Steve Jobs" by Walter Isaacson .
I legally purchased both the french Kindle book and audio book from Audible, then used OpenAudible and mp3splitter-js to create the audio files.
With the Kindle reader I am able to shrink the font size to a tiny size and copy and paste (painfully) one chapter at a time. Thankfully the New LinqQ Reader makes dumping the text easier and much readable than using the legacy version.
If there's an easier way to scrap the content "legally" from a Kindle book with latest version of Amazon Kindle Reader, I did not find one in my quick research.
EDIT: Publisher has limits places on Kindle Reader: https://twitter.com/paulwillgamble/status/1181667329798791168?s=20
Uploading an audio file was very problematic and not at all intuitive in part because of the limitations of Django REST Framework (DRF).
Here's a great article for reference.
Create .env
, make sure it has the following parameters:
#APIKey="Token api_number"
APIKey="Token [https://www.lingq.com/accounts/apikey]"
# There is an address as per API POST doc that includes in substitute of 'xx' a two letter language code (ie 'fr' = french)
postAddress="https://www.lingq.com/api/v2/xx/lessons/"
# Specify private if material is copyrighted or personal
status="private"
# Manually create a course on Lingq and reference this collection ID
collectionID="xxxxxx"
# Full path name (created on Mac OSX)
mypath="/Users/paulywill/Coding/python/lingq_upload/mp3"
Command:
python upload.py
mescyn - on Lingq Developer Forum
beeman - on Lingq Developer Forum
@gbouthenot - for making mp3splitter-js