mirror of
https://github.com/venera-app/venera-configs.git
synced 2025-09-27 08:27:24 +00:00
ehentai: fix cookies validation
This commit is contained in:
14
ehentai.js
14
ehentai.js
@@ -81,6 +81,12 @@ class Ehentai extends ComicSource {
|
||||
* @returns {Promise<boolean>}
|
||||
*/
|
||||
validate: async (values) => {
|
||||
if (values.length !== 4) {
|
||||
return false
|
||||
}
|
||||
if (values[0].length === 0 || values[1].length === 0) {
|
||||
return false
|
||||
}
|
||||
let cookies = []
|
||||
for (let i = 0; i < values.length; i++) {
|
||||
cookies.push(new Cookie({
|
||||
@@ -95,12 +101,6 @@ class Ehentai extends ComicSource {
|
||||
}))
|
||||
}
|
||||
Network.setCookies('https://e-hentai.org', cookies)
|
||||
if (cookies.length !== 4) {
|
||||
return false
|
||||
}
|
||||
if (cookies[0].length === 0 || cookies[1].length === 0) {
|
||||
return false
|
||||
}
|
||||
let res = await Network.get(
|
||||
"https://forums.e-hentai.org/",
|
||||
{
|
||||
@@ -1122,4 +1122,4 @@ class Ehentai extends ComicSource {
|
||||
"Language": "語言",
|
||||
},
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user