针对python的danbooru后分散
pydecensooru的Python项目详细描述
Pydecesooru
使用Decensooru的python模块 自动填充任何danbooru post丢失的信息键的数据。
德克索鲁
batches
将在用户中自动获取并保持最新
数据目录,
例如,~/.local/share/pydecesooru默认在gnu/linux上。
最初是为透明使用而开发的 lunafind。
示例
>>>importrequests>>>frompydecensooruimportdecensor,decensor_iter# Decensoring a single post if it needs to be:>>>p2=requests.get("https://danbooru.donmai.us/posts/2.json").json()>>>"file_url"inp2False>>>p2d=decensor(p2)>>>"file_url"inp2dTrue>>>p2["file_ext"]'png'# Transparently decensoring any post that needs it in a search:>>>posts=requests.get("https://danbooru.donmai.us/posts.json?tags=id:1..10").json()>>>print(type(posts),type(posts[0]))<class'list'> <class 'dict'>>>>"file_url"inposts[-2]False>>>posts=list(decensor_iter(posts))>>>"file_url"inposts[-2]True