Skip to content

Commit

Permalink
Merge pull request #306 from ijs77/patch-11
Browse files Browse the repository at this point in the history
Update porcore.com.js
  • Loading branch information
OshekharO authored Nov 2, 2024
2 parents bd2d0fa + e4763ee commit fdb968f
Showing 1 changed file with 9 additions and 24 deletions.
33 changes: 9 additions & 24 deletions repo/porcore.com.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// ==MiruExtension==
// @name PorCore
// @version v0.0.2
// @version v0.0.3
// @author javxsub.com
// @lang en
// @license MIT
Expand All @@ -12,14 +12,6 @@
// ==/MiruExtension==

export default class extends Extension {

async req(url) {
const res = await this.request("", {
"Miru-Url": url,
});
return url;
}

async createFilter(filter) {
const filters = {
sort_by: {
Expand All @@ -43,66 +35,59 @@ export default class extends Extension {
}

async latest(page) {
// Latest updates
const url = `/?ajax&p=${page}`;
const res = await this.request(url);
const videoList = await this.querySelectorAll(res, "div.onevideothumb");
const videos = [];

for (const element of videoList) {
const html = await element.content;
const title = await this.getAttributeText(html, "h5", "title");
const url = await this.getAttributeText(html, "a", "href");
const cover = await this.getAttributeText(html, "img.flipbookimages", "src");
const updt = await this.querySelector(html, "div.floatlefttop").text;

if (title && url && cover && cover.includes("res.php")) {
videos.push({
title: title,
url: url,
cover: cover,
update: updt.trim(),
update: updt.trim()
});
}
}

return videos;
}

async search(kw, page, filter) {
// Search
if (kw) {
var search_string = `/show/${kw}?p=${page}`;
} else {
var search_string = `/?ajax&p=${page}`;
}
search_string += filter['sort_by']
if (filter) {
search_string += filter['sort_by']
}
const res = await this.request(search_string);
const videoList = await this.querySelectorAll(res, "div.onevideothumb");
const videos = [];

for (const element of videoList) {
const html = await element.content;
const title = await this.getAttributeText(html, "h5", "title");
const url = await this.getAttributeText(html, "a", "href");
const cover = await this.getAttributeText(html, "img.flipbookimages", "src");
const updt = await this.querySelector(html, "div.floatlefttop").text;

if (title && url && cover && cover.includes("res.php")) {
videos.push({
title: title,
url: url,
cover: cover,
update: updt.trim(),
update: updt.trim()
});
}
}

return videos;
}

async detail(url) {
// Details
const strippedpath = url.replace(/^(https?:\/\/)?([^\/]+)(\/.*)?/, '$3');
const res = await this.request(strippedpath);
const title = await this.querySelector(res, 'h1').text;
Expand All @@ -118,16 +103,16 @@ export default class extends Extension {
title: user.trim(),
urls: [{
name: title.trim(),
url: video,
url: video
}]
}, ],
}]
};
}

async watch(url) {
return {
type: "hls",
url: url || "",
url: url || ""
};
}
}

0 comments on commit fdb968f

Please sign in to comment.