diff --git a/grpoppro b/grpoppro index b25c96f..d9dc63e 100755 --- a/grpoppro +++ b/grpoppro @@ -21,6 +21,8 @@ MPV_OPTS='--vo=gpu \ --no-ytdl \ --http-header-fields="User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:133.0) Gecko/20100101 Firefox/133.0" \ --fs' +USER_AGENT="Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:133.0) Gecko/20100101 Firefox/133.0" +ACCEPT="text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8" ## End of definitions # Print usage information @@ -50,8 +52,8 @@ function message { # Retrieve IMDb ID function getIMDBID { imdbid="$(curl -s -L -c "$GRPOPPRO_COOKIE_FILE" -b "$GRPOPPRO_COOKIE_FILE" \ - -A "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:133.0) Gecko/20100101 Firefox/133.0" \ - -H "Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8" \ + -A "$USER_AGENT" \ + -H "Accept: $ACCEPT" \ "https://www.imdb.com/find/?q=$title" | grep -io ' href=['"'"'"][^"'"'"']*['"'"'"]' | grep 'href="/title/'| head -n1 | sed -e 's/href="\/title\///' -e 's/\/?.*//' -e 's/^ //' )" # imdbid="$(curl -s "http://imdb.konsthol.eu/find?q=$title" | grep -io ' href=['"'"'"][^"'"'"']*['"'"'"]' | grep title | head -n1 | sed -e 's/^ //' -e 's/href="\/title\///' -e 's/"//')" @@ -72,8 +74,8 @@ function basics { # Retrieve internal ID function getInternalID { response="$(curl -s -L -c "$GRPOPPRO_COOKIE_FILE" -b "$GRPOPPRO_COOKIE_FILE" \ - -A "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:133.0) Gecko/20100101 Firefox/133.0" \ - -H "Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8" \ + -A "$USER_AGENT" \ + -H "Accept: $ACCEPT" \ -H "Accept-Language: en-US,en;q=0.5" \ -H "Connection: keep-alive" \ -H "Upgrade-Insecure-Requests: 1" \ @@ -90,7 +92,7 @@ function getInternalID { function getMovieStreamUrl { PHPSESSID="$(grep 'PHPSESSID' "$GRPOPPRO_COOKIE_FILE" | awk '{print $NF}')" streamurl="$(curl -s -L -c "$GRPOPPRO_COOKIE_FILE" -b "$GRPOPPRO_COOKIE_FILE" "$apiurl/engine/ajax/controller.php" --compressed -X POST \ - -H 'User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:133.0) Gecko/20100101 Firefox/133.0' \ + -H "$USER_AGENT" \ -H 'Accept: application/json, text/javascript, */*; q=0.01' \ -H 'Accept-Language: en-US,en;q=0.5' \ -H 'Accept-Encoding: gzip, deflate, br, zstd' \ @@ -156,8 +158,8 @@ function menuSearch { simpleurl="$apiurl/embed/$imdbid/" getInternalID "$simpleurl" response="$(curl -s -L -c "$GRPOPPRO_COOKIE_FILE" -b "$GRPOPPRO_COOKIE_FILE" \ - -A "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:133.0) Gecko/20100101 Firefox/133.0" \ - -H "Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8" \ + -A "$USER_AGENT" \ + -H "Accept: $ACCEPT" \ -H "Accept-Language: en-US,en;q=0.5" \ -H "Connection: keep-alive" \ -H "Upgrade-Insecure-Requests: 1" \ @@ -166,6 +168,7 @@ function menuSearch { echo "$response" > "$GRPOPPRO_PLAYLIST_FILE" title="$(grep "mp4" "$GRPOPPRO_PLAYLIST_FILE" | head -n1 | awk -F/ '{print $(NF-1)}')" title="${title//_/ }" + title="${title//-/ }" seasonEpisode="$(grep "mp4" "$GRPOPPRO_PLAYLIST_FILE" | awk -F\" '{print $8}' | awk -F/ '{print $NF}' | awk -F. '{print $1}' | eval "$menu"\""$title" \")" if [[ -z "$seasonEpisode" ]]; then message "Nothing Selected" @@ -226,8 +229,8 @@ function resumeSeries { simpleurl="$apiurl/embed/$imdbid/" getInternalID "$simpleurl" response="$(curl -s -L -c "$GRPOPPRO_COOKIE_FILE" -b "$GRPOPPRO_COOKIE_FILE" \ - -A "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:133.0) Gecko/20100101 Firefox/133.0" \ - -H "Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8" \ + -A "$USER_AGENT" \ + -H "Accept: $ACCEPT" \ -H "Accept-Language: en-US,en;q=0.5" \ -H "Connection: keep-alive" \ -H "Upgrade-Insecure-Requests: 1" \ @@ -316,8 +319,8 @@ if [[ "$#" -eq 3 ]]; then season="$2" episode="$3" streamurl="$(curl -s -L -c "$GRPOPPRO_COOKIE_FILE" -b "$GRPOPPRO_COOKIE_FILE" \ - -A "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:133.0) Gecko/20100101 Firefox/133.0" \ - -H "Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8" \ + -A "$USER_AGENT" \ + -H "Accept: $ACCEPT" \ -H "Accept-Language: en-US,en;q=0.5" \ -H "Connection: keep-alive" \ -H "Upgrade-Insecure-Requests: 1" \