lots of changes after a lot of time
This commit is contained in:
31
grpoppro
31
grpoppro
@@ -30,15 +30,30 @@ UP_IN_REQ="Upgrade-Insecure-Requests: 1"
|
||||
### Enf of curl constants
|
||||
## End of definitions
|
||||
|
||||
# Display a message
|
||||
function message {
|
||||
if [[ "$INTERACTIVE" == "on" ]]; then
|
||||
notify-send -t 2000 "$1"
|
||||
else
|
||||
echo -e "\n\t$1"
|
||||
fi
|
||||
}
|
||||
|
||||
# Standard curl request
|
||||
function curlRequest {
|
||||
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" \
|
||||
-H "$ACCEPT" \
|
||||
-H "$ACCEPT_LANGUAGE" \
|
||||
-H "$CONNECTION" \
|
||||
-H "$UP_IN_REQ" \
|
||||
"$@"
|
||||
)"
|
||||
if [[ $? -ne 0 ]]; then
|
||||
message "Error: Failed to execute curl request."
|
||||
exit 1
|
||||
fi
|
||||
echo "$response"
|
||||
}
|
||||
|
||||
# Print usage information
|
||||
@@ -56,22 +71,14 @@ function getFzfForTermux {
|
||||
fi
|
||||
}
|
||||
|
||||
# Display a message
|
||||
function message {
|
||||
if [[ "$INTERACTIVE" == "on" ]]; then
|
||||
notify-send -t 2000 "$1"
|
||||
else
|
||||
echo -e "\n\t$1"
|
||||
fi
|
||||
}
|
||||
|
||||
# Retrieve IMDb ID
|
||||
function getIMDBID {
|
||||
imdbid="$(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" \
|
||||
-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"
|
||||
)"
|
||||
imdbid="$(echo "$response" | 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/"//')"
|
||||
if ! [[ "$imdbid" == *"tt"* ]]; then
|
||||
message "Film or show not found in imdb"
|
||||
|
||||
Reference in New Issue
Block a user