Giter VIP home page Giter VIP logo

trace.moe's Introduction

trace.moe

License Discord

Anime Scene Search Engine

Trace back the scene where an anime screenshots is taken from.

It tells you which anime, which episode, and the exact moment this scene appears.

Try this image yourself.

Web Integrations

Link to trace.moe from other websites, you can pass image URL in query string like this:

https://trace.moe/?url=https://images.plurk.com/32B15UXxymfSMwKGTObY5e.jpg

trace.moe API

For Bots/Apps, refer to https://soruly.github.io/trace.moe-api/

System Overview

This repo is just an index page for the whole trace.moe system. It consists of different parts as below:

Client-side:

Server-side:

  • trace.moe-api - API server for image search and database updates
  • trace.moe-media - media server for video storage and scene preview generation, now integrated into trace.moe-api
  • trace.moe-worker - includes hasher, loader and watcher, now integrated into trace.moe-api
  • LireSolr - image analysis and search plugin for Solr

Others:

  • anilist-crawler - getting anilist info and store in mariaDB, now integrated into trace.moe-api
  • slides - past presentation slides on the project

Hosting your own trace.moe system

You're going to need these docker images. They are provided in the docker-compose.yaml file.

Parts Docker CI Build Docker Image
liresolr GitHub Workflow Status Docker Image Size
trace.moe-www GitHub Workflow Status Docker Image Size
trace.moe-api GitHub Workflow Status Docker Image Size

Prerequisites

You need docker-compose for your OS. Windows is supported via WSL2.

Getting started

  1. Copy .env.example to .env and update config as you need.

  2. Ensure the directories exist before starting the containers. The SOLR_DIR, must have it's owner uid and gid set to 8983.

mkdir -p /mnt/c/trace.moe/video/
mkdir -p /mnt/c/trace.moe/hash/
mkdir -p /mnt/c/trace.moe/sqlite/
mkdir -p /mnt/c/trace.moe/solr/
sudo chown 8983:8983 /mnt/c/trace.moe/solr/
  1. Start the cluster
docker-compose up

How to begin hashing

trace.moe-api will scan the VIDEO_PATH every minute for new video files (.mp4 or .mkv). You can manually trigger a scan by calling /scan at the api server

curl http://localhost:3311/scan

Any video format readable by ffmpeg is supported. But the file extension must be either .mp4 or .mkv, other files will be ignored.

Folder structure for anilist ID

trace.moe assumes the folder name is anilist ID. If your data is not related to anilist ID, you can use any id/text you want. The system would still work partially without anilist data. The files must be contained in 1-level folders, e.g.

/mnt/c/trace.moe/video/{anilist_ID}/foo.mp4

trace.moe's People

Contributors

dependabot-preview[bot] avatar dependabot-support avatar gitter-badger avatar kj415j45 avatar leslie-wong-h avatar magic-akari avatar mr-quin avatar renovate-bot avatar shirokoneko avatar soruly avatar thblckjkr avatar vankerkom 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  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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 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  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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

trace.moe's Issues

配置问题

大佬,请问一下这个要怎么设置啊,一直提示连接搜索服务器失败

Expose an API to retrieve anime info

Seems like the next logical step (though if it gets popular you might get some heavy traffic).

I would like to use it to automatically tag Animeshot screenshots, and then I can provide a better search interface using the cached data ;-)

Search time returns a very large number

Sometimes the search result shows xxxxxx images searched in 1476699897000 seconds
This is because liresolr has a bug in time calculation.
It should works like time = 1476701076153 - 1476699897891, but sometimes it becomes time = 1476699897000 - 0, which makes RawDocsSearchTime wrong
ref:
https://bitbucket.org/dermotte/liresolr/src/43e2ee68eb7c0df4a62506ad214a9b16ce73cefc/src/main/java/net/semanticmetadata/lire/solr/LireRequestHandler.java?at=master&fileviewer=file-view-default#LireRequestHandler.java-390

