mirror of
https://github.com/kodjodevf/mangayomi-extensions.git
synced 2026-02-15 11:21:11 +00:00
extension(netflixMirror): Use TV domain for cookie
This commit is contained in:
@@ -2,38 +2,37 @@ const mangayomiSources = [{
|
|||||||
"name": "NetflixMirror",
|
"name": "NetflixMirror",
|
||||||
"lang": "all",
|
"lang": "all",
|
||||||
"baseUrl": "https://iosmirror.cc",
|
"baseUrl": "https://iosmirror.cc",
|
||||||
"apiUrl": "",
|
"apiUrl": "https://pcmirror.cc",
|
||||||
"iconUrl": "https://raw.githubusercontent.com/kodjodevf/mangayomi-extensions/main/javascript/icon/all.netflixmirror.png",
|
"iconUrl": "https://raw.githubusercontent.com/kodjodevf/mangayomi-extensions/main/javascript/icon/all.netflixmirror.png",
|
||||||
"typeSource": "single",
|
"typeSource": "single",
|
||||||
"isManga": false,
|
"isManga": false,
|
||||||
"itemType": 1,
|
"itemType": 1,
|
||||||
"version": "0.0.6",
|
"version": "0.0.7",
|
||||||
"dateFormat": "",
|
"dateFormat": "",
|
||||||
"dateFormatLocale": "",
|
"dateFormatLocale": "",
|
||||||
"pkgPath": "anime/src/all/netflixmirror.js"
|
"pkgPath": "anime/src/all/netflixmirror.js"
|
||||||
}];
|
}];
|
||||||
|
|
||||||
class DefaultExtension extends MProvider {
|
class DefaultExtension extends MProvider {
|
||||||
|
|
||||||
|
getTVApi() {
|
||||||
|
return "https://pcmirror.cc"
|
||||||
|
}
|
||||||
|
|
||||||
async getCookie() {
|
async getCookie() {
|
||||||
const preferences = new SharedPreferences();
|
const preferences = new SharedPreferences();
|
||||||
let cookie;
|
let cookie;
|
||||||
cookie = preferences.getString("cookie", "");
|
cookie = preferences.getString("cookie", "");
|
||||||
const check = await new Client().get(`${this.source.baseUrl}/home`, { "cookie": cookie });
|
const check = await new Client().get(`${this.source.baseUrl}/home`, { "cookie": cookie });
|
||||||
const elements = new Document(check.body).select(".tray-container, #top10");
|
const hDocBody = new Document(check.body).selectFirst("body")
|
||||||
|
const elements = hDocBody.select(".tray-container, #top10");
|
||||||
if (elements && elements.length > 0) {
|
if (elements && elements.length > 0) {
|
||||||
return cookie;
|
return cookie;
|
||||||
}
|
}
|
||||||
const hDoc = new Document((await new Client().get(`${this.source.baseUrl}/home`, { "cookie": "" })).body);
|
|
||||||
const addhash = hDoc.selectFirst("body").attr("data-addhash");
|
const addhash = hDocBody.attr("data-addhash");
|
||||||
const time = hDoc.selectFirst("body").attr("data-time");
|
var res = await new Client().post(`${this.getTVApi()}/tv/p.php`, { "cookie": "" }, { "hash": addhash });
|
||||||
await new Client().get(`https://userverify.netmirror.app/?fr3=${addhash}&a=y&t=${time}`);
|
cookie = res.headers["set-cookie"];
|
||||||
let body;
|
|
||||||
let res;
|
|
||||||
do {
|
|
||||||
res = await new Client().post(`${this.source.baseUrl}/verify2.php`, { "cookie": "" }, { "verify": addhash });
|
|
||||||
body = res.body;
|
|
||||||
} while (!body.includes('"statusup":"All Done"'));
|
|
||||||
cookie = `ott=nf; hd=on; ${res.headers["set-cookie"]}`;
|
|
||||||
preferences.setString("cookie", cookie);
|
preferences.setString("cookie", cookie);
|
||||||
return cookie;
|
return cookie;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user