forked from MALSync/MALSync
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request MALSync#1323 from MALSync/voidscans
add voidscans
- Loading branch information
Showing
7 changed files
with
165 additions
and
92 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,104 +1,113 @@ | ||
import { pageInterface } from '../pageInterface'; | ||
|
||
export const AsuraScans: pageInterface = { | ||
name: 'AsuraScans', | ||
domain: ['https://asura.gg', 'https://asurascans.com'], | ||
languages: ['English'], | ||
type: 'manga', | ||
isSyncPage(url) { | ||
if (j.$('#readerarea').length) { | ||
return true; | ||
} | ||
return false; | ||
}, | ||
isOverviewPage(url) { | ||
return j.$('div.thumbook').length > 0 && j.$('div.bixbox.animefull').length > 0; | ||
}, | ||
sync: { | ||
getTitle(url) { | ||
return j.$(j.$('div#content.readercontent div.ts-breadcrumb.bixbox span')[1]).text().trim(); | ||
}, | ||
getIdentifier(url) { | ||
return AsuraScans.overview!.getIdentifier(AsuraScans.sync.getOverviewUrl(url)); | ||
export const AsuraScans: pageInterface = getInter(); | ||
|
||
export function getInter(): pageInterface { | ||
let thisSelf; | ||
/* eslint-disable-next-line prefer-const */ | ||
thisSelf = { | ||
name: 'AsuraScans', | ||
domain: ['https://asura.gg', 'https://asurascans.com'], | ||
languages: ['English'], | ||
type: 'manga', | ||
isSyncPage(url) { | ||
if (j.$('#readerarea').length) { | ||
return true; | ||
} | ||
return false; | ||
}, | ||
getOverviewUrl(url) { | ||
return j.$(j.$('div#content.readercontent div.ts-breadcrumb.bixbox a')[1]).attr('href') || ''; | ||
isOverviewPage(url) { | ||
return j.$('div.thumbook').length > 0 && j.$('div.bixbox.animefull').length > 0; | ||
}, | ||
getEpisode(url) { | ||
const episodePart = j.$('#chapter > option:selected').text(); | ||
sync: { | ||
getTitle(url) { | ||
return j.$(j.$('div#content.readercontent div.ts-breadcrumb.bixbox span')[1]).text().trim(); | ||
}, | ||
getIdentifier(url) { | ||
return AsuraScans.overview!.getIdentifier(AsuraScans.sync.getOverviewUrl(url)); | ||
}, | ||
getOverviewUrl(url) { | ||
return ( | ||
j.$(j.$('div#content.readercontent div.ts-breadcrumb.bixbox a')[1]).attr('href') || '' | ||
); | ||
}, | ||
getEpisode(url) { | ||
const episodePart = j.$('#chapter > option:selected').text(); | ||
|
||
const temp = episodePart.match(/cha?p?t?e?r?\s*(\d+)/i); | ||
const temp = episodePart.match(/cha?p?t?e?r?\s*(\d+)/i); | ||
|
||
if (!temp || temp.length < 2) return 1; | ||
if (!temp || temp.length < 2) return 1; | ||
|
||
return Number(temp[1]); | ||
}, | ||
nextEpUrl(url) { | ||
const next = j.$('a.ch-next-btn').attr('href'); | ||
return Number(temp[1]); | ||
}, | ||
nextEpUrl(url) { | ||
const next = j.$('a.ch-next-btn').attr('href'); | ||
|
||
if (next === '#/next/') return undefined; | ||
if (next === '#/next/') return undefined; | ||
|
||
return next; | ||
}, | ||
}, | ||
overview: { | ||
getTitle(url) { | ||
return j.$('h1.entry-title').text().trim(); | ||
}, | ||
getIdentifier(url) { | ||
return utils.urlPart(url, 4).replace(/^\d+-/gi, ''); | ||
}, | ||
uiSelector(selector) { | ||
j.$('div.bixbox.animefull') | ||
.first() | ||
.after(j.html(`<div id= "malthing" class="bixbox animefull">${selector}</div>`)); | ||
return next; | ||
}, | ||
}, | ||
list: { | ||
offsetHandler: false, | ||
elementsSelector() { | ||
return j.$('div#chapterlist li div.chbox'); | ||
overview: { | ||
getTitle(url) { | ||
return j.$('h1.entry-title').text().trim(); | ||
}, | ||
getIdentifier(url) { | ||
return utils.urlPart(url, 4).replace(/^\d+-/gi, ''); | ||
}, | ||
elementUrl(selector) { | ||
return selector.find('a').first().attr('href') || ''; | ||
uiSelector(selector) { | ||
j.$('div.bixbox.animefull') | ||
.first() | ||
.after(j.html(`<div id= "malthing" class="bixbox animefull">${selector}</div>`)); | ||
}, | ||
elementEp(selector) { | ||
const elementEpN = selector.find('span').first().text(); | ||
list: { | ||
offsetHandler: false, | ||
elementsSelector() { | ||
return j.$('div#chapterlist li div.chbox'); | ||
}, | ||
elementUrl(selector) { | ||
return selector.find('a').first().attr('href') || ''; | ||
}, | ||
elementEp(selector) { | ||
const elementEpN = selector.find('span').first().text(); | ||
|
||
const temp = elementEpN.match(/chapter \d+/gim); | ||
const temp = elementEpN.match(/chapter \d+/gim); | ||
|
||
if (!temp || temp.length === 0) return 0; | ||
if (!temp || temp.length === 0) return 0; | ||
|
||
return Number(temp[0].replace(/\D+/g, '')); | ||
return Number(temp[0].replace(/\D+/g, '')); | ||
}, | ||
}, | ||
}, | ||
}, | ||
init(page) { | ||
api.storage.addStyle( | ||
require('!to-string-loader!css-loader!less-loader!./style.less').toString(), | ||
); | ||
j.$(document).ready(function () { | ||
if (document.title.includes('Page not found')) { | ||
con.error('404'); | ||
return; | ||
} | ||
init(page) { | ||
api.storage.addStyle( | ||
require('!to-string-loader!css-loader!less-loader!./style.less').toString(), | ||
); | ||
j.$(document).ready(function () { | ||
if (document.title.includes('Page not found')) { | ||
con.error('404'); | ||
return; | ||
} | ||
|
||
if (AsuraScans.isSyncPage(window.location.href)) { | ||
utils.waitUntilTrue( | ||
function () { | ||
if ( | ||
j.$('#chapter > option:selected').length && | ||
j.$('#chapter > option:selected').text() !== 'Select Chapter' | ||
) | ||
return true; | ||
return false; | ||
}, | ||
function () { | ||
page.handlePage(); | ||
}, | ||
); | ||
} else { | ||
page.handlePage(); | ||
} | ||
}); | ||
}, | ||
}; | ||
if (AsuraScans.isSyncPage(window.location.href)) { | ||
utils.waitUntilTrue( | ||
function () { | ||
if ( | ||
j.$('#chapter > option:selected').length && | ||
j.$('#chapter > option:selected').text() !== 'Select Chapter' | ||
) | ||
return true; | ||
return false; | ||
}, | ||
function () { | ||
page.handlePage(); | ||
}, | ||
); | ||
} else { | ||
page.handlePage(); | ||
} | ||
}); | ||
}, | ||
}; | ||
return thisSelf; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import { pageInterface } from '../pageInterface'; | ||
import { getInter } from '../AsuraScans/main'; | ||
|
||
const clone = getInter(); | ||
|
||
clone.name = 'VoidScans'; | ||
clone.domain = 'https://void-scans.com'; | ||
|
||
export const VoidScans: pageInterface = clone; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"search": "https://void-scans.com/?s={searchtermPlus}", | ||
"urls": { | ||
"match": ["*://void-scans.com/*"] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
@import './../pages'; | ||
|
||
@textColor: #b8b8b8; | ||
@inputBackground: #222; | ||
|
||
#malthing { | ||
padding: 10px 15px; | ||
} | ||
|
||
#malp { | ||
span span.info { | ||
color: #d9d9d9 !important; | ||
} | ||
|
||
margin: 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
{ | ||
"title": "VoidScans", | ||
"url": "https://void-scans.com", | ||
"testCases": [ | ||
{ | ||
"url": "https://void-scans.com/leveling-up-by-only-eating-chapter-101-chosen/", | ||
"expected": { | ||
"sync": true, | ||
"title": "Leveling Up, by Only Eating!", | ||
"identifier": "leveling-up-by-only-eating", | ||
"overviewUrl": "https://void-scans.com/manga/leveling-up-by-only-eating/", | ||
"nextEpUrl": "https://void-scans.com/leveling-up-by-only-eating-chapter-102-pope/", | ||
"episode": 101, | ||
"uiSelector": false | ||
} | ||
}, | ||
{ | ||
"url": "https://void-scans.com/manga/leveling-up-by-only-eating/", | ||
"expected": { | ||
"sync": false, | ||
"title": "Leveling Up, by Only Eating!", | ||
"identifier": "leveling-up-by-only-eating", | ||
"uiSelector": true, | ||
"epList": { | ||
"108": "https://void-scans.com/leveling-up-by-only-eating-chapter-108-punk/", | ||
"1": "https://void-scans.com/leveling-up-by-only-eating-chapter-1-ginseng/" | ||
} | ||
} | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters