From fdcb9d2aca53a45ed441227f55e8f7ff88f8b4cf Mon Sep 17 00:00:00 2001 From: melih Date: Sat, 7 Feb 2026 15:12:15 +0300 Subject: [PATCH 1/5] adding diziyou (turkish) source --- src/providers/all.ts | 2 + src/providers/sources/diziyou/helpers.ts | 3 + src/providers/sources/diziyou/index.ts | 108 +++++++++++++++++++++++ 3 files changed, 113 insertions(+) create mode 100644 src/providers/sources/diziyou/helpers.ts create mode 100644 src/providers/sources/diziyou/index.ts diff --git a/src/providers/all.ts b/src/providers/all.ts index 31dbe566..c7fb7f8d 100644 --- a/src/providers/all.ts +++ b/src/providers/all.ts @@ -74,6 +74,7 @@ import { cinehdplusScraper } from './sources/cinehdplus-es'; import { coitusScraper } from './sources/coitus'; import { cuevana3Scraper } from './sources/cuevana3'; import { debridScraper } from './sources/debrid'; +import { diziyouScraper } from './sources/diziyou'; import { embedsuScraper } from './sources/embedsu'; import { fullhdfilmizleScraper } from './sources/fullhdfilmizle'; import { hdRezkaScraper } from './sources/hdrezka'; @@ -138,6 +139,7 @@ export function gatherAllSources(): Array { debridScraper, cinehdplusScraper, fullhdfilmizleScraper, + diziyouScraper, ]; } diff --git a/src/providers/sources/diziyou/helpers.ts b/src/providers/sources/diziyou/helpers.ts new file mode 100644 index 00000000..15a901dc --- /dev/null +++ b/src/providers/sources/diziyou/helpers.ts @@ -0,0 +1,3 @@ +export function urlifyTitle(title: string) { + return title.toLowerCase().replace(' ', '-'); +} diff --git a/src/providers/sources/diziyou/index.ts b/src/providers/sources/diziyou/index.ts new file mode 100644 index 00000000..e44bcbbf --- /dev/null +++ b/src/providers/sources/diziyou/index.ts @@ -0,0 +1,108 @@ +import { flags } from '@/entrypoint/utils/targets'; +import { SourcererOutput, makeSourcerer } from '@/providers/base'; +import { Caption } from '@/providers/captions'; +import { ShowScrapeContext } from '@/utils/context'; +import { NotFoundError } from '@/utils/errors'; + +import { urlifyTitle } from './helpers'; + +const baseUrl = 'https://www.diziyou.one/'; + +const headers = { + Referer: baseUrl, + Accept: 'application/json, text/javascript, */*; q=0.01', + 'User-Agent': + 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36', +}; + +async function scrapeShow(ctx: ShowScrapeContext): Promise { + if (!ctx.media.imdbId) { + throw new NotFoundError('IMDb id not provided'); + } + + const urlTitle = urlifyTitle(ctx.media.title); + const showPage = await ctx.proxiedFetcher(`/${urlTitle}/`, { + baseUrl, + headers, + }); + + ctx.progress(30); + if (showPage.includes('404 Not Found')) { + throw new NotFoundError('Media not found'); + } + + const mediaUrl = `/${urlTitle}-${ctx.media.season.number}-sezon-${ctx.media.episode.number}-bolum/`; + + const mediaPage = await ctx.proxiedFetcher(mediaUrl, { + baseUrl, + headers, + }); + + // If there is no turkish dubbed + if (!mediaPage.includes('')) { + throw new NotFoundError('Dubbed version not found'); + } + + let iframeUrl = mediaPage.split('