jedrus2000 / audtekapi

Unofficial API helper for Audioteka - https://audioteka.com/ - audiobooks service.
Apache License 2.0
6 stars 2 forks source link

how do you get chapter info with this api ? #4

Open nonab opened 4 days ago

nonab commented 4 days ago

i wasn't able to find it but in readme you say it's possible. can you show me how ?

jedrus2000 commented 3 days ago

Current version is very legacy, so I've checked my latest code to update master and looks like it stopped to work.

Probably they have changed API again, as month ago my legacy mobile app said that it won't work any longer and I need to update.

Can't say when I will have time to work on it. I will post update here.

luky92 commented 3 days ago

My app (based on this code ported to C#) seems to still be working just fine)

nonab commented 3 days ago

My app (based on this code ported to C#) seems to still be working just fine)

Do you know a method to retrieve chapter data?

jedrus2000 commented 2 days ago

My app (based on this code ported to C#) seems to still be working just fine)

Do you know a method to retrieve chapter data?

Usually first try to .get_shelf to get IDs for your books there.

Then i.e. to download books (in this example books IDs are hardcoded):

        audiobook_ids = [
            ('c387a9b3-4426-4137-9da9-aaec57aa53ca', 'hiszpanski-rozmowki-powiedz-to'),
            ('a10e3321-a874-4879-868d-154eef9804cd', 'dygat-podroz')
        ]
        for audiobook in audiobook_ids:
            audiobook_id, audiobook_name = audiobook
            Path(f"./{audiobook_name}").mkdir(exist_ok=True)
            tracks_list = self.api.get_audiobook_track_list(audiobook_id)
            print(tracks_list)
            for track in tracks_list['_embedded']['app:track']:
                file_data = self.api.get_track(track['_links']['app:file']['href'])
                r = self.api._session.get(file_data['url'])
                Path(f"./{audiobook_name}/{track['title']}.mp3").write_bytes(r.content)