anime-sama-api 0.2.2.post3__tar.gz → 0.2.2.post4__tar.gz

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.
Files changed (41) hide show
  1. {anime_sama_api-0.2.2.post3 → anime_sama_api-0.2.2.post4}/PKG-INFO +1 -1
  2. {anime_sama_api-0.2.2.post3 → anime_sama_api-0.2.2.post4}/anime_sama_api/season.py +1 -1
  3. {anime_sama_api-0.2.2.post3 → anime_sama_api-0.2.2.post4}/anime_sama_api/top_level.py +12 -2
  4. {anime_sama_api-0.2.2.post3 → anime_sama_api-0.2.2.post4}/pyproject.toml +1 -1
  5. anime_sama_api-0.2.2.post4/tests/data/catalogue_data.py +6 -0
  6. anime_sama_api-0.2.2.post4/tests/data/season_data.py +32 -0
  7. {anime_sama_api-0.2.2.post3 → anime_sama_api-0.2.2.post4}/tests/test_download.py +1 -1
  8. {anime_sama_api-0.2.2.post3 → anime_sama_api-0.2.2.post4}/tests/test_top_level.py +1 -1
  9. {anime_sama_api-0.2.2.post3 → anime_sama_api-0.2.2.post4}/uv.lock +1 -1
  10. anime_sama_api-0.2.2.post3/tests/data/catalogue_data.py +0 -6
  11. anime_sama_api-0.2.2.post3/tests/data/season_data.py +0 -32
  12. {anime_sama_api-0.2.2.post3 → anime_sama_api-0.2.2.post4}/.github/workflows/ci.yaml +0 -0
  13. {anime_sama_api-0.2.2.post3 → anime_sama_api-0.2.2.post4}/.github/workflows/release.yaml +0 -0
  14. {anime_sama_api-0.2.2.post3 → anime_sama_api-0.2.2.post4}/.gitignore +0 -0
  15. {anime_sama_api-0.2.2.post3 → anime_sama_api-0.2.2.post4}/.python-version +0 -0
  16. {anime_sama_api-0.2.2.post3 → anime_sama_api-0.2.2.post4}/LICENSE +0 -0
  17. {anime_sama_api-0.2.2.post3 → anime_sama_api-0.2.2.post4}/README.md +0 -0
  18. {anime_sama_api-0.2.2.post3 → anime_sama_api-0.2.2.post4}/TODO.md +0 -0
  19. {anime_sama_api-0.2.2.post3 → anime_sama_api-0.2.2.post4}/anime_sama_api/__init__.py +0 -0
  20. {anime_sama_api-0.2.2.post3 → anime_sama_api-0.2.2.post4}/anime_sama_api/catalogue.py +0 -0
  21. {anime_sama_api-0.2.2.post3 → anime_sama_api-0.2.2.post4}/anime_sama_api/cli/__main__.py +0 -0
  22. {anime_sama_api-0.2.2.post3 → anime_sama_api-0.2.2.post4}/anime_sama_api/cli/config.py +0 -0
  23. {anime_sama_api-0.2.2.post3 → anime_sama_api-0.2.2.post4}/anime_sama_api/cli/config.toml +0 -0
  24. {anime_sama_api-0.2.2.post3 → anime_sama_api-0.2.2.post4}/anime_sama_api/cli/downloader.py +0 -0
  25. {anime_sama_api-0.2.2.post3 → anime_sama_api-0.2.2.post4}/anime_sama_api/cli/episode_extra_info.py +0 -0
  26. {anime_sama_api-0.2.2.post3 → anime_sama_api-0.2.2.post4}/anime_sama_api/cli/error_handeling.py +0 -0
  27. {anime_sama_api-0.2.2.post3 → anime_sama_api-0.2.2.post4}/anime_sama_api/cli/internal_player.py +0 -0
  28. {anime_sama_api-0.2.2.post3 → anime_sama_api-0.2.2.post4}/anime_sama_api/cli/play_menu.py +0 -0
  29. {anime_sama_api-0.2.2.post3 → anime_sama_api-0.2.2.post4}/anime_sama_api/cli/utils.py +0 -0
  30. {anime_sama_api-0.2.2.post3 → anime_sama_api-0.2.2.post4}/anime_sama_api/episode.py +0 -0
  31. {anime_sama_api-0.2.2.post3 → anime_sama_api-0.2.2.post4}/anime_sama_api/langs.py +0 -0
  32. {anime_sama_api-0.2.2.post3 → anime_sama_api-0.2.2.post4}/anime_sama_api/utils.py +0 -0
  33. {anime_sama_api-0.2.2.post3 → anime_sama_api-0.2.2.post4}/debug_vidmoly.py +0 -0
  34. {anime_sama_api-0.2.2.post3 → anime_sama_api-0.2.2.post4}/exemples/new_episodes_rss.py +0 -0
  35. {anime_sama_api-0.2.2.post3 → anime_sama_api-0.2.2.post4}/exemples/run_cli_(for_debugging).py +0 -0
  36. {anime_sama_api-0.2.2.post3 → anime_sama_api-0.2.2.post4}/tests/__init__.py +0 -0
  37. {anime_sama_api-0.2.2.post3 → anime_sama_api-0.2.2.post4}/tests/data/episode_data.py +0 -0
  38. {anime_sama_api-0.2.2.post3 → anime_sama_api-0.2.2.post4}/tests/test_catalogue.py +0 -0
  39. {anime_sama_api-0.2.2.post3 → anime_sama_api-0.2.2.post4}/tests/test_cli_utils.py +0 -0
  40. {anime_sama_api-0.2.2.post3 → anime_sama_api-0.2.2.post4}/tests/test_seasons.py +0 -0
  41. {anime_sama_api-0.2.2.post3 → anime_sama_api-0.2.2.post4}/tests/test_utils.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: anime-sama_api