synonyms_chinese array has string quotes outside of array

I used this image, (Yes i know this is not how its not supposed to be used, but i tested it and i got json errors)

ypixp77o5p321

And the json response is: Json Response

As you can see here that synonyms_chinese is "synonyms_chinese":"[]", not

"synonyms_chinese":[

],

Since i am using Newtonsoft.Json for C# i am deserializing the object, but beacuse of this json value error is, i am getting this error, which is not fixable unless the json api is fixed, or i just ignore using that value at all. or use dynamic values.

Error:
Error converting value "[]" to type 'System.Collections.Generic.List`1[System.String]'. Path 'docs[4].synonyms_chinese', line 1, position 3182.

EDIT:

Got same issue with this picture: (Spoilers sorry)
black clover

Gist and location

You can find my project at: ThomasAunvik/AnimeListBot within class TraceMoe.cs

How to collect/download such large scale anime videos ?

Hi Soruly,

First, thank you for developing the trace.moe.

I would like to create an anime videos repository in my project. So I am interested in the method or open source library to download large scale anime videos according to the anime list (mal? anidb?) . Could you have a chance to share the experience on how to collect/download such large scale anime videos in your project trace.moe ? Did you manually download the anime videos and organize the video files ? Did you use some open source automation tools/script to download the videos in regular ? I checked your project anilist-crawler but which seems only crawl the metadata of anime. I also checked your 2019 slides but it didn't mention as well.

Thank you !

Ask

how to install this bot in termux ? and how to run it

Add Retry-After Header for HTTP 429

Following RFC 6585, it is suggested to add a Retry-After header. See MDN for more information.

This should be added for both /search and /api/search endpoint.

The current header x-whatanime-limit-ttl and x-whatanime-quota-ttl (as requested by #22) remains untouched for now.

How do I get the video?

I try to generate the url but the "start" and "end" properties are missing, the api does not give them therefore I cannot generate the video

image

Why this image doesn't return correct result(s)?

Image:

image

Result:

image

The image is directly captured from the video file so it should be pretty well matched.

Actually, it showed correct result when I searched it at the first time. But later when I redo, it always shows no correct results.

About the difference between api and telegram-bot search results

Why is the result of searching through api different from the result of searching through telegram bot, and the result of searching through telegram bot is accurate?

The pictrue url : https://i.imgur.com/KcCauwr.gif

GET https://trace.moe/api/search?url=https://i.imgur.com/KcCauwr.gif

Result:

{
"RawDocsCount": 7411114,
"CacheHit": false,
"trial": 1,
"limit": 10,
"limit_ttl": 60,
"quota": 1000,
"quota_ttl": 86400,
"RawDocsSearchTime": 0,
"ReRankSearchTime": 0,
"docs": [
{
"filename": "[Sumisora][Munto][TV][DVDRip][05][GB][X264_AAC].mp4",
"episode": 5,
"from": 433.17,
"to": 436.5,
"similarity": 0.8496170303306185,
"anilist_id": 5702,
"anime": "仰望天空的少女瞳中的世界",
"at": 434.83500000000004,
"is_adult": false,
"mal_id": 5702,
"season": "",
"synonyms": [
"Munto TV",
"The World Reflected in the Eyes of a Girl Looking Up at the Heavens"
],
"synonyms_chinese": [],
"title": "空を見上げる少女の瞳に映る世界",
"title_chinese": "仰望天空的少女瞳中的世界",
"title_english": null,
"title_native": "空を見上げる少女の瞳に映る世界",
"title_romaji": "Sora wo Miageru Shoujo no Hitomi ni Utsuru Sekai",
"tokenthumb": "1Eim73z5aeDlRrBMOZqBvCaEU"
},
{
"filename": "[Ohys-Raws] To Love-Ru Trouble - Multiplication - Mae kara Ushiro kara (DVD 1024x576 x264 AAC).mp4",
"episode": null,
"from": 667.33,
"to": 667.33,
"similarity": 0.8439356096668302,
"anilist_id": 100659,
"anime": "To LOVE-Ru Multiplication",
"at": 667.33,
"is_adult": false,
"mal_id": 35000,
"season": "",
"synonyms": [
"To LOVE-Ru (2017)",
"To Love ru: Trouble - Multiplication",
" From the Front",
" from Behind"
],
"synonyms_chinese": [],
"title": "To LOVEる -とらぶる- Multiplication ~前から後ろから~",
"title_chinese": "To LOVE-Ru Multiplication",
"title_english": null,
"title_native": "To LOVEる -とらぶる- Multiplication ~前から後ろから~",
"title_romaji": "To LOVE-Ru: Multiplication - Mae kara Ushiro kara",
"tokenthumb": "wlMaVVBoGoHACjxmwq8XFUjs"
},
{
"filename": "To Love-Ru Trouble - Multiplication - Mae kara Ushiro kara (DVD 1024x576 x264 AAC).mp4",
"episode": null,
"from": 667.25,
"to": 667.25,
"similarity": 0.8403405786159281,
"anilist_id": 21853,
"anime": "To LOVE-Ru Darkness 2nd OVA",
"at": 667.25,
"is_adult": false,
"mal_id": 31380,
"season": "",
"synonyms": [
"To Love Ru Darkness 2nd OVA"
],
"synonyms_chinese": [
"出包王女 DARKNESS 第二季 OVA",
"茶煲情緣To LOVEるDARKNESS 第二季 OVA",
"戀愛大麻煩 DARKNESS 第二季 OVA"
],
"title": "To LOVEる -とらぶる- ダークネス2nd",
"title_chinese": "To LOVE-Ru Darkness 2nd OVA",
"title_english": null,
"title_native": "To LOVEる -とらぶる- ダークネス2nd",
"title_romaji": "To LOVE-Ru Darkness 2nd OVA",
"tokenthumb": "d6MYP2emJAa4jXz3R0MkbiHVA"
},
{
"filename": "[Ohys-Raws] Aikatsu Friends! - 20 (TX 1280x720 x264 AAC).mp4",
"episode": 20,
"from": 448,
"to": 448.25,
"similarity": 0.8285430726510286,
"anilist_id": 101043,
"anime": "星夢學園 Friends!",
"at": 448.125,
"is_adult": false,
"mal_id": 37204,
"season": "",
"synonyms": [],
"synonyms_chinese": [
"偶像活動 Friends!",
"偶像學園 Friends!"
],
"title": "アイカツフレンズ!",
"title_chinese": "星夢學園 Friends!",
"title_english": null,
"title_native": "アイカツフレンズ!",
"title_romaji": "Aikatsu Friends!",
"tokenthumb": "lRQjn3eudml6TCftmF9h57d26RY"
},
{
"filename": "[Ohys-Raws] Arte - 04 (MX 1280x720 x264 AAC).mp4",
"episode": 4,
"from": 350.58,
"to": 351.08,
"similarity": 0.8282755500520972,
"anilist_id": 110547,
"anime": "Arte",
"at": 350.83,
"is_adult": false,
"mal_id": 40128,
"season": "",
"synonyms": [],
"synonyms_chinese": [
"阿爾蒂"
],
"title": "アルテ",
"title_chinese": "Arte",
"title_english": "Arte",
"title_native": "アルテ",
"title_romaji": "Arte",
"tokenthumb": "TEcOiv6DumsJUkzFGHVNyIviA7g"
},
{
"filename": "[DMG&DHR][DATE A LIVE][01][BIG5][720P][AVC_AAC].mp4",
"episode": 1,
"from": 271.33,
"to": 271.33,
"similarity": 0.8275798090128962,
"anilist_id": 15583,
"anime": "Date A Live",
"at": 271.33,
"is_adult": false,
"mal_id": 15583,
"season": "",
"synonyms": [],
"synonyms_chinese": [
"約會大作戰"
],
"title": "デート・ア・ライブ",
"title_chinese": "Date A Live",
"title_english": "Date A Live",
"title_native": "デート・ア・ライブ",
"title_romaji": "Date A Live",
"tokenthumb": "eXVq2gBayT4DMlhFcPfHcsh2yVM"
},
{
"filename": "(btpig)_Nabari_No_Ou_19.mp4",
"episode": 19,
"from": 569,
"to": 569,
"similarity": 0.827397542383693,
"anilist_id": 3655,
"anime": "隱之王",
"at": 569,
"is_adult": false,
"mal_id": 3655,
"season": "",
"synonyms": [
"Nabari no Oh",
"King of Nabari"
],
"synonyms_chinese": [
"隱王"
],
"title": "隠の王",
"title_chinese": "隱之王",
"title_english": null,
"title_native": "隠の王",
"title_romaji": "Nabari no Ou",
"tokenthumb": "5m1Rae3ovyCP3tWoHBeNIOeYRo"
},
{
"filename": "(18禁アニメ) After... THE ANIMATION 第1章 (PS3アプコン DVD 960x720 x264 AAC).mp4",
"episode": null,
"from": 304.25,
"to": 304.25,
"similarity": 0.8271225839954585,
"anilist_id": 3711,
"anime": "After... The Animation",
"at": 304.25,
"is_adult": true,
"mal_id": 3711,
"season": "",
"synonyms": [],
"synonyms_chinese": [],
"title": null,
"title_chinese": "After... The Animation",
"title_english": "After... The Animation",
"title_native": null,
"title_romaji": "After... The Animation",
"tokenthumb": "mqSH1n2YAAZGComs4rCesMRXMI"
},
{
"filename": "[dmhy][ARIA_The_ORIGINATION][07][DVDRIP][x264_AAC].mp4",
"episode": 7,
"from": 9.75,
"to": 10.25,
"similarity": 0.8270611019371625,
"anilist_id": 3297,
"anime": "ARIA The ORIGINATION",
"at": 10,
"is_adult": false,
"mal_id": 3297,
"season": "",
"synonyms": [
"アリア ジ オリジネーション"
],
"synonyms_chinese": [
"水星領航員 第三季"
],
"title": "ARIA The ORIGINATION",
"title_chinese": "ARIA The ORIGINATION",
"title_english": "ARIA The ORIGINATION",
"title_native": "ARIA The ORIGINATION",
"title_romaji": "ARIA The ORIGINATION",
"tokenthumb": "cgpQQi0dgnXeugZZQXMPosIlznU"
},
{
"filename": "[Ohys-Raws] ID Invaded - 08 (BS11 1280x720 x264 AAC).mp4",
"episode": 8,
"from": 820.42,
"to": 823.5,
"similarity": 0.8264555913161169,
"anilist_id": 110350,
"anime": "ID: INVADED",
"at": 821.96,
"is_adult": false,
"mal_id": 40046,
"season": "",
"synonyms": [
"异度侵入 ID:INVADED"
],
"synonyms_chinese": [],
"title": "イド:インヴェイデッド",
"title_chinese": "ID: INVADED",
"title_english": "ID: INVADED",
"title_native": "イド:インヴェイデッド",
"title_romaji": "ID: INVADED",
"tokenthumb": "cro2tedGKGJbgE6kxS89SM4p4c"
}
]
}

The Telegram-Bot result:

Selection_069

Telegram-bot gives the only correct answer, the result given by api is completely wrong.

Any plan to include non seasonal TV anime?

Examples of anime content that appears to be not indexed into the project's database now:

  • Anime promotional materials that are not part of full seasonal anime:
    Examples: Madoka Magica Concept Movie, Prism Nana Pilot PV, Kemono Friends JRA/Nissin collaboration PV
  • Short/Flash/Doujin/Unofficial/Official online(niconico/youtube)/blu-ray special/other release channel animation content
    Examples: Touhou Musou Kakyou, "Haruhi-chan", "Index-tan", Flash anime version of "Nyaruko", "Kosys", Kataribe Shoujo Honoma
  • Music Video in form of and other form of anime produced not independently
    Examples: Music Video of Love Live and 22/7 and such, Yuuki Yuuna Pachislot special footage, Kemono Friends Animelo Summer Live 2017 Special Movie
  • Non-Japanese anime
    Some animation products from Korea or China are also commonly described as anime despite the accuracy of such description would be up for debate.

whatanime.ga (lastest version)- Cross-Site Scripting (XSS)

Product:whatanime.ga
Download: https://github.com/soruly/whatanime.ga
Vunlerable Version: lastest version and probably prior
Tested Version: lastest version
Author: ADLab of Venustech

Advisory Details:
I have discovered a Cross-Site Scripting (XSS) in “whatanime.ga”, which can be exploited to execute arbitrary code.
The vulnerability exists due to insufficient filtration of user-supplied data in “url” HTTP GET parameter passed to “whatanime.ga-master/index.php” url. An attacker could execute arbitrary HTML and script code in browser in context of the vulnerable website.
The exploitation example below uses the "alert()" JavaScript function to see a pop-up messagebox:
Poc:
http://localhost/.../whatanime.ga-master/index.php?url=%22%3E%3Cscript%3Ealert(1);%3C/script%3E%3C%22

HTTP 500 when using search api

Hi, I use the api to get some useful information for my images.
A few chance, I got the error.

POST https://trace.moe/api/search
ResponseError (Code 500 - "Error reading image from URL: http://192.168.2.11/pic/1556121770.7361.jpg: null"):

Want to know how did it happen or how can I detect my images to find out problem images.


The image I post
1385230255035

Old API ignores parameters in image url

URL and image:
https%3A%2F%2Fsun9-48.userapi.com%2Fimpc%2Fc536236%2Fu260636618%2Fd36%2F-3%2Fx_59e97016fe.jpg%3Fsize%3D192x108%26quality%3D90%26sign%3D651591e6e50f749a592d208dd172f9f6%26c_uniq_tag%3DaywHZuVfPT7F_ti_slrZyBT_RruSO68K2_52ZMtvZRs
image

api.trace.moe works fine (but finds the wrong anime):
image

But trace.moe/api/search throws error:
image

Bilibili Support

as included in the title, Bilibili is a Chinese website which does the same things as MyAnimeList & AniList

https://bilibili.com

I would appreciate that if you implement the support for Bilibili :)

Sincerely,
Allen

Like Shazam

it is possible to create an audio database of the anime, to be able to perform anime searches not only for the images, but for the audio, in the same way that shazam finds music

Dockerfile

It would be nice to have Dockerfile in project

API for search

Hey, I intend to write some code that may occasionally try to query whatanime.ga with images as a functionality for Roboragi.

The intent is to have a the script respond to manual queries by users through whatanime.ga results for the source image. Is there an API that I can use to achieve this?

Older Anime and recognition suggestions

I was putting in an image earlier that I knew what show it was from, a screenshot from Maison Ikkoku (1986), I was just looking for the timestamp. trace.moe doesn't seem to be as accurate the further back you go, but it got the search incorrect, which made me wonder if it might help that if it gets it wrong, you can let it know or say what show it's supposed to be from if you know, just a suggestion

Keeping the name of the service

Hi @soruly! I was wondering if you intend to keep the name of the service, I think it would be important for discoverability. I've seen the service is being referred to in multiple ways, but users seem to prefer calling it WhatAnime, and it also happens to be an awesome name for the product. Would you be open to converge under the WhatAnime name?

I've seen you changed domains recently, but it would be nice to still have a canonical name for referring to your service, and WhatAnime has the advantage of years of public awareness.

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.