mirror of
https://github.com/vega-org/vega-providers.git
synced 2026-04-17 15:41:45 +00:00
fix: add cookie header to axios requests in getEpisodes function
This commit is contained in:
2
dist/luxMovies/episodes.js
vendored
2
dist/luxMovies/episodes.js
vendored
@@ -1 +1 @@
|
||||
"use strict";var __awaiter=this&&this.__awaiter||function(thisArg,_arguments,P,generator){return new(P||(P=Promise))(function(resolve,reject){function fulfilled(value){try{step(generator.next(value))}catch(e){reject(e)}}function rejected(value){try{step(generator.throw(value))}catch(e){reject(e)}}function step(result){var value;result.done?resolve(result.value):(value=result.value,value instanceof P?value:new P(function(resolve){resolve(value)})).then(fulfilled,rejected)}step((generator=generator.apply(thisArg,_arguments||[])).next())})};Object.defineProperty(exports,"__esModule",{value:!0}),exports.getEpisodes=void 0;const getEpisodes=function(_a){return __awaiter(this,arguments,void 0,function*({url:url,providerContext:providerContext}){const{axios:axios,cheerio:cheerio,commonHeaders:headers}=providerContext;try{const res=yield axios.get(url,{headers:headers}),$=cheerio.load(res.data),container=$(".entry-content,.entry-inner");$(".unili-content,.code-block-1").remove();const episodes=[];return container.find("h4").each((index,element)=>{const el=$(element),title=el.text().replace(/-/g,"").replace(/:/g,""),link=el.next("p").find('.btn-outline[style="background:linear-gradient(135deg,#ed0b0b,#f2d152); color: white;"]').parent().attr("href");title&&link&&episodes.push({title:title,link:link})}),episodes}catch(err){return[]}})};exports.getEpisodes=getEpisodes;
|
||||
"use strict";var __awaiter=this&&this.__awaiter||function(thisArg,_arguments,P,generator){return new(P||(P=Promise))(function(resolve,reject){function fulfilled(value){try{step(generator.next(value))}catch(e){reject(e)}}function rejected(value){try{step(generator.throw(value))}catch(e){reject(e)}}function step(result){var value;result.done?resolve(result.value):(value=result.value,value instanceof P?value:new P(function(resolve){resolve(value)})).then(fulfilled,rejected)}step((generator=generator.apply(thisArg,_arguments||[])).next())})};Object.defineProperty(exports,"__esModule",{value:!0}),exports.getEpisodes=void 0;const getEpisodes=function(_a){return __awaiter(this,arguments,void 0,function*({url:url,providerContext:providerContext}){const{axios:axios,cheerio:cheerio,commonHeaders:headers}=providerContext;try{const res=yield axios.get(url,{headers:Object.assign(Object.assign({},headers),{cookie:"ext_name=ojplmecpdpgccookcobabopnaifgidhf; cf_clearance=Zl2yiOCN3pzGUd0Bgs.VyBXniJooDbG2Tk1g7DEoRnw-1756381111-1.2.1.1-RVPZoWGCAygGNAHavrVR0YaqASWZlJyYff8A.oQfPB5qbcPrAVud42BzsSwcDgiKAP0gw5D92V3o8XWwLwDRNhyg3DuL1P8wh2K4BCVKxWvcy.iCCxczKtJ8QSUAsAQqsIzRWXk29N6X.kjxuOTYlfB2jrlq12TRDld_zTbsskNcTxaA.XQekUcpGLseYqELuvlNOQU568NZD6LiLn3ICyFThMFAx6mIcgXkxVAvnxU; xla=s4t"})}),$=cheerio.load(res.data),container=$(".entry-content,.entry-inner");$(".unili-content,.code-block-1").remove();const episodes=[];return container.find("h4").each((index,element)=>{const el=$(element),title=el.text().replace(/-/g,"").replace(/:/g,""),link=el.next("p").find('.btn-outline[style="background:linear-gradient(135deg,#ed0b0b,#f2d152); color: white;"]').parent().attr("href");title&&link&&episodes.push({title:title,link:link})}),episodes}catch(err){return[]}})};exports.getEpisodes=getEpisodes;
|
||||
2
dist/vega/episodes.js
vendored
2
dist/vega/episodes.js
vendored
@@ -1 +1 @@
|
||||
"use strict";var __awaiter=this&&this.__awaiter||function(thisArg,_arguments,P,generator){return new(P||(P=Promise))(function(resolve,reject){function fulfilled(value){try{step(generator.next(value))}catch(e){reject(e)}}function rejected(value){try{step(generator.throw(value))}catch(e){reject(e)}}function step(result){var value;result.done?resolve(result.value):(value=result.value,value instanceof P?value:new P(function(resolve){resolve(value)})).then(fulfilled,rejected)}step((generator=generator.apply(thisArg,_arguments||[])).next())})};Object.defineProperty(exports,"__esModule",{value:!0}),exports.getEpisodes=void 0;const getEpisodes=function(_a){return __awaiter(this,arguments,void 0,function*({url:url,providerContext:providerContext}){const{axios:axios,cheerio:cheerio,commonHeaders:headers}=providerContext;try{const res=yield axios.get(url,{headers:headers}),$=cheerio.load(res.data),container=$(".entry-content,.entry-inner");$(".unili-content,.code-block-1").remove();const episodes=[];return container.find("h4").each((index,element)=>{const el=$(element),title=el.text().replace(/-/g,"").replace(/:/g,""),link=el.next("p").find('.btn-outline[style="background:linear-gradient(135deg,#ed0b0b,#f2d152); color: white;"]').parent().attr("href");title&&link&&episodes.push({title:title,link:link})}),episodes}catch(err){return[]}})};exports.getEpisodes=getEpisodes;
|
||||
"use strict";var __awaiter=this&&this.__awaiter||function(thisArg,_arguments,P,generator){return new(P||(P=Promise))(function(resolve,reject){function fulfilled(value){try{step(generator.next(value))}catch(e){reject(e)}}function rejected(value){try{step(generator.throw(value))}catch(e){reject(e)}}function step(result){var value;result.done?resolve(result.value):(value=result.value,value instanceof P?value:new P(function(resolve){resolve(value)})).then(fulfilled,rejected)}step((generator=generator.apply(thisArg,_arguments||[])).next())})};Object.defineProperty(exports,"__esModule",{value:!0}),exports.getEpisodes=void 0;const getEpisodes=function(_a){return __awaiter(this,arguments,void 0,function*({url:url,providerContext:providerContext}){const{axios:axios,cheerio:cheerio,commonHeaders:headers}=providerContext;try{const res=yield axios.get(url,{headers:Object.assign(Object.assign({},headers),{cookie:"ext_name=ojplmecpdpgccookcobabopnaifgidhf; cf_clearance=Zl2yiOCN3pzGUd0Bgs.VyBXniJooDbG2Tk1g7DEoRnw-1756381111-1.2.1.1-RVPZoWGCAygGNAHavrVR0YaqASWZlJyYff8A.oQfPB5qbcPrAVud42BzsSwcDgiKAP0gw5D92V3o8XWwLwDRNhyg3DuL1P8wh2K4BCVKxWvcy.iCCxczKtJ8QSUAsAQqsIzRWXk29N6X.kjxuOTYlfB2jrlq12TRDld_zTbsskNcTxaA.XQekUcpGLseYqELuvlNOQU568NZD6LiLn3ICyFThMFAx6mIcgXkxVAvnxU; xla=s4t"})}),$=cheerio.load(res.data),container=$(".entry-content,.entry-inner");$(".unili-content,.code-block-1").remove();const episodes=[];return container.find("h4").each((index,element)=>{const el=$(element),title=el.text().replace(/-/g,"").replace(/:/g,""),link=el.next("p").find('.btn-outline[style="background:linear-gradient(135deg,#ed0b0b,#f2d152); color: white;"]').parent().attr("href");title&&link&&episodes.push({title:title,link:link})}),episodes}catch(err){return[]}})};exports.getEpisodes=getEpisodes;
|
||||
@@ -10,7 +10,13 @@ export const getEpisodes = async function ({
|
||||
const { axios, cheerio, commonHeaders: headers } = providerContext;
|
||||
console.log("getEpisodeLinks", url);
|
||||
try {
|
||||
const res = await axios.get(url, { headers });
|
||||
const res = await axios.get(url, {
|
||||
headers: {
|
||||
...headers,
|
||||
cookie:
|
||||
"ext_name=ojplmecpdpgccookcobabopnaifgidhf; cf_clearance=Zl2yiOCN3pzGUd0Bgs.VyBXniJooDbG2Tk1g7DEoRnw-1756381111-1.2.1.1-RVPZoWGCAygGNAHavrVR0YaqASWZlJyYff8A.oQfPB5qbcPrAVud42BzsSwcDgiKAP0gw5D92V3o8XWwLwDRNhyg3DuL1P8wh2K4BCVKxWvcy.iCCxczKtJ8QSUAsAQqsIzRWXk29N6X.kjxuOTYlfB2jrlq12TRDld_zTbsskNcTxaA.XQekUcpGLseYqELuvlNOQU568NZD6LiLn3ICyFThMFAx6mIcgXkxVAvnxU; xla=s4t",
|
||||
},
|
||||
});
|
||||
const $ = cheerio.load(res.data);
|
||||
const container = $(".entry-content,.entry-inner");
|
||||
$(".unili-content,.code-block-1").remove();
|
||||
|
||||
@@ -10,7 +10,13 @@ export const getEpisodes = async function ({
|
||||
const { axios, cheerio, commonHeaders: headers } = providerContext;
|
||||
console.log("getEpisodeLinks", url);
|
||||
try {
|
||||
const res = await axios.get(url, { headers });
|
||||
const res = await axios.get(url, {
|
||||
headers: {
|
||||
...headers,
|
||||
cookie:
|
||||
"ext_name=ojplmecpdpgccookcobabopnaifgidhf; cf_clearance=Zl2yiOCN3pzGUd0Bgs.VyBXniJooDbG2Tk1g7DEoRnw-1756381111-1.2.1.1-RVPZoWGCAygGNAHavrVR0YaqASWZlJyYff8A.oQfPB5qbcPrAVud42BzsSwcDgiKAP0gw5D92V3o8XWwLwDRNhyg3DuL1P8wh2K4BCVKxWvcy.iCCxczKtJ8QSUAsAQqsIzRWXk29N6X.kjxuOTYlfB2jrlq12TRDld_zTbsskNcTxaA.XQekUcpGLseYqELuvlNOQU568NZD6LiLn3ICyFThMFAx6mIcgXkxVAvnxU; xla=s4t",
|
||||
},
|
||||
});
|
||||
const $ = cheerio.load(res.data);
|
||||
const container = $(".entry-content,.entry-inner");
|
||||
$(".unili-content,.code-block-1").remove();
|
||||
|
||||
Reference in New Issue
Block a user