Skip to main content

Unofficial API for Audioteka

Project description

Latest PyPI version

Unofficial API helper for Audioteka - audiobooks service: https://audioteka.com/

This is set of functions to get contents of your personal bookshelf at Audioteka, including book’s chapters downloading.

Main reason for creating it, is my upcoming plugin for Mopidy.

Currently following functions are implemented:
  • get_categories - getting Categories (sign in not needed)

  • login - login into service

  • get_shelf - getting shelf content (sign in required)

  • get_shelf_item - getting single book detail (sign in required)

  • get_chapters - getting book’s chapters list (sign in required)

  • get_chapter_file - getting one chapter file data (sign in required)

  • epoch_to_datetime - converts date time string seen in Audioteka’s responses into Python’s DateTime

Installation

Python 2.7 or higher is required.

Install by running:

pip install audtekapi

Usage

Examples.

sign in:

bash> python
Python 2.7.15
>>>> import audtekapi
>>> cred = audtekapi.login('some@mail.com', 'myPasswordAtAudioteka')
>>> cred
{u'AuthenticationToken': u'8122aaaa-aebc-22a1-2233-1111a11ceecb',
u'Status': u'LoginStatusOk',
u'HashedPassword': 'DB111ABC01A10203A10C010B4736E83746D838348AD7B8CAA11BBCC7854A010192A93841',
u'Salt': u'3660123456', u'userLogin': 'a.barganski@gmail.com'}

Getting shelf content:

>>> shelf = audtekapi.get_shelf(cred)
>>> shelf
{
  u'Date':u'20190105',
  u'DownloadDateInMilliseconds':1546710438687,
  u'ServerAddress': u'http://mediaserver5.audioteka.pl/GetFileRouter.ashx'
  u'ShelfItemsCount':1,
  u'Footer':u'No=0&daa=true&httpStatus=true&regen=true',
  u'Books':[
  {
     u'IsFreeChapterEnabled':False,
     u'BigPictureLink': u'https://static.audioteka.com/pl/images/products/calek-perechodnik/spowiedz-duze.jpg',
     u'IsSample':False,
     u'WMStatus':u'Done',
     u'Author':u'Calek Perechodnik',
     u'LineItemCategory':u'',
     u'IsForKids':False,
     u'IsAudiobookPlus':False,
     u'Reader':u'Maciej Wi\u0119ckowski',
     u'Type':u'Audiobook - pe\u0142ny',
     u'ListPrice':32.9,
     u'AverageRating':10,
     u'Status':u'Paid',
     u'LastWatermarkingDate':u'/Date(1546557722603+0100)/',
     u'SmallPictureLink': u'https://static.audioteka.com/pl/images/products/calek-perechodnik/spowiedz-male.jpg',
     u'Title':u'Spowied\u017a',
     u'CanDownloadZip':True,
     u'SampleLink': u'https://static.audioteka.com/pl/content/samples/calek-perechodnik/spowiedz.mp3',
     u'UserRating':0,
     u'Cycle':u'',
     u'FilesDivisionMode':u'Normal',
     u'Publisher':u'Heraclon International',
     u'ProductDateAdd':u'/Date(1519206527537+0100)/',
     u'OrderTrackingNumber':u'1234567890',
     u'Length':861,
     u'LineItemId':u'00000eea-111a-2222-aa22-a1333aaa111f',
     u'BlackBerrySku':u'001199Audioteka',
     u'CategoryId':u'biografie',
     u'ProductId':u'spowiedz',
     u'MediumPicture': u'https://static.audioteka.com/pl/images/products/calek-perechodnik/spowiedz-srednie.jpg',
     u'CategoryName':u'Biografie',
     u'IPodDivisionMode':u'OneFile',
     u'RootCategoryId':u'',
     u'CreatedDate':u'/Date(1546553332470+0100)/',
     u'WatermarkingTarget':u'Normal',
     u'EbookLink':u''
  },
}

Getting book’s chapters information:

>>> chapters = audtekapi.get_chapters(shelf['Books'][0]['OrderTrackingNumber'], shelf['Books'][0]['LineItemId'], cred)
>>> chapters
[
    {u'Track': 1, u'Length': 335673, u'Size': 4920010, u'Link': u'001_Spowiedz.mp3', u'ChapterTitle': u'001_Spowiedz'},
    {u'Track': 2, u'Length': 1047450, u'Size': 14884993, u'Link': u'002_Spowiedz.mp3', u'ChapterTitle': u'002_Spowiedz'}
]

Downloading one chapter and saving it into file:

>>> r = audtekapi.get_chapter_file(shelf['Books'][0]['OrderTrackingNumber'], shelf['Books'][0]['LineItemId'], shelf['ServerAddress'], shelf['Footer'], chapters[1]['Link'], cred)
>>> open(chapters[1]['Link'], 'wb').write(r.content)

License

Apache License Version 2.0

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

audtekapi-0.1.1.tar.gz (9.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

audtekapi-0.1.1-py2.py3-none-any.whl (9.3 kB view details)

Uploaded Python 2Python 3

File details

Details for the file audtekapi-0.1.1.tar.gz.

File metadata

  • Download URL: audtekapi-0.1.1.tar.gz
  • Upload date:
  • Size: 9.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.21.0 setuptools/40.6.3 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/2.7.15

File hashes

Hashes for audtekapi-0.1.1.tar.gz
Algorithm Hash digest
SHA256 8b65f19a3984290636711086f0563699b2e0c5aedbbeffb145773468de5436d1
MD5 dbed9786582954a34dbffb57071111a1
BLAKE2b-256 6040a2f87782b8f56f6b501845b741a15efb49bd812dd0f68bb71efcaebc0aba

See more details on using hashes here.

File details

Details for the file audtekapi-0.1.1-py2.py3-none-any.whl.

File metadata

  • Download URL: audtekapi-0.1.1-py2.py3-none-any.whl
  • Upload date:
  • Size: 9.3 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.21.0 setuptools/40.6.3 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/2.7.15

File hashes

Hashes for audtekapi-0.1.1-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 24456c3d3444b153ba9d22b25ff46f4eb028366b77cc17dbbf4153d49cb91069
MD5 814ba40b2a5cc076c1382024a6611d47
BLAKE2b-256 c7a9a781f7905c26692b6eb7357076ff24c62218bb38985098cc62de6fcd259e

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page