I am in the EU and trying to get this script working, I have changed the curl URL's from us1 to eu1 which does some progress by finding the amount of seasons in that show, but still no episodes. I have to use the /it/ suffix on yt-dlp
GRAB FIRST DUMP OF JSON SO WE CAN SET THE SHOW_ID VARIABLE
Hello,
I am in the EU and trying to get this script working, I have changed the curl URL's from us1 to eu1 which does some progress by finding the amount of seasons in that show, but still no episodes. I have to use the /it/ suffix on yt-dlp
GRAB FIRST DUMP OF JSON SO WE CAN SET THE SHOW_ID VARIABLE
SHOW_JSON_FIRST=$( curl -s "https://eu1-prod-direct.discoveryplus.com/cms/routes/show/${URL_SLUG}?include=default&decorators=viewingHistory,isFavorite,playbackAllowed" \ -H 'authority: eu1-prod-direct.discoveryplus.com' \ -H 'x-disco-client: WEB:UNKNOWN:dplus_us:1.8.0' \ -H 'x-disco-params: realm=go,siteLookupKey=dplus_us,features=ar' \ -H 'accept: /' \ -H 'accept-language: en-us,en;q=0.9' \ --cookie "${COOKIE_FILE}" )
USING THE SHOW_JSON_FIRST DUMP, WE CAN EXTRACT THE SHOW_ID & SHOW_SEASON_COUNT
SHOW_ID=$(echo "$SHOW_JSON_FIRST" | jq -r '.included[].attributes.component.mandatoryParams' | grep -Eo '^pf.$' | head -n1 | sed -e 's#pf[show.id]\=##' | sed -e 's/&.$//g') SHOW_SEASON_COUNT=$(echo "$SHOW_JSON_FIRST" | jq -r '.included[]? | .attributes.component.filters | values' | grep -Eo 'pf[seasonNumber].*$' | sed -e 's#pf[seasonNumber]=##g' -e 's#",##g')
NOW WE'LL LOOP THRU EACH SEASON TO GRAB ALL EPISODE URLS AND PUT THEM IN INPUT_URLS.txt
for SEASON_NUMBER in $(echo "$SHOW_SEASON_COUNT"); do curl -s "https://eu1-prod-direct.discoveryplus.com/cms/collections/89438300356657080631189351362572714453?include=default&decorators=viewingHistory,isFavorite,playbackAllowed&pf\[seasonNumber\]=${SEASON_NUMBER}&pf\[show.id\]=${SHOW_ID}" \ -H 'authority: eu1-prod-direct.discoveryplus.com' \ -H 'x-disco-client: WEB:UNKNOWN:dplus_us:prod' \ -H 'x-disco-params: realm=go,siteLookupKey=dplus_us,features=ar' \ -H 'referer: https://www.discoveryplus.com/it/' \ -H 'accept-language: en' \ --cookie "${COOKIE_FILE}" | jq -r '.included[]? | .attributes | .path' | sed -e 's#null##g' -e '/^$/d' | sed -e 's#^#https://www.discoveryplus.com/it/video/#g' >> "$EPISODE_URL_LIST" done