Code Monkey home page Code Monkey logo

setu-api's Introduction

setu-api

很久很久之前写的api, 近期在群友要求下开源

封装了 Pixiv插图/小说, 萌娘百科语音, SauceNAO/trace.moe图片搜索

基于 php 7.0+, 可轻易改写为php 5.6或更低版本

部署

仅需原生php 7.0+, 无需安装第三方库

请求

请求方式: GET

使用 type 区分搜索模式

type 说明 参数 返回 平台
get_url_img 通过URL获取图片(作为反代服务器) url: 图片地址 IMAGE Pixiv
get_pid_img 通过Pid获取图片 pid: Pid ,
page: 页数(默认为1)
IMAGE Pixiv
get_pid_novel 通过Pid获取小说(不包含系列) pid: Pid ,
page: 页数(默认为1)
JSON Pixiv
ranking_img 获取Pixiv日榜图片 r: 排名 IMAGE Pixiv
random_img 随机色图 tag: 标签,
r18(见下文)
JSON lolicon.app
random_voice 随机角色语音 tag: 标签 JSON 萌娘百科
search_img 图片搜索 tag: 标签,
r: 排名,
r18(见下文)
mode(见下文)
JSON Pixiv
search_novel 小说搜索 tag: 标签,
r: 排名,
r18(见下文)
mode(见下文)
JSON Pixiv
img_search_img 以图搜图 url: 图片地址 JSON SauceNAO trace.moe

r18

可以为空, 空或0为全年龄向, 其它数值为R-18模式

注意: 程序根据Pixiv作品Tag判断r18, 可能有误判现象

mode

搜索模式(enum)

mode search_img search_novel
default 0 按时间顺序搜索2000收藏数以上的作品 按时间顺序搜索50收藏数以上的作品
top 1 按收藏数量顺序搜索 按收藏数量顺序搜索
enhanced 2 按时间顺序搜索100收藏数以上的作品 按时间顺序搜索1收藏数以上的作品

返回

IMAGE

content-type: image/jpeg

可直接作为图片处理

JSON

content-type: application/json

  • type: 类型
  • r18: nullR-18R-18G
  • title: 标题
  • url: 资源URL, 用于音频地址, 小说封面等
  • caption:简介, 包含收藏数, 标签等信息
  • pid:Pid (str)
  • page:当前页数
  • content:(小说专用) 正文
type 说明 非空字段
image 图片 r18 title url pid page
voice 音频 url
anime 图片搜索返回的数据 title url caption
novel-oneshot 单篇小说 r18 title url pid page caption content
novel-series 系列小说 r18 title url pid page caption content

后话

如果此程序和您预期的一样正常工作,请给我一个 star

欢迎提交任何请求

交流群: 828350277

setu-api's People

Contributors

dituon avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.