11import logging
22from typing import TYPE_CHECKING
33
4- from .....core .utils .graphql import execute_graphql_query_with_get_request
4+ from .....core .utils .graphql import execute_graphql
55from ..base import BaseAnimeProvider
66from ..utils .debug import debug_provider
77from .constants import (
88 ANIME_GQL ,
99 API_GRAPHQL_ENDPOINT ,
10+ API_GRAPHQL_HEADERS ,
1011 API_GRAPHQL_REFERER ,
1112 EPISODE_GQL ,
1213 SEARCH_GQL ,
@@ -26,7 +27,7 @@ class AllAnime(BaseAnimeProvider):
2627
2728 @debug_provider
2829 def search (self , params ):
29- response = execute_graphql_query_with_get_request (
30+ response = execute_graphql (
3031 API_GRAPHQL_ENDPOINT ,
3132 self .client ,
3233 SEARCH_GQL ,
@@ -41,24 +42,26 @@ def search(self, params):
4142 "translationtype" : params .translation_type ,
4243 "countryorigin" : params .country_of_origin ,
4344 },
45+ headers = API_GRAPHQL_HEADERS
4446 )
4547 return map_to_search_results (response )
4648
4749 @debug_provider
4850 def get (self , params ):
49- response = execute_graphql_query_with_get_request (
51+ response = execute_graphql (
5052 API_GRAPHQL_ENDPOINT ,
5153 self .client ,
5254 ANIME_GQL ,
5355 variables = {"showId" : params .id },
56+ headers = API_GRAPHQL_HEADERS
5457 )
5558 return map_to_anime_result (response )
5659
5760 @debug_provider
5861 def episode_streams (self , params ):
5962 from .extractors import extract_server
6063
61- episode_response = execute_graphql_query_with_get_request (
64+ episode_response = execute_graphql (
6265 API_GRAPHQL_ENDPOINT ,
6366 self .client ,
6467 EPISODE_GQL ,
@@ -67,6 +70,7 @@ def episode_streams(self, params):
6770 "translationType" : params .translation_type ,
6871 "episodeString" : params .episode ,
6972 },
73+ headers = API_GRAPHQL_HEADERS
7074 )
7175 episode : AllAnimeEpisode = episode_response .json ()["data" ]["episode" ]
7276 for source in episode ["sourceUrls" ]:
0 commit comments