Beispiel #1
0
 def get(self, archive_id=None):
     try:
         if archive_id:
             return api.Book.get(archive_id=archive_id).dict()
         return {'book': [book.dict() for book in api.Book.all()]}
     except Exception:
         return item(archive_id)
Beispiel #2
0
    def get(self, iid, manifest=None):
        metadata = item(iid)['metadata']
        if manifest:
            return jsonify({})
        result = {

        }
        if 'librivoxaudio' in metadata.get('collection', []):
            result['opds_audio'] = request.url_root + 'books/%s/opds_audio_manifest' % (iid)

        if metadata.get('mediatype') == 'texts':
            result['iiif'] = request.url_root + 'iiif/%s/manifest.json' % (iid)
            result['ia_book'] = request.url_root + 'books/%s/ia_manifest' % (iid)
            result['opds'] = 'https://bookserver.archive.org/catalog/%s' % (iid)
        data = jsonify(result)
        print(dir(data))
        return data
 def get(self, archive_id):
     return item(archive_id)
Beispiel #4
0
 def get(self, iid):
     return item(iid)['files']
Beispiel #5
0
 def get(self, iid):
     return item(iid)['reviews']
Beispiel #6
0
 def get(self, iid):
     return item(iid)['metadata']
Beispiel #7
0
 def get(self, iid):
     return item(iid)
Beispiel #8
0
 def post(self):
     """For Upload API"""
     # f = request.files['file']
     # ia.upload(name, f)
     return item(iid)
 def get(self, network, show, episode):
     return item(iid=episode)
 def get(self, network, show, page=1, limit=100):
     q = item(iid=show)['metadata']['search_collection']
     try:
         return search(q, page=page, limit=limit)
     except Exception as e:
         raise ValueError("This show has no episodes.")
Beispiel #11
0
 def get(self, archive_id):
     return item(archive_id)