Skip to content

Commit 293c12c

Browse files
Add implementation for AniKoto page integration (MALSync#3843)
* Add miruro.bz to Miruro domains Register the new official Miruro domain (https://www.miruro.bz) in the Miruro page config. This updates the domain list and the URL match patterns in src/pages-chibi/implementations/Miruro/main.ts and includes a comment noting the source of the new domain. * Add Initial implementation for AniKoto Introduce AniKoto page integration: add implementation (main.ts) with sync, list and lifecycle logic and helper to parse embedded JSON; include styling (style.less) and offline tests (test.json). Register the new page in pages.ts and add a vidcloud player URL mapping (vidwish.live) in playerUrls.js to support the site's video provider. * AniKoto: use URL for id/episode & update UI Extract identifier and episode from the page URL instead of relying on JSON fields: getIdentifier now uses urlPart(4), and getEpisode uses urlPart(6) with a replaceRegex('ep-', '') then number(). Also updated the uiInjection selector from '#player-control' to '#controls' to match the site's DOM changes. These changes make parsing resilient to missing JSON data and adapt to the updated layout. * Use DOM selectors for AniKoto sync Replace reliance on embedded JSON (#syncData) with direct DOM queries to extract title, image, episode list and IDs. Update URL-part indices and episode parsing, build MyAnimeList URL from the active episode's data-mal attribute, and switch selectors from .eplist to #w-episodes/.ep-range with data-num for episode numbers. Simplify lifecycle handling to use detectURLChanges and remove the ChibiGenerator import and the getJsonData helper. * Revert "Add miruro.bz to Miruro domains" This reverts commit 7b25242. * Reapply "Add miruro.bz to Miruro domains" This reverts commit f61aaab. * [TASK] Minor fixes * Revert "Reapply "Add miruro.bz to Miruro domains"" This reverts commit 485f5f6. * [TASK] Revert --------- Co-authored-by: lolamtisch <12599334+lolamtisch@users.noreply.github.com>
1 parent 6f844e7 commit 293c12c

5 files changed

Lines changed: 181 additions & 4 deletions

File tree

Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
import { PageInterface } from '../../pageInterface';
2+
3+
export const anikoto: PageInterface = {
4+
name: 'AniKoto',
5+
domain: 'https://anikoto.cz',
6+
languages: ['English'],
7+
type: 'anime',
8+
urls: {
9+
match: ['*://*.anikoto.cz/*', '*://*.anikototv.to/*'],
10+
player: {
11+
megaplay: ['*://vidwish.live/*', '*://megaplay.buzz/*'],
12+
},
13+
},
14+
search: 'https://anikoto.cz/filter?keyword={searchtermPlus}',
15+
sync: {
16+
isSyncPage($c) {
17+
return $c
18+
.and($c.url().urlPart(3).equals('watch').run(), $c.url().urlPart(5).boolean().run())
19+
.run();
20+
},
21+
getTitle($c) {
22+
return $c.querySelector('h1[itemprop="name"]').text().trim().run();
23+
},
24+
getIdentifier($c) {
25+
return $c.url().urlPart(4).run();
26+
},
27+
getOverviewUrl($c) {
28+
return $c.url().split('/').slice(0, 5).join('/').run();
29+
},
30+
getEpisode($c) {
31+
return $c.querySelector('#w-episodes a.active').getAttribute('data-num').number().run();
32+
},
33+
getImage($c) {
34+
return $c.querySelector('[itemprop="image"]').getAttribute('src').ifNotReturn().run();
35+
},
36+
uiInjection($c) {
37+
return $c.querySelector('h1[itemprop="name"]').uiAfter().run();
38+
},
39+
nextEpUrl($c) {
40+
return $c
41+
.querySelector('#w-episodes .episodes .active')
42+
.parent()
43+
.next()
44+
.ifNotReturn()
45+
.find('a')
46+
.getAttribute('href')
47+
.ifNotReturn()
48+
.urlAbsolute()
49+
.run();
50+
},
51+
getMalUrl($c) {
52+
return $c
53+
.providerUrlUtility({
54+
malId: $c
55+
.querySelector('#w-episodes .episodes .active')
56+
.getAttribute('data-mal')
57+
.number()
58+
.ifNotReturn()
59+
.run(),
60+
})
61+
.run();
62+
},
63+
},
64+
list: {
65+
elementsSelector($c) {
66+
return $c.querySelectorAll('#w-episodes .ep-range a').run();
67+
},
68+
elementUrl($c) {
69+
return $c.getAttribute('href').ifNotReturn().urlAbsolute().run();
70+
},
71+
elementEp($c) {
72+
return $c.getAttribute('data-num').number().run();
73+
},
74+
},
75+
lifecycle: {
76+
setup($c) {
77+
return $c.addStyle(require('./style.less?raw').toString()).run();
78+
},
79+
ready($c) {
80+
return $c.domReady().detectURLChanges($c.trigger().run()).trigger().run();
81+
},
82+
syncIsReady($c) {
83+
return $c
84+
.waitUntilTrue($c.querySelector('#w-episodes .episodes .active').boolean().run())
85+
.trigger()
86+
.run();
87+
},
88+
},
89+
};
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
@import './../pages';
2+
3+
@boxBackground: #142030 !important;
4+
@boxHighlightBackground: #26a3d6 !important;
5+
@boxHighlightFontColor: #ffffff !important;
6+
7+
@activeEp: #002e7459 !important;
8+
9+
#malp {
10+
margin: 0;
11+
min-height: 50px;
12+
margin-bottom: 1rem !important;
13+
.info {
14+
margin: inherit !important;
15+
}
16+
}
Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
{
2+
"title": "AniKoto",
3+
"url": "https://anikoto.cz",
4+
"testCases": [
5+
{
6+
"url": "https://anikoto.cz/watch/one-piece-odmau/ep-5",
7+
"expected": {
8+
"sync": true,
9+
"title": "One Piece",
10+
"identifier": "one-piece-odmau",
11+
"overviewUrl": "https://anikoto.cz/watch/one-piece-odmau",
12+
"nextEpUrl": "https://anikoto.cz/watch/one-piece-odmau/ep-6",
13+
"image": "https://cdn.anipixcdn.co/thumbnail/f899139df5e1059396431415e770c6dd.jpg",
14+
"episode": 5,
15+
"uiSelector": true,
16+
"malUrl": "https://myanimelist.net/anime/21",
17+
"epList": {
18+
"5": "https://anikoto.cz/watch/one-piece-odmau/ep-5"
19+
}
20+
}
21+
},
22+
{
23+
"url": "https://anikoto.cz/watch/one-piece-odmau/ep-1159",
24+
"expected": {
25+
"sync": true,
26+
"title": "One Piece",
27+
"identifier": "one-piece-odmau",
28+
"overviewUrl": "https://anikoto.cz/watch/one-piece-odmau",
29+
"nextEpUrl": "https://anikoto.cz/watch/one-piece-odmau/ep-1160",
30+
"image": "https://cdn.anipixcdn.co/thumbnail/f899139df5e1059396431415e770c6dd.jpg",
31+
"episode": 1159,
32+
"uiSelector": true,
33+
"malUrl": "https://myanimelist.net/anime/21",
34+
"epList": {
35+
"1159": "https://anikoto.cz/watch/one-piece-odmau/ep-1159"
36+
}
37+
}
38+
},
39+
{
40+
"url": "https://anikoto.cz/watch/violet-evergarden-uxbvu/ep-1",
41+
"expected": {
42+
"sync": true,
43+
"title": "Violet Evergarden",
44+
"identifier": "violet-evergarden-uxbvu",
45+
"overviewUrl": "https://anikoto.cz/watch/violet-evergarden-uxbvu",
46+
"nextEpUrl": "https://anikoto.cz/watch/violet-evergarden-uxbvu/ep-2",
47+
"image": "https://cdn.anipixcdn.co/thumbnail/093f65e080a295f8076b1c5722a46aa2.jpg",
48+
"episode": 1,
49+
"uiSelector": true,
50+
"malUrl": "https://myanimelist.net/anime/33352",
51+
"epList": {
52+
"1": "https://anikoto.cz/watch/violet-evergarden-uxbvu/ep-1"
53+
}
54+
}
55+
},
56+
{
57+
"url": "https://anikoto.cz/watch/solo-leveling-ilh08/ep-9",
58+
"expected": {
59+
"sync": true,
60+
"title": "Solo Leveling",
61+
"identifier": "solo-leveling-ilh08",
62+
"overviewUrl": "https://anikoto.cz/watch/solo-leveling-ilh08",
63+
"nextEpUrl": "https://anikoto.cz/watch/solo-leveling-ilh08/ep-10",
64+
"image": "https://cdn.anipixcdn.co/thumbnail/53adb96c287c3931b3bc41cebb003788.png",
65+
"episode": 9,
66+
"uiSelector": true,
67+
"malUrl": "https://myanimelist.net/anime/52299",
68+
"epList": {
69+
"9": "https://anikoto.cz/watch/solo-leveling-ilh08/ep-9"
70+
}
71+
}
72+
}
73+
]
74+
}

src/pages-chibi/pages.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import { PageInterface } from './pageInterface';
22

33
import { animeav1 } from './implementations/animeav1/main';
44
import { anicrush } from './implementations/anicrush/main';
5+
import { anikoto } from './implementations/AniKoto/main';
56
import { mangaNato } from './implementations/mangaNato/main';
67
import { gojo } from './implementations/gojo/main';
78
import { animeLib } from './implementations/animeLib/main';
@@ -110,6 +111,7 @@ import { Tsukuyomi } from './implementations/Tsukuyomi/main';
110111
export const pages: { [key: string]: PageInterface } = {
111112
animeav1,
112113
anicrush,
114+
anikoto,
113115
mangaNato,
114116
gojo,
115117
animeLib,

src/pages/playerUrls.js

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -859,10 +859,6 @@ module.exports = {
859859
animeav1: {
860860
match: ['*://player.zilla-networks.com/*'],
861861
},
862-
// miruro
863-
megaplay: {
864-
match: ['*://megaplay.buzz/*', '*://vidwish.live/*'],
865-
},
866862
// Anizm
867863
anizmplayer: {
868864
match: ['*://*.anizmplayer.com/*'],

0 commit comments

Comments
 (0)