Skip to content

Commit

Permalink
Init commit
Browse files Browse the repository at this point in the history
  • Loading branch information
soruly committed May 27, 2016
0 parents commit 7ecc3d8
Show file tree
Hide file tree
Showing 393 changed files with 41,553 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
@@ -0,0 +1 @@
/config.php
9 changes: 9 additions & 0 deletions README.md
@@ -0,0 +1,9 @@
# whatanime.ga
The website of whatanime.ga

# Others
[Shell Script for analyzing video for LireSolr](https://gist.github.com/soruly/032613e350cdbbe7b0dbe4a7f60bbefd)

[Modified LireSolr search handler](https://gist.github.com/soruly/6d162ac7cc807e3ceb98)

[Shell Script for checking video format](https://gist.github.com/soruly/1f8ec6f0a8772dfb59e49389bdde991f)
111 changes: 111 additions & 0 deletions about.php
@@ -0,0 +1,111 @@
<?php
ini_set("display_errors", 0);
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, "http://192.168.2.11:8983/solr/anime_cl/admin/luke?wt=json");
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
$res = curl_exec($curl);
$result = json_decode($res);
curl_close($curl);
$lastModified = date_timestamp_get(date_create($result->index->lastModified));

function humanTiming($time){
$time = time() - $time; // to get the time since that moment
$time = ($time<1)? 1 : $time;
$tokens = array (
31536000 => 'year',
2592000 => 'month',
604800 => 'week',
86400 => 'day',
3600 => 'hour',
60 => 'minute',
1 => 'second'
);
foreach ($tokens as $unit => $text) {
if ($time < $unit) continue;
$numberOfUnits = floor($time / $unit);
return $numberOfUnits.' '.$text.(($numberOfUnits>1)?'s':'');
}
}
$numDocs = $result->index->numDocs;
$numDocsMillion = floor($numDocs / 1000000);

$vmTouchFile = file_get_contents('./vmtouch.log');
$vmTouch = explode(" ",explode("\n", $vmTouchFile)[2]);
?><!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>WAIT: What Anime Is This? - About</title>
<link rel="icon" type="image/png" href="/favicon.png">
<link rel="icon" type="image/png" href="/favicon128.png" sizes="128x128">
<link href="/css/bootstrap.min.css" rel="stylesheet">
<link href="/style.css" rel="stylesheet">
<script src="/analytics.js" defer></script>
</head>
<body>
<div class="container">
<div class="page-header">
<h1>About</h1>
</div>
<img src="/favicon128.png" alt="" style="display:none" />
<p>Life is too short to answer all the "What is the anime?" questions. Let computers do that for you.</p>
<p>
whatanime.ga is a test-of-concept prototype search engine that helps users trace back the original anime by screenshot.
It searches over 15600 hours of anime and find the best matching scene.
It tells you what anime it is, from which episode and the time that scene appears.
Since the search result may not be accurate, it provides a few seconds of preview for verification.
</p>
<p>
There has been a lot of anime screencaps and GIFs spreading around the internet, but very few of them mention the source. While those online platforms are gaining popularity, whatanime.ga respects the original producers and staffs by showing interested anime fans what the original source is. This search engine encourages users to give credits to the original creater / owner before they share stuff online.
</p>
<p>
This website is non-profit making. There is no pro/premium features at all.
This website is not intended for watching anime. The server has effective measures to forbid users to access the original video beyond the preview limit. I would like to redirect users to somewhere they can watch that anime legally, if possible.
</p>
<p>
Most Anime since 2000 are indexed, but some are excluded (see FAQ).
No Doujin work, no derived art work are indexed. The system only analyzes officially published anime.
If you wish to search artwork / wallpapers, try to use <a href="https://saucenao.com/" target="_blank">SauceNAO</a> and <a href="https://iqdb.org/" target="_blank">iqdb.org</a>
</p>
<p>Now you can use the <a href="https://chrome.google.com/webstore/detail/search-anime-by-screensho/gkamnldpllcbiidlfacaccdoadedncfp" target="_blank">Chrome Extension</a> to search.</p>
<p>&nbsp;</p>
<p>This database automatically index new airing anime in about 24 hours after broadcast. </p>
<p><?php echo 'Last Database Index update: '.humanTiming($lastModified).' ago with '.$numDocsMillion.' Million analyzed frames.<br>'; ?></p>
<p><?php if($vmTouch) echo $vmTouch[6]."B (".$vmTouch[8].") index is cached in RAM, the rest are in SSD."; ?></p>
<p>&nbsp;</p>
<p>If you have any feedback, suggestions or anything else, you may contact <a href="mailto:help@whatanime.ga">help@whatanime.ga</a>.</p>
<p>Follow the development of whatanime.ga and learn more about the underlying technologies at the <a href="https://plus.google.com/communities/115025102250573417080" target="_blank">Official Google+ Community</a> or <a href="https://www.facebook.com/whatanime.ga/" target="_blank">Official Facebook Page</a>.</p>

<div class="page-header">
<h3>Credit</h3>
</div>
<p>
Dr. Mathias Lux (LIRE Project)<br>
<a href="http://www.lire-project.net/" target="_blank">http://www.lire-project.net/</a><br>
Lux Mathias, Savvas A. Chatzichristofis. Lire: Lucene Image Retrieval – An Extensible Java CBIR Library. In proceedings of the 16th ACM International Conference on Multimedia, pp. 1085-1088, Vancouver, Canada, 2008<br>
<a href="http://www.morganclaypool.com/doi/abs/10.2200/S00468ED1V01Y201301ICR025" target="_blank">Visual Information Retrieval with Java and LIRE</a><br>
<br>
ANILIST<br>
Josh (Anilist developer) and Anilist administration team<br>
<a href="https://anilist.co/" target="_blank">https://anilist.co/</a><br>
<br>
And of cause, contributions and support from all anime lovers!<br>
<br>
</p>

</div>
<footer class="footer">
<div class="container">
<ol class="breadcrumb">
<li><a href="/">Home</a></li>
<li><a href="/about">About</a></li>
<li><a href="/changelog">Changelog</a></li>
<li><a href="/faq">FAQ</a></li>
<li><a href="/terms" class="active">Terms</a></li>
</ol>
</div>
</footer>
</body>
</html>
6 changes: 6 additions & 0 deletions analytics.js
@@ -0,0 +1,6 @@
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-70950149-1', 'auto');
ga('send', 'pageview');
Binary file added blank.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added blank.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added bright-squares.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
108 changes: 108 additions & 0 deletions changelog.php
@@ -0,0 +1,108 @@
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>WAIT: What Anime Is This? - Changelog</title>
<link rel="icon" type="image/png" href="/favicon.png">
<link rel="icon" type="image/png" href="/favicon128.png" sizes="128x128">
<link href="/css/bootstrap.min.css" rel="stylesheet">
<link href="/style.css" rel="stylesheet">
<script src="/analytics.js" defer></script>
</head>
<body>
<div class="container">
<div class="page-header"><h1>Changelog</h1></div>

<h3>Fixed some bugs in URL loading</h3>
<h6>6 May 2016</h6>
<p>In case the image cannot be loaded, upload the image from file or copy image itself (not URL) then Ctrl+V</p>

<h3>Speed up image load from URL</h3>
<h6>23 Apr 2016</h6>
<p>Images load from URL would be compressed. This would speed up loading GIF and large images from URL.</p>

<h3>Performance Tweaks</h3>
<h6>18 Apr 2016</h6>
<p>Server will now cache some search results. Search results would be cached for 5-30 minutes. The better the search results, the longer the results would be cached.</p>

<h3>Updated Chrome Extension</h3>
<h6>8 Apr 2016</h6>
<p>Once the image completes loading, it would search automatically. You can change the setting in Chrome Extension. Also see how you can search in Firefox in <a href="/faq">FAQ</a>.</p>

<h3>Added index cache status</h3>
<h6>7 Apr 2016</h6>
<p>You can now see how much data is cached in RAM from About page. The higher the percentage faster the search. It usually stays around 33% due to limited RAM.</p>

<h3>Incorrect timestamp issue identified</h3>
<h6>6 Apr 2016</h6>
<p>There has been some incorrect timestamp in search results due to image analyze scripts parsing outputs of ffmpeg incorrectly. The script has been updated now. From now on new animes should have a correct timestamp, while it would take at about two months to fix already indexed animes. The new script is also 33% faster when indexing anime.</p>

<h3>Fixes some image editing issue</h3>
<h6>10 Mar 2016</h6>
<p>Image would sometimes gone black when clicking fit / flip button. Now fixed.</p>

<h3>Added Fit Width / Height option</h3>
<h6>6 Mar 2016</h6>
<p>You can now choose to Fit Width / Height for your search image. Also fixed some flickering issue on previews.</p>

<h3>Fixed some Image URL issue</h3>
<h6>3 Mar 2016</h6>
<p>Fixed some cross-site image URL linking issue. Most image URL should load now.</p>

<h3>New Anime Info Panel UI</h3>
<h6>1 Mar 2016</h6>
<p>A better layout for more Anime information.</p>
<h3>Added Image URL Option</h3>
<h6>1 Mar 2016</h6>
<p>You can now search by Image URL</p>
<h3>Added Safe Search Option</h3>
<h6>28 Feb 2016</h6>
<p>The Safe Search Option can hide most Hentai Anime from search result. But you should aware that some regular season Animes can still be obscene. (NSFW)</p>
<h3>Try the Chrome Extension</h3>
<h6>28 Feb 2016</h6>
<p>Now you can use the <a href="https://chrome.google.com/webstore/detail/search-anime-by-screensho/gkamnldpllcbiidlfacaccdoadedncfp" target="_blank">Chrome Extension</a> to search.</p>
<h3>Added some Heitai Anime</h3>
<h6>28 Feb 2016</h6>
<p>About 168 Heitai Anime series has been added.</p>
<h3>Added sample screenshot in FAQ</h3>
<h6>28 Feb 2016</h6>
<p>To help users to understand how the search engine works, we have added some good and bad screenshots in <a href="/faq">FAQ</a>.</p>
<h3>Performance Improvement</h3>
<h6>21 Feb 2016</h6>
<p>Improved caching method to warmup cold data.</p>
<h3>More fixes</h3>
<h6>20 Feb 2016</h6>
<p>Database has been cleaned up and reloaded. This should fix most video previews. Fixed some anime titles still being null.</p>
<h3>Bug Fix</h3>
<h6>17 Feb 2016</h6>
<p>Fixed the empty search result. The issue has been resolved. A large number of files has been relocated, video preview may be missing for some search results.</p>
<h3>Improved Performance</h3>
<h6>01 Jan 2016</h6>
<p>Increased cache size to improve performance when the server has been idle for a long time.</p>
<h3>Added a Flip Button</h3>
<h6>31 Dec 2015</h6>
<p>You may now flip the image before searching. If you can't find a match, try to flip your image and search again. (Especially useful for AMV)</p>
<h3>Search Algorithm Changed</h3>
<h6>21 Dec 2015</h6>
<p>Switched to use a new searching algorithm. The search is slower but more accurate.</p>
<h3>Public Beta</h3>
<h6>19 Dec 2015</h6>
<p>Adding some informative pages.</p>
<p>&nbsp;</p>
</div>

<footer class="footer">
<div class="container">
<ol class="breadcrumb">
<li><a href="/">Home</a></li>
<li><a href="/about">About</a></li>
<li><a href="/changelog">Changelog</a></li>
<li><a href="/faq">FAQ</a></li>
<li><a href="/terms" class="active">Terms</a></li>
</ol>
</div>
</footer>
</body>
</html>
6 changes: 6 additions & 0 deletions composer.json
@@ -0,0 +1,6 @@
{
"require": {
"predis/predis": "^1.0",
"google/recaptcha": "~1.1"
}
}
114 changes: 114 additions & 0 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions config.sample.php
@@ -0,0 +1,9 @@
<?php
//Google reCAPTCHA
$siteKey = '';
$secret = '';

//salt for nginx secure link
$secretSalt = '';

?>

0 comments on commit 7ecc3d8

Please sign in to comment.