def get_episodes(self, anime_id, page=1): res = requests.get( f"{self.base_url}/anime/{anime_id}/episodes?page={page}", ) if res.status_code != 200: raise utils.HttpError(res.status_code) return res.json()
def get_show_episodes(self, show_id): res = requests.get( f"{self.base_url}/shows/{show_id}/episodes?specials=1") if res.status_code != 200: raise utils.HttpError(res.status_code) return res.json()
def get_changes(self, page=1): res = requests.get( f"{self.base_url}/movie/changes?page={page}", headers=self.headers, ) if res.status_code != 200: raise utils.HttpError(res.status_code) return res.json()
def get_item(self, movie_id): res = requests.get( f"{self.base_url}/movie/{movie_id}", headers=self.headers, ) if res.status_code != 200: raise utils.HttpError(res.status_code) return res.json()
def test_post_item_tvmaze_error(m_ep_count, token, client): m_ep_count.side_effect = utils.HttpError(503) response = client.post("/watch-histories/items", headers={"Authorization": token}, json={ "item_api_id": TEST_SHOW_ID, "api_name": "tvmaze" }) assert response.status_code == 503
def get_schedules(self, day_of_week): res = requests.get(f"{self.base_url}/schedules?filer={day_of_week}", ) if res.status_code != 200: raise utils.HttpError(res.status_code) return res.json()
def get_item(self, anime_id): res = requests.get(f"{self.base_url}/anime/{anime_id}", ) if res.status_code != 200: raise utils.HttpError(res.status_code) return res.json()
def get_day_updates(self): res = requests.get(f"{self.base_url}/updates/shows?since=day") if res.status_code != 200: raise utils.HttpError(res.status_code) return res.json()
def get_episode(self, episode_id): res = requests.get(f"{self.base_url}/episodes/{episode_id}") if res.status_code != 200: raise utils.HttpError(res.status_code) return res.json()
def get_item(self, show_id): res = requests.get(f"{self.base_url}/shows/{show_id}") if res.status_code != 200: raise utils.HttpError(res.status_code) return res.json()