This is a simple module for simplifying access to the rule34.xxx API asynchronously
To assist bot developers, this wrapper doesnt use requests
at all. Instead it uses aiohttp and coroutines.
If you arent coding asynchronously, simply use these lines when importing this api:
import asyncio
import rule34
loop = asyncio.get_event_loop()
rule34 = rule34.Rule34(loop)
and then when calling the wrapper, use data = loop.run_until_complete(rule34.getImageURLS("SearchQuery"))
. An update is coming to simplify this
pip install rule34
pip install https://github.com/LordOfPolls/Rule34-API-Wrapper/archive/master.zip --upgrade
Sure! Just make a pull request ^-^
If your change improves how the wrapper works, ill merge it!
I advise you dont modify .travis.yml
or the function selfTest
, because theyre used by travis-ci and modifying them may cause the build to fail when testing
- Scream and panic at your lost porn
- Breathe
- Make an issue on github, and be as detailed as possible (screenshots and tracebacks help a lot)
Each function has a docstring that explains what it is, and what arguments it needs, ill go over them simply here
urlGen(tags, limit, id, PID, deleted)
- Generates a URL based on arguments which is used to obtain an XML document
Argument | Purpose | Usage | Type |
---|---|---|---|
tags | A search term | urlGen(tags="furry") |
str/int |
limit | A limit of how many posts you want | urlGen([args],limit=100) |
str/int |
id | An Id of the post | urlGen(id=12312) |
str/int |
PID | Page number of the search | urlGen([args],PID=2 |
str/int |
deleted | Adds deleted posts to your search | urlGen(deleted=True |
bool |
totalImages(tags)
- returns an int of how many posts match a tag
Argument | Purpose | Usage | Type |
---|---|---|---|
tags | A search term | totalImages("furry") |
str |
getImageURLS(tags)
- returns a list of urls for every post's image/webm/gif
Argument | Purpose | Usage | Type |
---|---|---|---|
tags | A search term | getImageURLS(tags) |
str |
fuzzy | Toggles fuzzy searching | `getImageURLS(fuzzy=True) | bool |
getPostData(PostID)
- returns a dictionary of information about a post
Argument | Purpose | Usage | Type |
---|---|---|---|
PostID | The ID of a post | getPostData(12345) |
str/int |