mirror of
https://github.com/NoCrypt/migu.git
synced 2026-04-20 08:02:12 +00:00
fix: w2g and anime redirects
This commit is contained in:
parent
e09053bb27
commit
1a309d74f9
6 changed files with 49 additions and 6 deletions
15
functions/anime/[id].js
Normal file
15
functions/anime/[id].js
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
/** @type {PagesFunction} */
|
||||
export function onRequest ({ params }) {
|
||||
try {
|
||||
const id = params.id
|
||||
const html = /* html */`<!DOCTYPE html><html style=background:#000><head><meta http-equiv=refresh content="5; url=https://miru.watch"><meta property="og:title" content="Watch Together"><meta property="og:description" content="Stream anime torrents, real-time with no waiting for downloads"><meta property="og:site_name" content="Miru"><meta property="og:image" content=https://github.com/ThaUnknown/miru/blob/master/docs/show.gif?raw=true><meta property="og:url" content=miru://anime/${id}><meta data-vmid="twitter:card" name="twitter:card" content="summary_large_image"><meta name="theme-color" content="#23a559"></head><body><iframe src=miru://w2g/${id} style=border:none></iframe>Redirecting...</body></html>`
|
||||
|
||||
return new Response(html, {
|
||||
headers: {
|
||||
'content-type': 'text/html;charset=UTF-8'
|
||||
}
|
||||
})
|
||||
} catch (e) {
|
||||
return Response.redirect('https://miru.watch/')
|
||||
}
|
||||
}
|
||||
18
functions/w2g/[id].js
Normal file
18
functions/w2g/[id].js
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
/** @type {PagesFunction} */
|
||||
export function onRequest ({ params }) {
|
||||
try {
|
||||
const id = Number(params.id)
|
||||
if (Number.isSafeInteger(id)) {
|
||||
const html = /* html */`<!DOCTYPE html><html style=background:#000><head><meta http-equiv=refresh content="5; url=https://miru.watch"><meta property="og:title" content="Watch Together"><meta property="og:description" content="Stream anime torrents, real-time with no waiting for downloads"><meta property="og:site_name" content="Miru"><meta property="og:image" content=https://github.com/ThaUnknown/miru/blob/master/docs/show.gif?raw=true><meta property="og:url" content=miru://w2g/${id}><meta data-vmid="twitter:card" name="twitter:card" content="summary_large_image"><meta name="theme-color" content="#23a559"></head><body><iframe src=miru://w2g/${id} style=border:none></iframe>Redirecting...</body></html>`
|
||||
|
||||
return new Response(html, {
|
||||
headers: {
|
||||
'content-type': 'text/html;charset=UTF-8'
|
||||
}
|
||||
})
|
||||
}
|
||||
} catch (e) {
|
||||
return Response.redirect('https://miru.watch/')
|
||||
}
|
||||
return Response.redirect('https://miru.watch/')
|
||||
}
|
||||
|
|
@ -7,7 +7,8 @@
|
|||
"allowSyntheticDefaultImports": true,
|
||||
"paths": {
|
||||
"@/*": ["./common/*"],
|
||||
}
|
||||
},
|
||||
"types": ["@cloudflare/workers-types"],
|
||||
},
|
||||
"exclude": ["node_modules", "dist", "build", "git_modules", "**/node_modules", "**/dist", "**/build", "**/git_modules",]
|
||||
}
|
||||
|
|
@ -33,6 +33,7 @@
|
|||
"webtorrent": "^2.1.29"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@cloudflare/workers-types": "^4.20231121.0",
|
||||
"npm-run-all": "^4.1.5"
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -54,6 +54,9 @@ importers:
|
|||
specifier: ^2.1.29
|
||||
version: 2.1.29
|
||||
devDependencies:
|
||||
'@cloudflare/workers-types':
|
||||
specifier: ^4.20231121.0
|
||||
version: 4.20231121.0
|
||||
npm-run-all:
|
||||
specifier: ^4.1.5
|
||||
version: 4.1.5
|
||||
|
|
@ -83,7 +86,7 @@ importers:
|
|||
version: 5.0.6(@capacitor/core@5.5.1)
|
||||
capacitor-nodejs:
|
||||
specifier: https://github.com/funniray/Capacitor-NodeJS/releases/download/nodejs-18/capacitor-nodejs-1.0.0-beta.6.tgz
|
||||
version: '@github.com/hampoelz/capacitor-nodejs/releases/download/v1.0.0-beta.6/capacitor-nodejs.tgz(@capacitor/core@5.5.1)'
|
||||
version: '@github.com/funniray/Capacitor-NodeJS/releases/download/nodejs-18/capacitor-nodejs-1.0.0-beta.6.tgz(@capacitor/core@5.5.1)'
|
||||
capacitor-plugin-safe-area:
|
||||
specifier: ^2.0.5
|
||||
version: 2.0.5(@capacitor/core@5.5.1)
|
||||
|
|
@ -403,6 +406,10 @@ packages:
|
|||
'@capacitor/core': 5.5.1
|
||||
dev: false
|
||||
|
||||
/@cloudflare/workers-types@4.20231121.0:
|
||||
resolution: {integrity: sha512-+kWfpCkqiepwAKXyHoE0gnkPgkLhz0/9HOBIGhHRsUvUKvhUtm3mbqqoGRWgF1qcjzrDUBbrrOq4MYHfFtc2RA==}
|
||||
dev: true
|
||||
|
||||
/@cspotcode/source-map-support@0.8.1:
|
||||
resolution: {integrity: sha512-IchNf6dN4tHoMFIn/7OE8LWZ19Y6q/67Bmf6vnGREv8RSbBVb9LPJxEcnwrcwX6ixSvaiGoomAUvu4YSxXrVgw==}
|
||||
engines: {node: '>=12'}
|
||||
|
|
@ -9266,9 +9273,9 @@ packages:
|
|||
engines: {node: '>=10'}
|
||||
dev: false
|
||||
|
||||
'@github.com/hampoelz/capacitor-nodejs/releases/download/v1.0.0-beta.6/capacitor-nodejs.tgz(@capacitor/core@5.5.1)':
|
||||
resolution: {tarball: https://github.com/hampoelz/capacitor-nodejs/releases/download/v1.0.0-beta.6/capacitor-nodejs.tgz}
|
||||
id: '@github.com/hampoelz/capacitor-nodejs/releases/download/v1.0.0-beta.6/capacitor-nodejs.tgz'
|
||||
'@github.com/funniray/Capacitor-NodeJS/releases/download/nodejs-18/capacitor-nodejs-1.0.0-beta.6.tgz(@capacitor/core@5.5.1)':
|
||||
resolution: {tarball: https://github.com/funniray/Capacitor-NodeJS/releases/download/nodejs-18/capacitor-nodejs-1.0.0-beta.6.tgz}
|
||||
id: '@github.com/funniray/Capacitor-NodeJS/releases/download/nodejs-18/capacitor-nodejs-1.0.0-beta.6.tgz'
|
||||
name: capacitor-nodejs
|
||||
version: 1.0.0-beta.6
|
||||
peerDependencies:
|
||||
|
|
|
|||
|
|
@ -7,7 +7,8 @@
|
|||
"allowSyntheticDefaultImports": true,
|
||||
"paths": {
|
||||
"@/*": ["./common/*"],
|
||||
}
|
||||
},
|
||||
"types": ["@cloudflare/workers-types"],
|
||||
},
|
||||
"exclude": ["node_modules", "dist", "build", "git_modules", "**/node_modules", "**/dist", "**/build", "**/git_modules",]
|
||||
}
|
||||
Loading…
Reference in a new issue