项目作者: abi-raj

项目描述 :
Flask API which scrapes a book website
高级语言: Python
项目地址: git://github.com/abi-raj/Libgen-API.git
创建时间: 2021-05-28T09:21:51Z
项目社区:https://github.com/abi-raj/Libgen-API

开源协议:

下载


Libgen-API

A simple Flask app which scrapes books and their download links from the popular Library Genesis website and returns the response.

Installation

Install with pip:

  1. $ pip install -r requirements.txt
  2. $ python app.py

Visit : http://127.0.0.1:5000/

Endpoints:

Search:

1) Default:

  1. GET http://127.0.0.1:5000/api/default?query=flutter

2) Title:

  1. GET http://127.0.0.1:5000/api/title?query=Three.js Essentials

3) Author:

  1. GET http://127.0.0.1:5000/api/author?query=gayle laakmann mcdowell

4) Publisher:

  1. GET http://127.0.0.1:5000/api/publisher?query=oreilly

5) ISBN:

  1. GET http://127.0.0.1:5000/api/isbn?query=9780262032933

Common response:

  1. {
  2. "books": [
  3. {
  4. "author": "Thomas H. Cormen, Charles E. Leiserson, Ronald L. Rivest, Clifford Stein",
  5. "id": "FD8631D3830BFA7A3D2D305A99A011F2",
  6. "image": "http://libgen.rs/covers/183000/ACAAA8958B27468B7286F4C577A967E2-d.jpg",
  7. "language": "English",
  8. "pages": "1202",
  9. "publisher": "The MIT Press",
  10. "size": "16 Mb",
  11. "title": "Introduction to algorithms",
  12. "type": "djvu",
  13. "year": "2001"
  14. },
  15. ],
  16. "limit": 25,
  17. "result": "success",
  18. "status": "200",
  19. "totalFiles": 1,
  20. "totalPages": 1
  21. }

Other search params:

1)sortBy = def,author,title,publisher

2)orderBy = ASC,DESC

3)page = 1,2,3…. (to total Pages available)

Example:

  1. GET http://127.0.0.1:5000/api/title?query=node js&sortBy=title&orderBy=DESC&page=2
  1. GET http://127.0.0.1:5000/api/book?id=FD8631D3830BFA7A3D2D305A99A011F2

Response:

  1. {
  2. "bookData": {
  3. "description": "Explore what Flutter has to offer, where it came from, and where it’s going. Mobile development is progressing at a fast rate and with Flutter – an open-source mobile application development SDK created by Google – you can develop applications for Android and iOS, as well as Google Fuchsia.Learn to create three apps (a personal information manager, a chat system, and a game project) that you can install on your mobile devices and use for real.",
  4. "download": "http://31.42.184.140/main/2406000/227f03b36ad6b1b4c6c1af4ca444c27d/Frank%20Zammetti%20-%20Practical%20Flutter_%20Improve%20your%20Mobile%20Development%20with%20Google%E2%80%99s%20Latest%20Open-Source%20SDK-Apress%20%282019%29.pdf"
  5. },
  6. "result": "success",
  7. "status": "200"
  8. }