mirror of
https://github.com/vega-org/vega-providers.git
synced 2026-04-17 15:41:45 +00:00
fix: enhance metadata fetching logic and improve selector for episodes
This commit is contained in:
3
dist/uhd/meta.js
vendored
3
dist/uhd/meta.js
vendored
@@ -30,6 +30,7 @@ const getMeta = function (_a) {
|
|||||||
var _b;
|
var _b;
|
||||||
try {
|
try {
|
||||||
const { axios, cheerio } = providerContext;
|
const { axios, cheerio } = providerContext;
|
||||||
|
console.log("Fetching metadata from UHD...", link, providerContext);
|
||||||
const url = link;
|
const url = link;
|
||||||
const res = yield axios.get(url, { headers });
|
const res = yield axios.get(url, { headers });
|
||||||
const html = yield res.data;
|
const html = yield res.data;
|
||||||
@@ -41,7 +42,7 @@ const getMeta = function (_a) {
|
|||||||
// Links
|
// Links
|
||||||
const episodes = [];
|
const episodes = [];
|
||||||
// new structure
|
// new structure
|
||||||
$(".mks_separator").each((index, element) => {
|
$(".mks_separator,p:contains('mks_separator')").each((index, element) => {
|
||||||
$(element)
|
$(element)
|
||||||
.nextUntil(".mks_separator")
|
.nextUntil(".mks_separator")
|
||||||
.each((index, element) => {
|
.each((index, element) => {
|
||||||
|
|||||||
@@ -28,6 +28,7 @@ export const getMeta = async function ({
|
|||||||
}): Promise<Info> {
|
}): Promise<Info> {
|
||||||
try {
|
try {
|
||||||
const { axios, cheerio } = providerContext;
|
const { axios, cheerio } = providerContext;
|
||||||
|
console.log("Fetching metadata from UHD...", link, providerContext);
|
||||||
const url = link;
|
const url = link;
|
||||||
const res = await axios.get(url, { headers });
|
const res = await axios.get(url, { headers });
|
||||||
const html = await res.data;
|
const html = await res.data;
|
||||||
@@ -43,7 +44,7 @@ export const getMeta = async function ({
|
|||||||
const episodes: Link[] = [];
|
const episodes: Link[] = [];
|
||||||
|
|
||||||
// new structure
|
// new structure
|
||||||
$(".mks_separator").each((index, element) => {
|
$(".mks_separator,p:contains('mks_separator')").each((index, element) => {
|
||||||
$(element)
|
$(element)
|
||||||
.nextUntil(".mks_separator")
|
.nextUntil(".mks_separator")
|
||||||
.each((index, element) => {
|
.each((index, element) => {
|
||||||
|
|||||||
Reference in New Issue
Block a user