POL_GoG_checklogin

Informations

Créateur Messages
Ground0

Information

Cet installateur a été accepté par l'équipe.

Informations

Plate-formes :
Téléchargements : 6259
Wine: System

Retours d'expérience

Description

It checks if a login cookie exists and if it exists try if the session is still valid. If this still true set GOG_LOGIN to Ok else where to False

Code source

#!/usr/bin/env playonlinux-bash
 
# CHANGELOG
# [Ground0] (2016-02-18 08:15)
#   Initial Version
#
# Date : (2016-02-18 08:15)
# Last revision : (2016-02-18 08:15)
# Distribution used to test : OpenSUSE Tumbleweed / openSUSE Leap 42.1 / OS X 10.11.2
# Author : René Linder rene.linder@lihaso.ch
# Script licence : GPL v.2
# Depend :
 
#############################################
#
# Login Check function
#
# The Cookie:
#
 
COOKIES_FINAL="$POL_USER_ROOT/tmp/gog_cookie_logedin"
 
#
# Check if the session Cookie is exsist.
#
 
[ ! -f "$COOKIES_FINAL" ] && unset GOG_LOGIN && POL_Debug_Message "No GOG Cookie exists" && break
fi
 
#
# Check if the session Cookie is valid.
#
# Call  to https://www.gog.com/userData.json to recheck the cookie
USER_AGENT="Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/48.0.2564.82 Safari/537.36"
 
$POL_WGET https://www.gog.com/userData.json -O- --keep-session-cookies --save-cookies=$COOKIES_FINAL --load-cookies=$COOKIES_FINAL --referer=https://www.gog.com/ --user-agent="$USER_AGENT"
 
#
# If the Session is still valid gog-al still exists else where it is now removed.
#
 
AUTH_SESSION="$(awk '$6 == "gog-al" { print $7 }' $COOKIES_FINAL)"
[ "$AUTH_SESSION" != "" ] && GOG_LOGIN="Ok" && POL_Debug_Message "GoG Session cookie exists and is valid" && break
 
POL_Debug_Message "GoG Session cookie exists but is not valid"
unset GOG_LOGIN
break

Contributions

Filters:

Contribuer
Membre Messages
Ground0 Jeudi 18 Février 2016 à 16:55
Ground0

Information

Cette mise à jour a été acceptée par l'équipe

Differences

@@ -0,0 +1,47 @@
+#!/usr/bin/env playonlinux-bash
+ 
+# CHANGELOG
+# [Ground0] (2016-02-18 08:15)
+#   Initial Version
+#
+# Date : (2016-02-18 08:15)
+# Last revision : (2016-02-18 08:15)
+# Distribution used to test : OpenSUSE Tumbleweed / openSUSE Leap 42.1 / OS X 10.11.2
+# Author : René Linder rene.linder@lihaso.ch
+# Script licence : GPL v.2
+# Depend :
+ 
+#############################################
+#
+# Login Check function
+#
+# The Cookie:
+#
+ 
+COOKIES_FINAL="$POL_USER_ROOT/tmp/gog_cookie_logedin"
+ 
+#
+# Check if the session Cookie is exsist.
+#
+ 
+[ ! -f "$COOKIES_FINAL" ] && unset GOG_LOGIN && POL_Debug_Message "No GOG Cookie exists" && break
+fi
+ 
+#
+# Check if the session Cookie is valid.
+#
+# Call  to https://www.gog.com/userData.json to recheck the cookie
+USER_AGENT="Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/48.0.2564.82 Safari/537.36"
+ 
+$POL_WGET https://www.gog.com/userData.json -O- --keep-session-cookies --save-cookies=$COOKIES_FINAL --load-cookies=$COOKIES_FINAL --referer=https://www.gog.com/ --user-agent="$USER_AGENT"
+ 
+#
+# If the Session is still valid gog-al still exists else where it is now removed.
+#
+ 
+AUTH_SESSION="$(awk '$6 == "gog-al" { print $7 }' $COOKIES_FINAL)"
+[ "$AUTH_SESSION" != "" ] && GOG_LOGIN="Ok" && POL_Debug_Message "GoG Session cookie exists and is valid" && break
+ 
+POL_Debug_Message "GoG Session cookie exists but is not valid"
+unset GOG_LOGIN
+break
\ No newline at end of file

Nouveau code source

#!/usr/bin/env playonlinux-bash
 
# CHANGELOG
# [Ground0] (2016-02-18 08:15)
#   Initial Version
#
# Date : (2016-02-18 08:15)
# Last revision : (2016-02-18 08:15)
# Distribution used to test : OpenSUSE Tumbleweed / openSUSE Leap 42.1 / OS X 10.11.2
# Author : René Linder rene.linder@lihaso.ch
# Script licence : GPL v.2
# Depend :
 
#############################################
#
# Login Check function
#
# The Cookie:
#
 
COOKIES_FINAL="$POL_USER_ROOT/tmp/gog_cookie_logedin"
 
