forked fromb3yc0d3/rule34Py
- Notifications
You must be signed in to change notification settings - Fork0
Hypick122/pyrule34
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
pip install -U pyrule34
or
git clone https://github.com/Hypick122/pyrule34.git
- Install the required Python packages:
pip install -U aiohttp, beautifulsoup4, lxml
- Create a .py file and import the required libraries:
importasynciofrompyrule34importAsyncRule34
AsyncRule34 can be used as a context manager:```python#exampleasync def main(): async with AsyncRule34() as r34: get_posts = await r34.get_posts(4931536) print(get_posts[0].tags) loop = asyncio.get_event_loop()loop.run_until_complete(main())
Search for posts using specified inclusion and exclusion tags.
Returns a list.
Parameters:
tags
- The include tagsexclude_tags
- The exclude tags (default: None)limit
- The (maximum) limit to get posts. Maximum 1000 per one request (default: 100)page_id
- The page number (default: 0)
search=awaitr34.search(tags=["neko"],exclude_tags=["rating:general"],page_id=2,limit=1)
Retrieve post(s) by ID or MD5 hash.
Returns a list.
Parameters:
posts_id
: The list of IDs posts or post IDmd5
: The MD5 hash of the post (default: None)
get_posts=awaitr34.get_posts(4931536)
Get comments by post ID.
Returns a list.
Parameters:
post_id
: The ID of the post
get_post_comments=awaitr34.get_post_comments(4153825)
Get a random post.
Returns a dict.
get_random_post=awaitr34.get_random_post()
Get Pool by ID.
Returns a list.
Parameters:
cid
: Pool IDoffset
: offset (default: 0) | 1 page - 45
get_pool=awaitr34.get_pool(29619)
Get user's favorites by ID.
Returns a list.
Parameters:
user_id
: user IDoffset
: offset (default: 0) | 1 page - 50
favorite=awaitr34.users.favorites(2993217)
Get the top 100 characters or tags.
Returns a list.
top_character=awaitr34.top_characters()top_tags=awaitr34.top_tags()
Get the top 10 best users by tags, comments, etc.
Returns a list.
taggers=awaitr34.stats.taggers()favorites=awaitr34.stats.favorites()commenters=awaitr34.stats.commenters()forum_posters=awaitr34.stats.forum_posters()image_posters=awaitr34.stats.image_posters()note_editors=awaitr34.stats.note_editors()
About
API wraper for rule34.xxx
Topics
Resources
License
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Packages0
No packages published
Uh oh!
There was an error while loading.Please reload this page.
Languages
- Python100.0%