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
- Split
sociallib/addition_tools.pyintoaddition_tools.pyandcore.py - Use
sociallib/color_codes.pyin all scripts - Implement more API features, like comment chapters
- Documentation
License
This project is licensed under MIT. See the LICENSE file for details.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file
sociallib_py-0.0.1.tar.gz.File metadata
File hashes
1df28c9d6ce497eccbfc834f7c870aec533798510c37c819f0aa3dafbe1932d7dac2f1d586684cd9215208f8b4ce3da0dba75b6ec5e747395a4a91ea51a8d2e2af671333db3eeed49cbb3fd52a29da16See more details on using hashes here.