3
- Version: 0.2.2.post3
3
+ Version: 0.2.2.post4
4
4
  Summary: Api for anime-sama
5
5
  Project-URL: Repository, https://github.com/Sky-NiniKo/anime-sama_api/
6
6
  Author-email: NiniKo <pcninik@gmail.com>
@@ -94,7 +94,7 @@ class Season:
94
94
  ) -> list[str]:
95
95
  functions = re.findall(
96
96
  r"resetListe\(\); *[\n\r]+\t*(.*?)}",
97
- page.html,
97
+ remove_some_js_comments(page.html),
98
98
  re.DOTALL,
99
99
  )[-1]
100
100
  functions_list = split_and_strip(functions, (";", "\n"))[:-1]
@@ -27,10 +27,20 @@ async def find_site_url(
27
27
  if response.is_error:
28
28
  return None
29
29
 
30
- match = re.search(r"href=\"(.+?)\">Accéder à anime-sama", response.text)
30
+ # * Sometimes need to check for the great word "anime-sama" in lowercase or uppercase but if add re.IGNORECASE it will work
31
+ match = re.search(
32
+ r"href=\"(.+?)\">Accéder à Anime-Sama", response.text, re.IGNORECASE
33
+ )
34
+
35
+ # * Ajouter un suive de redirection d'url au match au cas ou le site n'est pas a jour et redirige vers une autre url, puis garder l'url finale
31
36
 
32
37
  if match:
33
- return match.group(1) + "/"
38
+ redirected = await client.get(match.group(1), follow_redirects=False)
39
+ return (
40
+ redirected.headers["location"] + "/"
41
+ if redirected.has_redirect_location
42
+ else match.group(1)
43
+ )
34
44
 
35
45
 
36
46
  @dataclass(frozen=True)
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "anime-sama_api"
7
- version = "0.2.2-3"
7
+ version = "0.2.2-4"
8
8
  description = "Api for anime-sama"
9
9
  authors = [
10
10
  {name = "NiniKo", email = "pcninik@gmail.com"}
@@ -0,0 +1,6 @@
1
+ from anime_sama_api.catalogue import Catalogue
2
+
3
+
4
+ one_piece = Catalogue("https://anime-sama.tv/catalogue/one-piece/")
5
+ mha = Catalogue("https://anime-sama.tv/catalogue/my-hero-academia/")
6
+ gumball = Catalogue("https://anime-sama.tv/catalogue/le-monde-incroyable-de-gumball/")
@@ -0,0 +1,32 @@
1
+ from anime_sama_api.season import Season
2
+
3
+ one_piece = (
4
+ [
5
+ Season(f"https://anime-sama.tv/catalogue/one-piece/saison{i}/")
6
+ for i in range(1, 12)
7
+ ]
8
+ + [
9
+ Season("https://anime-sama.tv/catalogue/one-piece/film/"),
10
+ Season("https://anime-sama.tv/catalogue/one-piece/oav/"),
11
+ Season("https://anime-sama.tv/catalogue/one-piece/saison1hs/"),
12
+ Season("https://anime-sama.tv/catalogue/one-piece/kai/"),
13
+ ]
14
+ + [
15
+ Season(f"https://anime-sama.tv/catalogue/one-piece/kai{i}/")
16
+ for i in range(2, 12)
17
+ ]
18
+ )
19
+ gumball = [
20
+ Season(f"https://anime-sama.tv/catalogue/le-monde-incroyable-de-gumball/saison{i}/")
21
+ for i in range(1, 7)
22
+ ] + [
23
+ Season("https://anime-sama.tv/catalogue/le-monde-incroyable-de-gumball/saison1hs/")
24
+ ]
25
+
26
+ mha = [
27
+ Season(f"https://anime-sama.tv/catalogue/my-hero-academia/saison{i}/")
28
+ for i in range(1, 9)
29
+ ] + [
30
+ Season("https://anime-sama.tv/catalogue/my-hero-academia/film/"),
31
+ Season("https://anime-sama.tv/catalogue/my-hero-academia/oav/"),
32
+ ]
@@ -16,7 +16,7 @@ def test_download():
16
16
  vf=Players(),
17
17
  vostfr=Players(
18
18
  [
19
- "https://s22.anime-sama.si/s2/",
19
+ "https://s22.anime-sama.tv/s2/",
20
20
  ]
21
21
  ),
22
22
  ),
@@ -4,7 +4,7 @@ from anime_sama_api.top_level import AnimeSama
4
4
  from .data import catalogue_data
5
5
 
6
6
  pytest_plugins = ("pytest_asyncio",)
7
- anime_sama = AnimeSama(site_url="https://anime-sama.si/")
7
+ anime_sama = AnimeSama(site_url="https://anime-sama.tv/")
8
8
 
9
9
 
10
10
  @pytest.mark.asyncio(loop_scope="session")
@@ -4,7 +4,7 @@ requires-python = ">=3.10"
4
4
 
5
5
  [[package]]
6
6
  name = "anime-sama-api"
7
- version = "0.2.2.post3"
7
+ version = "0.2.2.post4"
8
8
  source = { editable = "." }
9
9
  dependencies = [
10
10
  { name = "httpx" },
@@ -1,6 +0,0 @@
1
- from anime_sama_api.catalogue import Catalogue
2
-
3
-
4
- one_piece = Catalogue("https://anime-sama.si/catalogue/one-piece/")
5
- mha = Catalogue("https://anime-sama.si/catalogue/my-hero-academia/")
6
- gumball = Catalogue("https://anime-sama.si/catalogue/le-monde-incroyable-de-gumball/")
@@ -1,32 +0,0 @@
1
- from anime_sama_api.season import Season
2
-
3
- one_piece = (
4
- [
5
- Season(f"https://anime-sama.si/catalogue/one-piece/saison{i}/")
6
- for i in range(1, 12)
7
- ]
8
- + [
9
- Season("https://anime-sama.si/catalogue/one-piece/film/"),
10
- Season("https://anime-sama.si/catalogue/one-piece/oav/"),
11
- Season("https://anime-sama.si/catalogue/one-piece/saison1hs/"),
12
- Season("https://anime-sama.si/catalogue/one-piece/kai/"),
13
- ]
14
- + [
15
- Season(f"https://anime-sama.si/catalogue/one-piece/kai{i}/")
16
- for i in range(2, 12)
17
- ]
18
- )
19
- gumball = [
20
- Season(f"https://anime-sama.si/catalogue/le-monde-incroyable-de-gumball/saison{i}/")
21
- for i in range(1, 7)
22
- ] + [
23
- Season("https://anime-sama.si/catalogue/le-monde-incroyable-de-gumball/saison1hs/")
24
- ]
25
-
26
- mha = [
27
- Season(f"https://anime-sama.si/catalogue/my-hero-academia/saison{i}/")
28
- for i in range(1, 9)
29
- ] + [
30
- Season("https://anime-sama.si/catalogue/my-hero-academia/film/"),
31
- Season("https://anime-sama.si/catalogue/my-hero-academia/oav/"),
32
- ]