latest releases improvements

This commit is contained in:
ThaUnknown 2020-09-24 21:59:26 +02:00
parent 9f8460012f
commit 58e4207671
3 changed files with 40 additions and 17 deletions

View file

@ -364,4 +364,11 @@ async function hsRss(url) {
document.querySelector("#refRel").onclick = function () {
hsRss(`https://miru.kirdow.com/request/?url=http://www.horriblesubs.info/rss.php?res=${settings.torrent1}`)
}
searchAnime()
setInterval(() => {
hsRss(`https://miru.kirdow.com/request/?url=http://www.horriblesubs.info/rss.php?res=${settings.torrent1}`)
}, 30000);
async function loadAnime() {
await searchAnime()
hsRss(`https://miru.kirdow.com/request/?url=http://www.horriblesubs.info/rss.php?res=${settings.torrent1}`)
}
loadAnime()

View file

@ -90,15 +90,15 @@ self.addEventListener('fetch', evt => {
)
})
self.addEventListener('fetch', (evt) => {
if (evt.request.mode !== 'navigate') {
return;
}
evt.respondWith(
fetch(evt.request)
.catch(async () => {
const cache = await caches.open(CACHE_NAME);
return cache.match('offline.html');
})
);
});
// self.addEventListener('fetch', (evt) => {
// if (evt.request.mode !== 'navigate') {
// return;
// }
// evt.respondWith(
// fetch(evt.request)
// .catch(async () => {
// const cache = await caches.open(CACHE_NAME);
// return cache.match('offline.html');
// })
// );
// });

View file

@ -1,6 +1,6 @@
<?php
$url = str_replace("$", "&", $_GET['url']);
$query = explode("&q=", $url) [1];
$query = explode("?", $url) [1];
if (strpos($query, '/') === false)
{
$cache_file = './cache/' . $query;
@ -27,9 +27,25 @@ if (strpos($query, '/') === false)
echo $file;
}
}elseif(substr($url, 0, 41) === "http://www.horriblesubs.info/rss.php?res="){
$file = file_get_contents(str_replace(" ", "+", $url));
header('Content-Type: text/xml');
echo $file;
if (file_exists($cache_file) && (filemtime($cache_file) > (time() - 60 * 0.5)))
{
// Cache file is less than five minutes old.
// Don't bother refreshing, just use the file as-is.
$file = file_get_contents($cache_file);
header('Content-Type: text/xml');
//echo 'case fucking 1';
echo $file;
}
else
{
// Our cache is out-of-date, so load the data from our remote server,
// and also save it over our cache for next time.
$file = file_get_contents(str_replace(" ", "+", $url));
file_put_contents($cache_file, $file, LOCK_EX);
header('Content-Type: text/xml');
// echo 'case fucking 2';
echo $file;
}
}
}
?>