mirror of
https://github.com/NoCrypt/migu.git
synced 2026-04-21 00:22:08 +00:00
fix: noauth, anilist login
This commit is contained in:
parent
29059d1caa
commit
00cb3deca0
3 changed files with 12 additions and 9 deletions
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "Miru",
|
"name": "Miru",
|
||||||
"version": "3.5.2",
|
"version": "3.5.3",
|
||||||
"author": "ThaUnknown_ <ThaUnknown@users.noreply.github.com>",
|
"author": "ThaUnknown_ <ThaUnknown@users.noreply.github.com>",
|
||||||
"description": "Stream anime torrents, real-time with no waiting for downloads.",
|
"description": "Stream anime torrents, real-time with no waiting for downloads.",
|
||||||
"main": "src/index.js",
|
"main": "src/index.js",
|
||||||
|
|
|
||||||
|
|
@ -100,6 +100,7 @@
|
||||||
newSeasons: {
|
newSeasons: {
|
||||||
title: 'Sequels You Missed',
|
title: 'Sequels You Missed',
|
||||||
data: (async () => {
|
data: (async () => {
|
||||||
|
if (!alToken) return
|
||||||
const { data } = await alRequest({ method: 'NewSeasons' })
|
const { data } = await alRequest({ method: 'NewSeasons' })
|
||||||
const res = data.MediaListCollection.lists[0]
|
const res = data.MediaListCollection.lists[0]
|
||||||
return res?.entries?.flatMap(({ media }) => {
|
return res?.entries?.flatMap(({ media }) => {
|
||||||
|
|
|
||||||
|
|
@ -92,14 +92,16 @@ const handleRequest = limiter.wrap(async opts => {
|
||||||
return json
|
return json
|
||||||
})
|
})
|
||||||
|
|
||||||
export let alID = !!alToken
|
export let alID = null
|
||||||
alID = alRequest({ method: 'Viewer', token: alToken }).then(result => {
|
if (alToken) {
|
||||||
const lists = result?.data?.Viewer?.mediaListOptions?.animeList?.customLists || []
|
alID = alRequest({ method: 'Viewer', token: alToken }).then(result => {
|
||||||
if (!lists.includes('Watched using Miru')) {
|
const lists = result?.data?.Viewer?.mediaListOptions?.animeList?.customLists || []
|
||||||
alRequest({ method: 'CustomList', lists })
|
if (!lists.includes('Watched using Miru')) {
|
||||||
}
|
alRequest({ method: 'CustomList', lists })
|
||||||
return result
|
}
|
||||||
})
|
return result
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
function printError (error) {
|
function printError (error) {
|
||||||
console.warn(error)
|
console.warn(error)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue