szurubooru的Python接口
pyszuru的Python项目详细描述
比祖鲁
szurubooru的Python接口
安装:pip install pyszuru
使用
创建API实例
importpyszurumybooru=pyszuru.API("https://example.com/booru",username="alice",# Authenticate with a passwordpassword="hunter2",# Or use a tokentoken="my-token-string",# Optionally specify a API base URL if it differs from the default configuration# api_url="/booru-api", <-- relative to base URL# api_url="https://api.example.com/booru", <-- new absolute base)
使用标签
注意:建议使用下面概述的工厂函数,而不是调用Tag
直接构造函数。在
获取现有标记
从booru获取一个现有的标记,方法是按名称引用它
^{pr2}$创建新标记
创建新标记,必须仅指定主名称
spiderman_tag=pyszuru.Tag.new(mybooru,"spiderman")
更改标记的属性
spiderman_tag.implications=spiderman_tag.implications+[marvel_comics_tag]
使用posts
搜索
- 项目
标签: