Improving the fix
This commit is contained in:
61
grpoppro
61
grpoppro
@@ -21,10 +21,26 @@ MPV_OPTS='--vo=gpu \
|
|||||||
--no-ytdl \
|
--no-ytdl \
|
||||||
--http-header-fields="User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:133.0) Gecko/20100101 Firefox/133.0" \
|
--http-header-fields="User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:133.0) Gecko/20100101 Firefox/133.0" \
|
||||||
--fs'
|
--fs'
|
||||||
|
### Curl constants
|
||||||
USER_AGENT="Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:133.0) Gecko/20100101 Firefox/133.0"
|
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"
|
ACCEPT="Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8"
|
||||||
|
ACCEPT_LANGUAGE="Accept-Language: en-US,en;q=0.5"
|
||||||
|
CONNECTION="Connection: keep-alive"
|
||||||
|
UP_IN_REQ="Upgrade-Insecure-Requests: 1"
|
||||||
|
### Enf of curl constants
|
||||||
## End of definitions
|
## End of definitions
|
||||||
|
|
||||||
|
# Standard curl request
|
||||||
|
function curlRequest {
|
||||||
|
curl -s -L -c "$GRPOPPRO_COOKIE_FILE" -b "$GRPOPPRO_COOKIE_FILE" \
|
||||||
|
-A "$USER_AGENT" \
|
||||||
|
-H "$ACCEPT" \
|
||||||
|
-H "$ACCEPT_LANGUAGE" \
|
||||||
|
-H "$CONNECTION" \
|
||||||
|
-H "$UP_IN_REQ" \
|
||||||
|
"$@"
|
||||||
|
}
|
||||||
|
|
||||||
# Print usage information
|
# Print usage information
|
||||||
function usage {
|
function usage {
|
||||||
echo -e "\n\tUsage:\n\n\t$(basename "$0") \"name of film or show\" [season] [episode(ex 01 02 .. 10 11)]"
|
echo -e "\n\tUsage:\n\n\t$(basename "$0") \"name of film or show\" [season] [episode(ex 01 02 .. 10 11)]"
|
||||||
@@ -53,7 +69,7 @@ function message {
|
|||||||
function getIMDBID {
|
function getIMDBID {
|
||||||
imdbid="$(curl -s -L -c "$GRPOPPRO_COOKIE_FILE" -b "$GRPOPPRO_COOKIE_FILE" \
|
imdbid="$(curl -s -L -c "$GRPOPPRO_COOKIE_FILE" -b "$GRPOPPRO_COOKIE_FILE" \
|
||||||
-A "$USER_AGENT" \
|
-A "$USER_AGENT" \
|
||||||
-H "Accept: $ACCEPT" \
|
-H "$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/^ //'
|
"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/"//')"
|
# 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/"//')"
|
||||||
@@ -73,14 +89,7 @@ function basics {
|
|||||||
|
|
||||||
# Retrieve internal ID
|
# Retrieve internal ID
|
||||||
function getInternalID {
|
function getInternalID {
|
||||||
response="$(curl -s -L -c "$GRPOPPRO_COOKIE_FILE" -b "$GRPOPPRO_COOKIE_FILE" \
|
response="$(curlRequest "$simpleurl")"
|
||||||
-A "$USER_AGENT" \
|
|
||||||
-H "Accept: $ACCEPT" \
|
|
||||||
-H "Accept-Language: en-US,en;q=0.5" \
|
|
||||||
-H "Connection: keep-alive" \
|
|
||||||
-H "Upgrade-Insecure-Requests: 1" \
|
|
||||||
"$simpleurl"
|
|
||||||
)"
|
|
||||||
if echo "$response" | grep -q "id='el-content'></div>"; then
|
if echo "$response" | grep -q "id='el-content'></div>"; then
|
||||||
message "No file found"
|
message "No file found"
|
||||||
exit 0
|
exit 0
|
||||||
@@ -92,16 +101,16 @@ function getInternalID {
|
|||||||
function getMovieStreamUrl {
|
function getMovieStreamUrl {
|
||||||
PHPSESSID="$(grep 'PHPSESSID' "$GRPOPPRO_COOKIE_FILE" | awk '{print $NF}')"
|
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 \
|
streamurl="$(curl -s -L -c "$GRPOPPRO_COOKIE_FILE" -b "$GRPOPPRO_COOKIE_FILE" "$apiurl/engine/ajax/controller.php" --compressed -X POST \
|
||||||
-H "$USER_AGENT" \
|
-A "$USER_AGENT" \
|
||||||
-H 'Accept: application/json, text/javascript, */*; q=0.01' \
|
-H 'Accept: application/json, text/javascript, */*; q=0.01' \
|
||||||
-H 'Accept-Language: en-US,en;q=0.5' \
|
-H "$ACCEPT_LANGUAGE" \
|
||||||
-H 'Accept-Encoding: gzip, deflate, br, zstd' \
|
-H 'Accept-Encoding: gzip, deflate, br, zstd' \
|
||||||
-H 'Content-Type: application/x-www-form-urlencoded; charset=UTF-8' \
|
-H 'Content-Type: application/x-www-form-urlencoded; charset=UTF-8' \
|
||||||
-H 'X-Requested-With: XMLHttpRequest' \
|
-H 'X-Requested-With: XMLHttpRequest' \
|
||||||
-H "Origin: $apiurl" \
|
-H "Origin: $apiurl" \
|
||||||
-H 'DNT: 1' \
|
-H 'DNT: 1' \
|
||||||
-H 'Sec-GPC: 1' \
|
-H 'Sec-GPC: 1' \
|
||||||
-H 'Connection: keep-alive' \
|
-H "$CONNECTION" \
|
||||||
-H "Referer: $simpleurl" \
|
-H "Referer: $simpleurl" \
|
||||||
-H "Cookie: PHPSESSID=$PHPSESSID" \
|
-H "Cookie: PHPSESSID=$PHPSESSID" \
|
||||||
-H 'Sec-Fetch-Dest: empty' \
|
-H 'Sec-Fetch-Dest: empty' \
|
||||||
@@ -159,10 +168,10 @@ function menuSearch {
|
|||||||
getInternalID "$simpleurl"
|
getInternalID "$simpleurl"
|
||||||
response="$(curl -s -L -c "$GRPOPPRO_COOKIE_FILE" -b "$GRPOPPRO_COOKIE_FILE" \
|
response="$(curl -s -L -c "$GRPOPPRO_COOKIE_FILE" -b "$GRPOPPRO_COOKIE_FILE" \
|
||||||
-A "$USER_AGENT" \
|
-A "$USER_AGENT" \
|
||||||
-H "Accept: $ACCEPT" \
|
-H "$ACCEPT" \
|
||||||
-H "Accept-Language: en-US,en;q=0.5" \
|
-H "$ACCEPT_LANGUAGE" \
|
||||||
-H "Connection: keep-alive" \
|
-H "$CONNECTION" \
|
||||||
-H "Upgrade-Insecure-Requests: 1" \
|
-H "$UP_IN_REQ" \
|
||||||
"$apiurl/uploads/playlists/$internalid.txt"
|
"$apiurl/uploads/playlists/$internalid.txt"
|
||||||
)"
|
)"
|
||||||
echo "$response" > "$GRPOPPRO_PLAYLIST_FILE"
|
echo "$response" > "$GRPOPPRO_PLAYLIST_FILE"
|
||||||
@@ -228,14 +237,7 @@ function resumeSeries {
|
|||||||
getIMDBID "$title"
|
getIMDBID "$title"
|
||||||
simpleurl="$apiurl/embed/$imdbid/"
|
simpleurl="$apiurl/embed/$imdbid/"
|
||||||
getInternalID "$simpleurl"
|
getInternalID "$simpleurl"
|
||||||
response="$(curl -s -L -c "$GRPOPPRO_COOKIE_FILE" -b "$GRPOPPRO_COOKIE_FILE" \
|
response="$(curlRequest "$apiurl/uploads/playlists/$internalid.txt")"
|
||||||
-A "$USER_AGENT" \
|
|
||||||
-H "Accept: $ACCEPT" \
|
|
||||||
-H "Accept-Language: en-US,en;q=0.5" \
|
|
||||||
-H "Connection: keep-alive" \
|
|
||||||
-H "Upgrade-Insecure-Requests: 1" \
|
|
||||||
"$apiurl/uploads/playlists/$internalid.txt"
|
|
||||||
)"
|
|
||||||
echo "$response" > "$GRPOPPRO_PLAYLIST_FILE"
|
echo "$response" > "$GRPOPPRO_PLAYLIST_FILE"
|
||||||
title="$(grep "mp4" "$GRPOPPRO_PLAYLIST_FILE" | head -n1 | awk -F/ '{print $(NF-1)}')"
|
title="$(grep "mp4" "$GRPOPPRO_PLAYLIST_FILE" | head -n1 | awk -F/ '{print $(NF-1)}')"
|
||||||
title="${title//_/ }"
|
title="${title//_/ }"
|
||||||
@@ -318,13 +320,8 @@ if [[ "$#" -eq 3 ]]; then
|
|||||||
getInternalID "$simpleurl"
|
getInternalID "$simpleurl"
|
||||||
season="$2"
|
season="$2"
|
||||||
episode="$3"
|
episode="$3"
|
||||||
streamurl="$(curl -s -L -c "$GRPOPPRO_COOKIE_FILE" -b "$GRPOPPRO_COOKIE_FILE" \
|
response="$(curlRequest "$apiurl/uploads/playlists/$internalid.txt")"
|
||||||
-A "$USER_AGENT" \
|
streamurl="$(echo "$response" | grep "mp4" | grep "${season}x${episode}" | head -n1 | awk -F\" '{print $8}')"
|
||||||
-H "Accept: $ACCEPT" \
|
|
||||||
-H "Accept-Language: en-US,en;q=0.5" \
|
|
||||||
-H "Connection: keep-alive" \
|
|
||||||
-H "Upgrade-Insecure-Requests: 1" \
|
|
||||||
"$apiurl/uploads/playlists/$internalid.txt" | grep "mp4" | grep "${season}x${episode}" | head -n1 | awk -F\" '{print $8}')"
|
|
||||||
play
|
play
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|||||||
Reference in New Issue
Block a user