migrate to omnisearch endpoint

This commit is contained in:
bignutty 2025-01-03 12:30:54 +01:00
parent e43775ed7d
commit 9530e59e6b
3 changed files with 35 additions and 16 deletions

View file

@ -29,11 +29,12 @@ const Api = Object.freeze({
IMAGE_EMOGEN: '/image/emogen/generate', IMAGE_EMOGEN: '/image/emogen/generate',
OMNI_ANIME: '/omni/anime',
OMNI_ANIME_SUPPLEMENTAL: '/omni/anime-supplemental',
PHOTOFUNIA_RETRO_WAVE: '/photofunia/retro-wave', PHOTOFUNIA_RETRO_WAVE: '/photofunia/retro-wave',
PHOTOFUNIA_YACHT: '/photofunia/yacht', PHOTOFUNIA_YACHT: '/photofunia/yacht',
SEARCH_ANIME: '/search/anime',
SEARCH_ANIME_SUPPLEMENTAL: '/search/anime-supplemental',
SEARCH_BING: '/search/bing', SEARCH_BING: '/search/bing',
SEARCH_BING_IMAGES: '/search/bing-images', SEARCH_BING_IMAGES: '/search/bing-images',
SEARCH_GOOGLE: '/search/google', SEARCH_GOOGLE: '/search/google',

View file

@ -170,19 +170,6 @@ module.exports.rule34 = async function(context, query, service){
}) })
} }
module.exports.anime = async function(context, query, includeAdultContent){
return await request(Api.SEARCH_ANIME, "GET", {}, {
q: query,
include_adult: includeAdultContent
})
}
module.exports.animeSupplemental = async function(context, supplementalKey){
return await request(Api.SEARCH_ANIME_SUPPLEMENTAL, "GET", {}, {
supplemental_key: supplementalKey
})
}
module.exports.bing = async function(context, query, nsfw){ module.exports.bing = async function(context, query, nsfw){
return await request(Api.SEARCH_BING, "GET", {}, { return await request(Api.SEARCH_BING, "GET", {}, {
q: query, q: query,
@ -407,4 +394,19 @@ module.exports.emojiKitchen = async function(emoji){
collection: "emoji_kitchen_v6", collection: "emoji_kitchen_v6",
q: emoji.join('_') q: emoji.join('_')
}) })
}
// Omnisearch
module.exports.anime = async function(context, query, includeAdultContent){
return await request(Api.OMNI_ANIME, "GET", {}, {
q: query,
include_adult: includeAdultContent
})
}
module.exports.animeSupplemental = async function(context, supplementalKey){
return await request(Api.OMNI_ANIME_SUPPLEMENTAL, "GET", {}, {
supplemental_key: supplementalKey
})
} }

View file

@ -1658,4 +1658,20 @@ module.exports.PROVISIONAL_ACCOUNT_AVATARS = Object.freeze([
"https://discord.com/assets/0afec6e15d7c376edb17.png", "https://discord.com/assets/0afec6e15d7c376edb17.png",
"https://discord.com/assets/06c71afa509013e91173.png", "https://discord.com/assets/06c71afa509013e91173.png",
"https://discord.com/assets/15a9b7ce7525b2fbe72f.png" "https://discord.com/assets/15a9b7ce7525b2fbe72f.png"
]) ])
// Omnisearch
// Anime Format Types (/omni_service/endpoints/anime.js)
const FORMAT_TYPES = {
TV: "Tv",
TV_SHORT: "Tv Short",
MOVIE: "Movie",
SPECIAL: "Special",
OVA: "OVA",
ONA: "ONA",
MUSIC: "Music",
MANGA: "Manga",
NOVEL: "Novel",
ONE_SHOT: "One Shot"
}