diff --git a/src/lib/providers/dramacool/dcGetPosts.ts b/src/lib/providers/dramacool/dcGetPosts.ts index 0fea4db..696fdf5 100644 --- a/src/lib/providers/dramacool/dcGetPosts.ts +++ b/src/lib/providers/dramacool/dcGetPosts.ts @@ -12,10 +12,11 @@ export const dcGetPosts = async function ( ): Promise { try { const urlRes = await axios.get( - 'https://consumet8.vercel.app/movies/dramacool/info?id=drama-detail/shogun', + 'https://himanshu8443.github.io/providers/modflix.json', ); - const resData = urlRes.data.episodes[0].url; - const baseUrl = resData.split('/').slice(0, 3).join('/'); + const dataRes = urlRes.data; + // console.log(dataRes.hdhub.url); + const baseUrl = dataRes?.dc?.url; console.log('dcBaseUrl', baseUrl); const url = filter.includes('query') ? `${baseUrl}/search?type=movies&keyword=${filter.replace( diff --git a/src/lib/providers/mod/modGetStream.ts b/src/lib/providers/mod/modGetStream.ts index bb68161..d925faf 100644 --- a/src/lib/providers/mod/modGetStream.ts +++ b/src/lib/providers/mod/modGetStream.ts @@ -74,42 +74,46 @@ export const modGetStream = async ( const driveRes = await axios.get(driveLink, {headers}); const driveHtml = driveRes.data; const $drive = cheerio.load(driveHtml); - const resumeBot = $drive('.btn.btn-light').attr('href') || ''; - const resumeBotRes = await axios.get(resumeBot, {headers}); - const resumeBotToken = resumeBotRes.data.match( - /formData\.append\('token', '([a-f0-9]+)'\)/, - )[1]; - const resumeBotBody = new FormData(); - resumeBotBody.append('token', resumeBotToken); - const resumeBotPath = resumeBotRes.data.match( - /fetch\('\/download\?id=([a-zA-Z0-9\/+]+)'/, - )[1]; - const resumeBotBaseUrl = resumeBot.split('/download')[0]; - // console.log( - // 'resumeBotPath', - // resumeBotBaseUrl + '/download?id=' + resumeBotPath, - // ); - // console.log('resumeBotBody', resumeBotToken); - const resumeBotDownload = await fetch( - resumeBotBaseUrl + '/download?id=' + resumeBotPath, - { - method: 'POST', - body: resumeBotBody, - headers: { - Referer: resumeBot, - Cookie: 'PHPSESSID=7e9658ce7c805dab5bbcea9046f7f308', - }, - }, - ); - const resumeBotDownloadData = await resumeBotDownload.json(); - console.log('resumeBotDownloadData', resumeBotDownloadData.url); - servers.push({ - server: 'ResumeBot', - link: resumeBotDownloadData.url, - type: 'mkv', - }); + try { + const resumeBot = $drive('.btn.btn-light').attr('href') || ''; + const resumeBotRes = await axios.get(resumeBot, {headers}); + const resumeBotToken = resumeBotRes.data.match( + /formData\.append\('token', '([a-f0-9]+)'\)/, + )[1]; + const resumeBotBody = new FormData(); + resumeBotBody.append('token', resumeBotToken); + const resumeBotPath = resumeBotRes.data.match( + /fetch\('\/download\?id=([a-zA-Z0-9\/+]+)'/, + )[1]; + const resumeBotBaseUrl = resumeBot.split('/download')[0]; + // console.log( + // 'resumeBotPath', + // resumeBotBaseUrl + '/download?id=' + resumeBotPath, + // ); + // console.log('resumeBotBody', resumeBotToken); + const resumeBotDownload = await fetch( + resumeBotBaseUrl + '/download?id=' + resumeBotPath, + { + method: 'POST', + body: resumeBotBody, + headers: { + Referer: resumeBot, + Cookie: 'PHPSESSID=7e9658ce7c805dab5bbcea9046f7f308', + }, + }, + ); + const resumeBotDownloadData = await resumeBotDownload.json(); + console.log('resumeBotDownloadData', resumeBotDownloadData.url); + servers.push({ + server: 'ResumeBot', + link: resumeBotDownloadData.url, + type: 'mkv', + }); + } catch (err) { + console.log('ResumeBot link not found', err); + } // CF workers type 1 try { const cfWorkersLink = driveLink.replace('/file', '/wfile') + '?type=1'; @@ -199,7 +203,7 @@ const isDriveLink = async (ddl: string) => { /window\.location\.replace\("([^"]+)"\)/, )[1]; const mainUrl = ddl.split('/')[2]; - console.log(`https://${mainUrl}${path}`); + console.log(`driveUrl = https://${mainUrl}${path}`); return `https://${mainUrl}${path}`; } else { return ddl;