better-ani-scraped 1.6.3 → 1.6.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2,7 +2,7 @@ import { AnimeScraper } from "../../index.js"; // REPLACE BY "from 'better-ani-s
2
2
 
3
3
  const main = async () => {
4
4
  const animesama = new AnimeScraper('animesama');
5
- const seasonUrl = "https://anime-sama.fr/catalogue/86-eighty-six/saison1/vostfr/";
5
+ const seasonUrl = "https://anime-sama.fr/catalogue/aggretsuko/saison1/vf/";
6
6
 
7
7
  const animeLanguages = await animesama.getAvailableLanguages(seasonUrl, ["vostfr", "vf", "va", "vkr","vcn", "vqc", "vf1", "vf2"], false);
8
8
  console.log(animeLanguages);
@@ -2,7 +2,7 @@ import { AnimeScraper, getVideoUrlFromEmbed } from "../../index.js"; // REPLACE
2
2
 
3
3
  const main = async () => {
4
4
  const animesama = new AnimeScraper('animesama');
5
- const animeUrl = "https://anime-sama.fr/catalogue/86-eighty-six/";
5
+ const animeUrl = "https://anime-sama.fr/catalogue/one-piece/";
6
6
 
7
7
  const seasons = await animesama.getSeasons(animeUrl, "vostfr");
8
8
  console.log("Seasons:", seasons);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "better-ani-scraped",
3
- "version": "1.6.3",
3
+ "version": "1.6.4",
4
4
  "description": "Scrape anime data from different sources (only anime-sama.fr for the moment)",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -367,7 +367,7 @@ export async function getAvailableLanguages(
367
367
 
368
368
  // Iterate over each possible language and check if the page exists
369
369
  for (let language of wantedLanguages) {
370
- const languageUrl = seasonUrl.replace("vostfr", `${language}`);
370
+ const languageUrl = seasonUrl.split('/').map((s, i) => i === 6 ? language : s).join('/');
371
371
  try {
372
372
  const res = await axios.get(languageUrl, {
373
373
  headers: getHeaders(CATALOGUE_URL),