Skip to main content

Unofficial lib sites api (ranobelib.me, mangalib.me, ... )

Project description

sociallib-py

Unofficial API for lib sites (mangalib.me, ranobelib.me, etc.)

Features

  • Read info about all types of objects (People, Manga, Franchise, etc.)
  • Use Bearer token for authorization
  • Download all objects (Manga, Ranobe, etc.)
  • Read, remove, mark as read, and download notifications
  • Search all types of objects
  • Like chapters

Installation

pip install mangalib-api

Note: This does not install the examples/ folder.

Usage

Check the files in the examples/ folder for usage examples. For instance:

Create user.json file with json dictionary or pythonic dict with optional "Authorization" and "User-Agent" keys and other headers if you want.

import asyncio
from httpx import AsyncClient, Limits, Timeout

from sociallib.libapi import LibAccount
from sociallib.novelTypes import Hentai
from sociallib.addition_tools import extract_slug_url


async def likeall(full_url: str):
    async with AsyncClient(
        limits=Limits(max_connections=30), timeout=Timeout(60), http2=True
    ) as cli:
        la = LibAccount(cli, "user.json")
        url = extract_slug_url(full_url)
        if url:
            manga = await Hentai(
                cli, auth_token=la.beriar, print_warnings=False
            ).recover_model(url, use_auth=True)
            chs = await manga.chapters()
            print(
                sum(
                    await asyncio.gather(
                        *[e.set_like(True, do_and_think_later=True) for e in chs]
                    )
                ),
                "likes switched",
            )

asyncio.run(likeall(input("full_url: ")))

Contributing

Feel free to modify and send suggestions or pull requests. Issues and feedback are welcome!

Todo

  1. Split sociallib/addition_tools.py into addition_tools.py and core.py
  2. Use sociallib/color_codes.py in all scripts
  3. Implement more API features, like comment chapters
  4. Documentation

License

This project is licensed under MIT. See the LICENSE file for details.

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

sociallib_py-0.0.1.tar.gz (22.3 kB view details)

Uploaded Source

Built Distribution

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

sociallib_py-0.0.1-py3-none-any.whl (24.3 kB view details)

Uploaded Python 3

File details

Details for the file sociallib_py-0.0.1.tar.gz.

File metadata

  • Download URL: sociallib_py-0.0.1.tar.gz
  • Upload date:
  • Size: 22.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.11

File hashes

Hashes for sociallib_py-0.0.1.tar.gz
Algorithm Hash digest
SHA256 1df28c9d6ce497eccbfc834f7c870aec533798510c37c819f0aa3dafbe1932d7
MD5 dac2f1d586684cd9215208f8b4ce3da0
BLAKE2b-256 dba75b6ec5e747395a4a91ea51a8d2e2af671333db3eeed49cbb3fd52a29da16

See more details on using hashes here.

File details

Details for the file sociallib_py-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: sociallib_py-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 24.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.11

File hashes

Hashes for sociallib_py-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 9dff4258bc323b737b4fbd8ffddd0f6dec3a35dbbb2241cd3872230fe09829c6
MD5 20dc8576734b2a735cc6eb72308ca12c
BLAKE2b-256 3430fad9c387382b757c16dd93239ce1541c444e290f49ac3670a6bebb9a2927

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