Skip to content

Commit

Permalink
Merge pull request #134 from himanshu8443/feature
Browse files Browse the repository at this point in the history
Enhance world4uGetStream: update link retrieval logic
  • Loading branch information
Zenda-Cross authored Oct 12, 2024
2 parents e52e436 + ec50a4f commit 4ff393b
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/lib/providers/world4u/world4uGetStream.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export const world4uGetStream = async (
const fastilinksKey = $$(
'input[name="_csrf_token_645a83a41868941e4692aa31e7235f2"]',
).attr('value');
// console.log('fastilinksKey', fastilinksKey);
console.log('fastilinksKey', fastilinksKey);
const fastilinksFormData = new FormData();
fastilinksFormData.append(
'_csrf_token_645a83a41868941e4692aa31e7235f2',
Expand All @@ -35,8 +35,11 @@ export const world4uGetStream = async (
body: fastilinksFormData,
});
const fastilinksHtml = await fastilinksRes2.text();
// console.log('fastilinksHtml', fastilinksHtml);
const $$$ = cheerio.load(fastilinksHtml);
const fastilinksLink = $$$('a:contains("wlinkfast")').attr('href');
const fastilinksLink =
$$$('a:contains("mediafire")').attr('href') ||
$$$('a:contains("photolinx")').attr('href');
console.log('fastilinksLink', fastilinksLink);
url = fastilinksLink || url;
}
Expand Down Expand Up @@ -107,7 +110,10 @@ export const world4uGetStream = async (

// console.log('streamRes', streamRes);
let $ = cheerio.load(html);
const mediafireUrl = $('h1:contains("Download")').find('a').attr('href');
// console.log('data', html);
const mediafireUrl =
$('h1:contains("Download")').find('a').attr('href') ||
$('.input.popsok').attr('href');
console.log('mediafireUrl', mediafireUrl);
if (mediafireUrl) {
const directUrl = await axios.head(mediafireUrl);
Expand Down

0 comments on commit 4ff393b

Please sign in to comment.