diff --git a/anchor/.env.sample b/anchor/.env.sample index eaccd8d..06c97ae 100644 --- a/anchor/.env.sample +++ b/anchor/.env.sample @@ -2,5 +2,6 @@ OPENPODCAST_API_ENDPOINT=https://api.openpodcast.dev OPENPODCAST_API_TOKEN= ANCHOR_BASE_URL=https://podcasters.spotify.com/pod/api/proxy/v3 +ANCHOR_BASE_GRAPHQL_URL=https://creators.spotify.com/pod/graphql ANCHOR_PW_S= ANCHOR_WEBSTATION_ID= diff --git a/anchor/job/__main__.py b/anchor/job/__main__.py index 6af440f..fe5c9b4 100644 --- a/anchor/job/__main__.py +++ b/anchor/job/__main__.py @@ -29,6 +29,8 @@ "ANCHOR_BASE_URL", "https://podcasters.spotify.com/pod/api/proxy/v3" ) +BASE_GRAPHQL_URL = os.environ.get("ANCHOR_BASE_GRAPHQL_URL", "https://creators.spotify.com/pod/graphql") + # Anchor webstation ID which represents the podcast, which we fetch data for ANCHOR_WEBSTATION_ID = load_file_or_env("ANCHOR_WEBSTATION_ID") @@ -73,6 +75,7 @@ anchor = AnchorConnector( base_url=BASE_URL, + base_graphql_url=BASE_GRAPHQL_URL, webstation_id=ANCHOR_WEBSTATION_ID, anchorpw_s=ANCHOR_PW_S, ) @@ -181,6 +184,15 @@ def episode_all_time_video_data(connector, web_episode_id): start_date=date_range.start, end_date=date_range.end, ), + FetchParams( + openpodcast_endpoint="impressions", + anchor_call=get_request_lambda( + anchor.impressions, + date_range.end + ), + start_date=date_range.start, + end_date=date_range.end, + ), FetchParams( openpodcast_endpoint="totalPlaysByEpisode", anchor_call=anchor.total_plays_by_episode, diff --git a/anchor/requirements.txt b/anchor/requirements.txt index 9fd6f4f..be60205 100644 --- a/anchor/requirements.txt +++ b/anchor/requirements.txt @@ -1,4 +1,4 @@ -anchorconnector==0.4.0 +anchorconnector==0.5.0 certifi==2022.12.7 charset-normalizer==3.1.0 idna==3.4