better-ani-scraped 1.6.5 → 1.6.6

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.
package/DOCUMENTATION.md CHANGED
@@ -72,13 +72,17 @@ Fetches all available seasons of an anime in the first valid language specified.
72
72
  - **Returns:**
73
73
  Either an array of season objects:
74
74
  ```js
75
- [
76
- {
77
- title: string,
78
- url: string
79
- },
80
- ...
81
- ]
75
+ {
76
+ language: string,
77
+ seasons: [
78
+ {
79
+ title: string,
80
+ url: string
81
+ },
82
+ ...
83
+ ]
84
+ }
85
+
82
86
  ```
83
87
  Else, an error object if the language is not available.
84
88
 
@@ -164,17 +168,17 @@ Checks which languages are available for a given anime season (Avoid using `numb
164
168
  - `wantedLanguages` *(string[])*: Language codes to check (e.g., ["vostfr", "vf", "va", ...]).
165
169
  - `numberEpisodes` *(boolean)*: If `true`, also fetches the number of episodes in each language.
166
170
  - **Returns:**
167
- Array of objects containing available languages and their episode count:
171
+ Array of objects containing available languages and their episode count if numberEpisodes is true:
168
172
  ```js
169
173
  [
170
174
  {
171
175
  language: string,
172
- episodeCount: number //if numberEpisodes = true
176
+ episodeCount: number
173
177
  },
174
178
  ...
175
179
  ]
176
180
  ```
177
-
181
+ Or an array of available languages
178
182
  ---
179
183
 
180
184
  ### `animesama.getAllAnime(wantedLanguages = ["vostfr", "vf", "vastfr"], wantedTypes = ["Anime", "Film"], page = null, output = "anime_list.json", get_seasons = false)`
@@ -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/aggretsuko/saison1/vf/";
5
+ const seasonUrl = "https://anime-sama.fr/catalogue/86-eighty-six/saison1/vostfr/";
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,9 +2,9 @@ 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 animeUrl = "https://anime-sama.fr/catalogue/aggretsuko/";
5
+ const animeUrl = "https://anime-sama.fr/catalogue/sword-art-online";
6
6
 
7
- const seasons = await animesama.getSeasons(animeUrl, );
7
+ const seasons = await animesama.getSeasons(animeUrl, ["vostfr", "vf"]);
8
8
  console.log("Seasons:", seasons);
9
9
  };
10
10
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "better-ani-scraped",
3
- "version": "1.6.5",
3
+ "version": "1.6.6",
4
4
  "description": "Scrape anime data from different sources (only anime-sama.fr for the moment)",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -375,7 +375,7 @@ export async function getAvailableLanguages(
375
375
  const episodeCount = (await getEmbed(languageUrl)).length;
376
376
  languageLinks.push({ language: language.toUpperCase(), episodeCount: episodeCount });
377
377
  } else {
378
- languageLinks.push({ language: language.toUpperCase()});
378
+ languageLinks.push(language.toUpperCase());
379
379
  }
380
380
 
381
381
  }