diff --git a/grpoppro b/grpoppro index 8fecc06..b820165 100755 --- a/grpoppro +++ b/grpoppro @@ -19,7 +19,6 @@ CONNECTION="Connection: keep-alive" UP_IN_REQ="Upgrade-Insecure-Requests: 1" ### End of curl constants player="mpv" - # --no-load-scripts \ MPV_OPTS='--vo=gpu \ --gpu-api=opengl \ --opengl-es=yes \ @@ -109,24 +108,11 @@ function curlRequest { ) # "-H $UP_IN_REQ" - # log_string=$(printf "curl -s -L \n -c %s \n -b %s \n %s \n --compressed \n -X %s \n -A %s \n -H %s \n -H %s \n -H %s \n -H %s \n %s \n" \ - # "$GRPOPPRO_COOKIE_FILE" \ - # "$GRPOPPRO_COOKIE_FILE" \ - # "$url" \ - # "$custom_method" \ - # "$USER_AGENT" \ - # "$custom_accept" \ - # "$ACCEPT_LANGUAGE" \ - # "$CONNECTION" \ - # "$UP_IN_REQ" \ - # "$@") - { echo -e "<===========================\n" echo "Called by: ${FUNCNAME[1]}" echo "" echo -e "$(date '+%d-%m-%Y %H:%M:%S') -> ${curl_command[5]}\n" - # echo -e "$log_string" printf "%s\n" "${curl_command[@]}" echo "" echo -e "===========================>\n" @@ -244,7 +230,7 @@ function play { player="mpv --save-position-on-quit ${MPV_OPTS}" fi [[ "$OSTYPE" != "linux-gnu" ]] && INTERACTIVE="off" && streamurl="${streamurl//https/http}" - # No setsid -f here because menu function goes from play to resume + # No setsid -f here because we need to wait for mpv to finish eval "$player" "$streamurl" } @@ -405,7 +391,7 @@ function resumeUnfinishedEpisode { player="mpv --resume-playback ${MPV_OPTS}" fi [[ "$OSTYPE" != "linux-gnu" ]] && INTERACTIVE="off" && streamurl="${streamurl//https/http}" - # No setsid -f here because menu function goes from play to resume + # No setsid -f here because we need to wait for mpv to finish eval "$player" "$streamurl" resume } @@ -446,7 +432,7 @@ fi # One arguement and it contains the imdb id # Two requests to the api -if [[ "$1" == *"tt"* ]] && [[ "$#" -eq 1 ]] && [[ "$1" != "--menu" ]] && [[ "$1" != "--resume" ]] && [[ "$1" != "--select" ]]; then +if [[ "$1" == *"tt"* ]] && [[ "$#" -eq 1 ]] && [[ "$1" != "--menu" ]] && [[ "$1" != "--resume" ]] && [[ "$1" != "--finish" ]] && [[ "$1" != "--select" ]]; then simpleurl="$1" getInternalID "$simpleurl" getMovieStreamUrl "$internalid" @@ -474,7 +460,7 @@ if [[ "$#" -eq 3 ]]; then fi # Movies URL -if [[ "$#" -eq 1 ]] && [[ "$1" != "--menu" ]] && [[ "$1" != "--resume" ]] && [[ "$1" != "--select" ]]; then +if [[ "$#" -eq 1 ]] && [[ "$1" != "--menu" ]] && [[ "$1" != "--resume" ]] && [[ "$1" != "--finish" ]] && [[ "$1" != "--select" ]]; then # Two requests to the api basics "$1" # Gets the title, performs one request to imdb and gets the complete url getInternalID "$simpleurl" # Gets the complete url and performs one request to get the internal id or inform us it does not exist