diff --git a/s.to/sToEngDub_v2.js b/s.to/sToEngDub_v2.js index 3d6bef3..ef373be 100644 --- a/s.to/sToEngDub_v2.js +++ b/s.to/sToEngDub_v2.js @@ -9,50 +9,6 @@ async function searchResults(keyword) { const response = await soraFetch(searchApiUrl); const text = response.text ? await response.text() : await response; - // parse html - /*
- -
- - - - - - - - - - Pluribus - Glück ist ansteckend - - - - - -
-
Pluribus - Glück ist - ansteckend
-
-
- -
- ... - */ const searchRegex = /]*>([\s\S]*?)<\//g; const results = []; let match; @@ -95,15 +51,6 @@ async function extractDetails(url) { const airdateMatch = yearMatch ? `${yearMatch[1]}` : 'Unknown Year'; - // get genres - /*
  • - Genre: - - - Science Fiction, Comedy, Drama - -
  • - */ const genresRegex = /
  • \s*Genre:<\/strong>([\s\S]*?)<\/li>/; const genresMatch = genresRegex.exec(text); let genres = ''; @@ -165,7 +112,7 @@ async function extractEpisodes(url) { async function extractStreamUrl(url) { try { - const language = [2, 4, 3]; // Englisch Dub, Eng-Sub, Ger-Sub + const language = [2 ,4, 3]; // Prioritize languages: 1=Deutsch, 3=Ger-Sub, 2=Englisch, 4=Eng-Sub const fetchUrl = `${url}`; const response = await soraFetch(fetchUrl); @@ -281,17 +228,7 @@ function getSeasonLinks(html) { const seasonMatch = seasonRegex.exec(html); if (seasonMatch) { const seasonList = seasonMatch[1]; - /* 1 - 2 - */ + const seasonLinkRegex = /]*?href="([^"]+)"[^>]*?class="[^"]*alphabet-link/g; let seasonLinkMatch; const filmeLinks = []; @@ -323,27 +260,7 @@ async function fetchSeasonEpisodes(url) { const episodeList = []; if (episodeDivMatch) { const episodeListHtml = episodeDivMatch[1]; - /*
  • - - - - - */ + const episodeLinkRegex = /]*?href="([^"]+)"[^>]*?class="[^"]*alphabet-link[^"]*"[^>]*>\s*([\s\S]*?)\s*<\/a>/g; let episodeLinkMatch; let number = 0; @@ -375,19 +292,6 @@ async function fetchSeasonEpisodes(url) { function getVideoLinks(html) { const baseUrl = 'https://s.to'; - // get links based on button: - /* - */ const videoLinks = []; const videoLinkRegex = /]*?class="link-box btn btn-dark w-100 text-start gap-2"[^>]*?data-play-url="([^"]+)"[^>]*?data-provider-name="([^"]+)"[^>]*?data-language-id="([^"]+)"[^>]*?>/g; let videoLinkMatch; diff --git a/s.to/sToGerDub_v2.js b/s.to/sToGerDub_v2.js index bde447b..b95be25 100644 --- a/s.to/sToGerDub_v2.js +++ b/s.to/sToGerDub_v2.js @@ -9,50 +9,6 @@ async function searchResults(keyword) { const response = await soraFetch(searchApiUrl); const text = response.text ? await response.text() : await response; - // parse html - /*
    - -
    - - - - - - - - - - Pluribus - Glück ist ansteckend - - - - - -
    -
    Pluribus - Glück ist - ansteckend
    -
    -
    - -
    - ... - */ const searchRegex = /]*>([\s\S]*?)<\//g; const results = []; let match; @@ -95,15 +51,6 @@ async function extractDetails(url) { const airdateMatch = yearMatch ? `${yearMatch[1]}` : 'Unknown Year'; - // get genres - /*
  • - Genre: - - - Science Fiction, Comedy, Drama - -
  • - */ const genresRegex = /
  • \s*Genre:<\/strong>([\s\S]*?)<\/li>/; const genresMatch = genresRegex.exec(text); let genres = ''; @@ -281,17 +228,7 @@ function getSeasonLinks(html) { const seasonMatch = seasonRegex.exec(html); if (seasonMatch) { const seasonList = seasonMatch[1]; - /* 1 - 2 - */ + const seasonLinkRegex = /]*?href="([^"]+)"[^>]*?class="[^"]*alphabet-link/g; let seasonLinkMatch; const filmeLinks = []; @@ -323,27 +260,7 @@ async function fetchSeasonEpisodes(url) { const episodeList = []; if (episodeDivMatch) { const episodeListHtml = episodeDivMatch[1]; - /*
  • - - - - - */ + const episodeLinkRegex = /]*?href="([^"]+)"[^>]*?class="[^"]*alphabet-link[^"]*"[^>]*>\s*([\s\S]*?)\s*<\/a>/g; let episodeLinkMatch; let number = 0; @@ -375,19 +292,6 @@ async function fetchSeasonEpisodes(url) { function getVideoLinks(html) { const baseUrl = 'https://s.to'; - // get links based on button: - /* - */ const videoLinks = []; const videoLinkRegex = /]*?class="link-box btn btn-dark w-100 text-start gap-2"[^>]*?data-play-url="([^"]+)"[^>]*?data-provider-name="([^"]+)"[^>]*?data-language-id="([^"]+)"[^>]*?>/g; let videoLinkMatch;