mirror of
https://github.com/vega-org/vega-providers.git
synced 2026-04-17 15:41:45 +00:00
1 line
1.8 KiB
JavaScript
1 line
1.8 KiB
JavaScript
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())})};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=6yZYfXQxBgjaD1eacR5zZCz7njssbxjtSZZCElTOGk0-1764836255-1.2.1.1-bzHvDcDRLp6AAYo7qvGVzJ6Gk6zaqAepuGiGhAWCGYL.ZDpw5yI4TkUIXDgAnEhGCZ9J5X2_OagzgeMHZrd8rzeyAFQXj0dmYMErcfII7_Rhq5kZ4kAtS0tl9PtaNKKd2m4taIufySXCCstl3iNLMODTjbsW_KZi8U8DauOdGSAhBd1DCGxvLlAOM.snfkhb0yQiVJcLW8Bv9IeKQac0ar_TKkV6QexqNZYiyRXnE7E; xla=s4t","user-agent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/142.0.0.0 Safari/537.36 Edg/142.0.0.0"})}),$=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; |