#
# Check if the session Cookie is exsist.
#
 
[ ! -f "$COOKIES_FINAL" ] && unset GOG_LOGIN && POL_Debug_Message "No GOG Cookie exists" && break
fi
 
#
# Check if the session Cookie is valid.
#
# Call  to https://www.gog.com/userData.json to recheck the cookie
USER_AGENT="Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/48.0.2564.82 Safari/537.36"
 
$POL_WGET https://www.gog.com/userData.json -O- --keep-session-cookies --save-cookies=$COOKIES_FINAL --load-cookies=$COOKIES_FINAL --referer=https://www.gog.com/ --user-agent="$USER_AGENT"
 
#
# If the Session is still valid gog-al still exists else where it is now removed.
#
 
AUTH_SESSION="$(awk '$6 == "gog-al" { print $7 }' $COOKIES_FINAL)"
[ "$AUTH_SESSION" != "" ] && GOG_LOGIN="Ok" && POL_Debug_Message "GoG Session cookie exists and is valid" && break
 
POL_Debug_Message "GoG Session cookie exists but is not valid"
unset GOG_LOGIN
break

Réponses

Ground0 Jeudi 18 Février 2016 à 8:21
Ground0

Warning

Cette mise à jour n'a pas été approuvée par l'équipe.
Utilisez-la à vos risques et périls

Differences

@@ -0,0 +1,47 @@
+#!/usr/bin/env playonlinux-bash
+
+# CHANGELOG
+# [Ground0] (2016-02-18 08:15)
+#   Initial Version
+#
+# Date : (2016-02-18 08:15)
+# Last revision : (2016-02-18 08:15)
+# Distribution used to test : OpenSUSE Tumbleweed / openSUSE Leap 42.1 / OS X 10.11.2
+# Author : René Linder rene.linder@lihaso.ch
+# Script licence : GPL v.2
+# Depend :
+
+#############################################
+#
+# Login Check function 
+#
+# The Cookie:
+#
+
+COOKIES_FINAL="$POL_USER_ROOT/tmp/gog_cookie_logedin"
+
+#
+# Check if the session Cookie is exsist.
+#
+
+[ ! -f "$COOKIES_FINAL" ] && GOG_LOGIN="False" && POL_Debug_Message "No GOG Cookie exists" && break
+fi
+
+#
+# Check if the session Cookie is valid.
+#
+# Call  to https://www.gog.com/userData.json to recheck the cookie
+USER_AGENT="Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/48.0.2564.82 Safari/537.36"
+
+$POL_WGET https://www.gog.com/userData.json -O- --keep-session-cookies --save-cookies=$COOKIES_FINAL --load-cookies=$COOKIES_FINAL --referer=https://www.gog.com/ --user-agent="$USER_AGENT"
+
+#
+# If the Session is still valid gog-al still exists else where it is now removed.
+# 
+
+AUTH_SESSION="$(awk '$6 == "gog-al" { print $7 }' $COOKIES_FINAL)"
+[ "$AUTH_SESSION" != "" ] && GOG_LOGIN="Ok" && POL_Debug_Message "GoG Session cookie exists and is valid" && break
+
+POL_Debug_Message "GoG Session cookie exists but is not valid"
+GOG_LOGIN="False"
+break

Nouveau code source

#!/usr/bin/env playonlinux-bash

# CHANGELOG
# [Ground0] (2016-02-18 08:15)
#   Initial Version
#
# Date : (2016-02-18 08:15)
# Last revision : (2016-02-18 08:15)
# Distribution used to test : OpenSUSE Tumbleweed / openSUSE Leap 42.1 / OS X 10.11.2
# Author : René Linder rene.linder@lihaso.ch
# Script licence : GPL v.2
# Depend :

#############################################
#
# Login Check function 
#
# The Cookie:
#

COOKIES_FINAL="$POL_USER_ROOT/tmp/gog_cookie_logedin"

#
# Check if the session Cookie is exsist.
#

[ ! -f "$COOKIES_FINAL" ] && GOG_LOGIN="False" && POL_Debug_Message "No GOG Cookie exists" && break
fi

#
# Check if the session Cookie is valid.
#
# Call  to https://www.gog.com/userData.json to recheck the cookie
USER_AGENT="Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/48.0.2564.82 Safari/537.36"

$POL_WGET https://www.gog.com/userData.json -O- --keep-session-cookies --save-cookies=$COOKIES_FINAL --load-cookies=$COOKIES_FINAL --referer=https://www.gog.com/ --user-agent="$USER_AGENT"

#
# If the Session is still valid gog-al still exists else where it is now removed.
# 

AUTH_SESSION="$(awk '$6 == "gog-al" { print $7 }' $COOKIES_FINAL)"
[ "$AUTH_SESSION" != "" ] && GOG_LOGIN="Ok" && POL_Debug_Message "GoG Session cookie exists and is valid" && break

POL_Debug_Message "GoG Session cookie exists but is not valid"
GOG_LOGIN="False"
break

Réponses