GoG Galaxy game list with PHP Python and CSV
Posted: Sat Jan 02, 2021 3:11 pm
01-02-2021
gog_games_csv_win10_python_ex1 by kristoffe brodeur
this is a quick demo that worked on 01-02-2021
============================================================================================
my zip file you can open, look at and move your files to C or what have you
please read through where to put the rest. and if you like just download each package with the
links on your own, but links don't last forever, you know.
the script, my php programs, python, apache server, php, VC15 (x86 x64 2017) and instructions
94.3MB
http://supercala.net/phpBB3/_files/win1 ... y-list.zip
============================================================================================
win10
x64
apache server
apache2_4_46x64-vc15
https://home.apache.org/~steffenal/VC15 ... 4-VC15.zip
VC15 (or vs16 is downward compatible for 15 and 14) (2017) binaries
x86
https://aka.ms/vs/16/release/VC_redist.x86.exe
x64
https://download.visualstudio.microsoft ... st.x64.exe
or
https://aka.ms/vs/16/release/VC_redist.x64.exe
php
php7211x64vc15
https://windows.php.net/downloads/relea ... 15-x64.zip
python
387x64
https://www.python.org/downloads/release/python-387/
https://www.python.org/ftp/python/3.8.7 ... -amd64.exe
csv
natsort
python script for gog to csv
galaxy_library_export.py
https://github.com/AB1908/GOG-Galaxy-Export-Script
============================================================================================
-So I installed php 7.x with Apache 2.4.33 x64 with the visual c++ 15 dependencies
-I used win 10 64-bit
-I installed python 3.87 64-bit
-Then I had to add the dependencies for reading and writing CSV files and natsort with the command prompt
-make sure you have python installed
https://www.python.org/downloads/release/python-387/
the installer for x64 (64 bit os of win 10)
https://www.python.org/ftp/python/3.8.7 ... -amd64.exe
-install using the installer
-checkmark [a]Add Python 3.8 to PATH
-customize installation
-next
-change your python location to something shorter and simple like
-BROWSE
-click THIS PC
-(C:) drive
-click [MAKE NEW FOLDER]
python387x64
-click on any other folder then your C drive and the new folder so it registers
-it should now read:
C:\python387x64
-click [OK]
-now click [INSTALL]
-also when done the last window click on
[Disable path length limit]
-click [CLOSE]
whew!
============================================================================================
-open the command prompt to the python folder (or your path has it etc)
-(my python install folder)
c:\python387x64\
-check your python by simply typing:
C:\python387x64>python
-this will show up (something like it)
Python 3.8.7 (tags/v3.8.7:6503f05, Dec 21 2020, 17:59:51) [MSC v.1928 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>>
-exit python back to the command prompt by typing:
exit()
-update the pip.py that allows installing CSV and NATSORT
C:\python387x64\py -m pip install -U pip
-it should read like this somewhat
-------------------------------------------------------------
Collecting pip
Downloading pip-20.3.3-py2.py3-none-any.whl (1.5 MB)
|████████████████████████████████| 1.5 MB 1.6 MB/s
Installing collected packages: pip
Attempting uninstall: pip
Found existing installation: pip 20.2.3
Uninstalling pip-20.2.3:
Successfully uninstalled pip-20.2.3
Successfully installed pip-20.3.3
-------------------------------------------------------------
-now install natsort with pip from the web
C:\python387x64\pip install natsort
-it should read like this somewhat
-------------------------------------------------------------
Collecting natsort
Downloading natsort-7.1.0-py3-none-any.whl (35 kB)
Installing collected packages: natsort
Successfully installed natsort-7.1.0
-------------------------------------------------------------
finished!
============================================================================================
-isntall GOG Galaxy do you have it ready to script to
https://www.gog.com/galaxy
-login and then click DOWNLOAD GOG GALAXY 2.0 on the screen
-run this
GOG_Galaxy_2.0.exe 961kb
-it will download and isntall the actual GOG Galaxy Progam/App 232mb
-install to the default location for now
C:\Program Files (x86)\GOG Galaxy
-launch the program
-login
-you can now click on [onwed games]
-also you can click on the [+] button to the right of [filter]
-there you can login to all your game accounts from epic, ubisoft, steam...
-once you have done that and the slow process of all the IMPORTING *% finsihes...
-it is loading the images for the games and the data I believe
-maybe handshaking each time with each game service as well, so it's slow
-you can run the script to get a nice CSV file of all your games
============================================================================================
-installing apache server if you need to the way I did
-I added the apache server to the zip file
-I added the PHP base to the zip file as well
-I made a folder specific
-apache isntalled and running on my D drive
-folder name
D:\apache2_4_46x64-vc15\
-php installed and running in apache through it's config file in this folder
-folder name
D:\apache2_4_46x64-vc15\php7211x64vc15\
-I put the needed VC2017 (15) installers for win10 as well
VC_redist.x64.exe
VC_redist.x86.exe only for 32-bit versions of win 10 / 32 bit apache
1. install apache like this if you have a D: drive, if not substitute for C:
-create a folder
D:\apache2_4_46x64-vc15\
-open the zip file I have or download the apache file from
https://home.apache.org/~steffenal/VC15 ... 4-VC15.zip
-when the zip is open, copy the contents of the [Apache2] folder into (1300+ files)
D:\apache2_4_46x64-vc15\
-now you can copy the config file I made for this apache and php
-look in my zip for:
apache2_4_46x64-vc15\conf\httpd.conf
-copy that and paste in your conf folder at:
D:\apache2_4_46x64-vc15\conf\
-copy and replace? yes.
-create your htdocs folder to hold your websites, and this fun project
-I use a third drive, my U: drive
-if you use one drive total in your PC, use C:
-I use the D: drive for the actual apache server and I have U for projects, the htdocs
-you can use BOTH [htdocs] and the [apache2_4_46x64-vc15] in C: if you like
-(if) you did this in C:\ and don't have a D:\ drive you have to fix some paths
-open the httpd.conf file with notepad or notepad++ I added to my zip file for this project
zip > _installers\npp.7.8.8.Installer.x64.exe
-notepad++ 7.8.8 x64 online
https://github.com/notepad-plus-plus/no ... er.x64.exe
-using ${SRVROOT} as a variable is pretty cool, saves for isntalls on different systems with varying drive letters
-httpd.conf lines (# may vary) to change for your hard drive letter C not D
37 (you choose your install drive letter, these are examples)
Define SRVROOT "D:/apache2_4_46x64-vc15"
Define SRVROOT "c:/apache2_4_46x64-vc15"
39
ServerRoot "D:/apache2_4_46x64-vc15"
ServerRoot "C:/apache2_4_46x64-vc15"
252 (I really like a simple folder to htdocs, I have U for me, maybe C for you if you have a laptop)
DocumentRoot "u:/htdocs"
DocumentRoot "c:/htdocs"
253
<Directory "u:/htdocs">
<Directory "c:/htdocs">
385
<Directory "${SRVROOT}/cgi-bin">
536
LoadModule php7_module "${SRVROOT}/php7211x64vc15/php7apache2_4.dll"
538
PHPIniDir "${SRVROOT}/php7211x64vc15"
2. copy the php files from the zip I made, or your own download of PHP 7.2.11 into this folder:
-remember your drive letter you chose for the install, (D) for me, maybe (C) for you
D:\apache2_4_33x64-vc15\php7211x64vc15
or
C:\apache2_4_33x64-vc15\php7211x64vc15
-another important thing to do is add the PHP and it's [bin] folder to uour windows PATH
-you can download or use the RapidEE_setup.exe I put in the zip to do this
-install The Rapid Environment Editor and then you can
-press START on windows
-right click on the icon for it
-open file location
-now a shortcut in explorer will show
-right click on the shortcut for it
-open file location
-now you will see RapidEE.exe
-right click on the shortcut for it
-properties
-compatibility tab
-[X]run this program as an administrator
-run the rapid environment editor program
-in system variables on the left side, press the [+] on PATH
-right click the PATH (you just [+] opened)
-add value...
-add both your PHP and it's EXT folders to the path one at a time
-you can even directory browse by pressing F7
-add this
C:\apache2_4_33x64-vc15\php7211x64vc15\
-and again add this
C:\apache2_4_33x64-vc15\php7211x64vc15\ext
-maybe also add python's main folder you added
C:\python387x64
-save by clicking the FLOPPY DISC ICON or FILE>SAVE or CTRL+S
============================================================================================
-now you can install apache with a command prompt as an administrator
-press START on windows
-type CMD
-right click the CMD icon and choose
-run as administrator
c:\WINDOWS\system32\
-remember which hard drive you put apache in C or D
-now type in
cd C:\
cd D:\
etc...
cd D:\apache2_4_46x64-vc15\bin\
or
cd C:\apache2_4_46x64-vc15\bin\
-and install apache as a service like this
httpd.exe -k install
============================================================================================
-I made a programming folder and a python subfolder
c:\programming
c:\programming\python\
-to organize projects in different languages etc
-copy or move galaxy_library_export.py to that folder you made above
-in there you can put the script I found and run it as such:
C:\programming\python>python galaxy_library_export.py
-remember to have natsort installed to python as I listed above if there is an error for it
-your folder at C;\programming\python\ will now have this file:
gameDB.csv
============================================================================================
-using my program in php to read that CSV file works...but...
-you should look for any descriptions of games with <b> or </b> and such and remove that stuff
-make a folder called (in your htdocs hard drive (C) (D) (U) etc )
c:\htdocs\games_list\
-or just copy the folder in my zip [games_list] to your htdocs folder
-copy and replace the gameDB.csv when you're ready
zip > [games_list] to your drive [htdocs][games_list]
-you can just use my gameDB.csv to test it out if you have a GOG problem with the script
-open your firefox, chrome, opera, brave, edge, etc browser and goto:
localhost
-you will see a folder in your server
/games_list
-click on that folder
-you can click on index.php and see the result (note is was designed with 4k in mind)
-in the httpd.conf file we can also make index.php files auto load instead
-editing you apache server to auto laod index.html AND NOW index.php files too
-open c:\apache_2_4_46x64-vs15\conf\httpd.conf
(or D drive etc)
-edit this line by duplicating it
line 286*
DirectoryIndex index.html
-add a new line very similar
DirectoryIndex index.php
-save your httpd.conf file in your editor
-restart apache
-you can make a shortcut for the apache server monitor
-goto here in file explorer
C:\apache2_4_46x64-vc15\bin
-right click on the ApacheMonitor.exe
-properties
-compatibility
[x]Run As Administrator
-[ok]
-left click and drag the ApacheMonitor.exe icon to your task manager bar on the bottom of windows
-left click that new icon
-right click the Apache Monitor icon near the right side of windows, near the clock
-or the down arrow showing more icons, drag them down to your task bar a bit below
-choose
Open Apache monitor
-press
RESTART
voila. easy apache server control with a GUI
============================================================================================
gog_games_csv_win10_python_ex1 by kristoffe brodeur
this is a quick demo that worked on 01-02-2021
============================================================================================
my zip file you can open, look at and move your files to C or what have you
please read through where to put the rest. and if you like just download each package with the
links on your own, but links don't last forever, you know.
the script, my php programs, python, apache server, php, VC15 (x86 x64 2017) and instructions
94.3MB
http://supercala.net/phpBB3/_files/win1 ... y-list.zip
============================================================================================
win10
x64
apache server
apache2_4_46x64-vc15
https://home.apache.org/~steffenal/VC15 ... 4-VC15.zip
VC15 (or vs16 is downward compatible for 15 and 14) (2017) binaries
x86
https://aka.ms/vs/16/release/VC_redist.x86.exe
x64
https://download.visualstudio.microsoft ... st.x64.exe
or
https://aka.ms/vs/16/release/VC_redist.x64.exe
php
php7211x64vc15
https://windows.php.net/downloads/relea ... 15-x64.zip
python
387x64
https://www.python.org/downloads/release/python-387/
https://www.python.org/ftp/python/3.8.7 ... -amd64.exe
csv
natsort
python script for gog to csv
galaxy_library_export.py
https://github.com/AB1908/GOG-Galaxy-Export-Script
============================================================================================
-So I installed php 7.x with Apache 2.4.33 x64 with the visual c++ 15 dependencies
-I used win 10 64-bit
-I installed python 3.87 64-bit
-Then I had to add the dependencies for reading and writing CSV files and natsort with the command prompt
-make sure you have python installed
https://www.python.org/downloads/release/python-387/
the installer for x64 (64 bit os of win 10)
https://www.python.org/ftp/python/3.8.7 ... -amd64.exe
-install using the installer
-checkmark [a]Add Python 3.8 to PATH
-customize installation
-next
-change your python location to something shorter and simple like
-BROWSE
-click THIS PC
-(C:) drive
-click [MAKE NEW FOLDER]
python387x64
-click on any other folder then your C drive and the new folder so it registers
-it should now read:
C:\python387x64
-click [OK]
-now click [INSTALL]
-also when done the last window click on
[Disable path length limit]
-click [CLOSE]
whew!
============================================================================================
-open the command prompt to the python folder (or your path has it etc)
-(my python install folder)
c:\python387x64\
-check your python by simply typing:
C:\python387x64>python
-this will show up (something like it)
Python 3.8.7 (tags/v3.8.7:6503f05, Dec 21 2020, 17:59:51) [MSC v.1928 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>>
-exit python back to the command prompt by typing:
exit()
-update the pip.py that allows installing CSV and NATSORT
C:\python387x64\py -m pip install -U pip
-it should read like this somewhat
-------------------------------------------------------------
Collecting pip
Downloading pip-20.3.3-py2.py3-none-any.whl (1.5 MB)
|████████████████████████████████| 1.5 MB 1.6 MB/s
Installing collected packages: pip
Attempting uninstall: pip
Found existing installation: pip 20.2.3
Uninstalling pip-20.2.3:
Successfully uninstalled pip-20.2.3
Successfully installed pip-20.3.3
-------------------------------------------------------------
-now install natsort with pip from the web
C:\python387x64\pip install natsort
-it should read like this somewhat
-------------------------------------------------------------
Collecting natsort
Downloading natsort-7.1.0-py3-none-any.whl (35 kB)
Installing collected packages: natsort
Successfully installed natsort-7.1.0
-------------------------------------------------------------
finished!
============================================================================================
-isntall GOG Galaxy do you have it ready to script to
https://www.gog.com/galaxy
-login and then click DOWNLOAD GOG GALAXY 2.0 on the screen
-run this
GOG_Galaxy_2.0.exe 961kb
-it will download and isntall the actual GOG Galaxy Progam/App 232mb
-install to the default location for now
C:\Program Files (x86)\GOG Galaxy
-launch the program
-login
-you can now click on [onwed games]
-also you can click on the [+] button to the right of [filter]
-there you can login to all your game accounts from epic, ubisoft, steam...
-once you have done that and the slow process of all the IMPORTING *% finsihes...
-it is loading the images for the games and the data I believe
-maybe handshaking each time with each game service as well, so it's slow
-you can run the script to get a nice CSV file of all your games
============================================================================================
-installing apache server if you need to the way I did
-I added the apache server to the zip file
-I added the PHP base to the zip file as well
-I made a folder specific
-apache isntalled and running on my D drive
-folder name
D:\apache2_4_46x64-vc15\
-php installed and running in apache through it's config file in this folder
-folder name
D:\apache2_4_46x64-vc15\php7211x64vc15\
-I put the needed VC2017 (15) installers for win10 as well
VC_redist.x64.exe
VC_redist.x86.exe only for 32-bit versions of win 10 / 32 bit apache
1. install apache like this if you have a D: drive, if not substitute for C:
-create a folder
D:\apache2_4_46x64-vc15\
-open the zip file I have or download the apache file from
https://home.apache.org/~steffenal/VC15 ... 4-VC15.zip
-when the zip is open, copy the contents of the [Apache2] folder into (1300+ files)
D:\apache2_4_46x64-vc15\
-now you can copy the config file I made for this apache and php
-look in my zip for:
apache2_4_46x64-vc15\conf\httpd.conf
-copy that and paste in your conf folder at:
D:\apache2_4_46x64-vc15\conf\
-copy and replace? yes.
-create your htdocs folder to hold your websites, and this fun project
-I use a third drive, my U: drive
-if you use one drive total in your PC, use C:
-I use the D: drive for the actual apache server and I have U for projects, the htdocs
-you can use BOTH [htdocs] and the [apache2_4_46x64-vc15] in C: if you like
-(if) you did this in C:\ and don't have a D:\ drive you have to fix some paths
-open the httpd.conf file with notepad or notepad++ I added to my zip file for this project
zip > _installers\npp.7.8.8.Installer.x64.exe
-notepad++ 7.8.8 x64 online
https://github.com/notepad-plus-plus/no ... er.x64.exe
-using ${SRVROOT} as a variable is pretty cool, saves for isntalls on different systems with varying drive letters
-httpd.conf lines (# may vary) to change for your hard drive letter C not D
37 (you choose your install drive letter, these are examples)
Define SRVROOT "D:/apache2_4_46x64-vc15"
Define SRVROOT "c:/apache2_4_46x64-vc15"
39
ServerRoot "D:/apache2_4_46x64-vc15"
ServerRoot "C:/apache2_4_46x64-vc15"
252 (I really like a simple folder to htdocs, I have U for me, maybe C for you if you have a laptop)
DocumentRoot "u:/htdocs"
DocumentRoot "c:/htdocs"
253
<Directory "u:/htdocs">
<Directory "c:/htdocs">
385
<Directory "${SRVROOT}/cgi-bin">
536
LoadModule php7_module "${SRVROOT}/php7211x64vc15/php7apache2_4.dll"
538
PHPIniDir "${SRVROOT}/php7211x64vc15"
2. copy the php files from the zip I made, or your own download of PHP 7.2.11 into this folder:
-remember your drive letter you chose for the install, (D) for me, maybe (C) for you
D:\apache2_4_33x64-vc15\php7211x64vc15
or
C:\apache2_4_33x64-vc15\php7211x64vc15
-another important thing to do is add the PHP and it's [bin] folder to uour windows PATH
-you can download or use the RapidEE_setup.exe I put in the zip to do this
-install The Rapid Environment Editor and then you can
-press START on windows
-right click on the icon for it
-open file location
-now a shortcut in explorer will show
-right click on the shortcut for it
-open file location
-now you will see RapidEE.exe
-right click on the shortcut for it
-properties
-compatibility tab
-[X]run this program as an administrator
-run the rapid environment editor program
-in system variables on the left side, press the [+] on PATH
-right click the PATH (you just [+] opened)
-add value...
-add both your PHP and it's EXT folders to the path one at a time
-you can even directory browse by pressing F7
-add this
C:\apache2_4_33x64-vc15\php7211x64vc15\
-and again add this
C:\apache2_4_33x64-vc15\php7211x64vc15\ext
-maybe also add python's main folder you added
C:\python387x64
-save by clicking the FLOPPY DISC ICON or FILE>SAVE or CTRL+S
============================================================================================
-now you can install apache with a command prompt as an administrator
-press START on windows
-type CMD
-right click the CMD icon and choose
-run as administrator
c:\WINDOWS\system32\
-remember which hard drive you put apache in C or D
-now type in
cd C:\
cd D:\
etc...
cd D:\apache2_4_46x64-vc15\bin\
or
cd C:\apache2_4_46x64-vc15\bin\
-and install apache as a service like this
httpd.exe -k install
============================================================================================
-I made a programming folder and a python subfolder
c:\programming
c:\programming\python\
-to organize projects in different languages etc
-copy or move galaxy_library_export.py to that folder you made above
-in there you can put the script I found and run it as such:
C:\programming\python>python galaxy_library_export.py
-remember to have natsort installed to python as I listed above if there is an error for it
-your folder at C;\programming\python\ will now have this file:
gameDB.csv
============================================================================================
-using my program in php to read that CSV file works...but...
-you should look for any descriptions of games with <b> or </b> and such and remove that stuff
-make a folder called (in your htdocs hard drive (C) (D) (U) etc )
c:\htdocs\games_list\
-or just copy the folder in my zip [games_list] to your htdocs folder
-copy and replace the gameDB.csv when you're ready
zip > [games_list] to your drive [htdocs][games_list]
-you can just use my gameDB.csv to test it out if you have a GOG problem with the script
-open your firefox, chrome, opera, brave, edge, etc browser and goto:
localhost
-you will see a folder in your server
/games_list
-click on that folder
-you can click on index.php and see the result (note is was designed with 4k in mind)
-in the httpd.conf file we can also make index.php files auto load instead
-editing you apache server to auto laod index.html AND NOW index.php files too
-open c:\apache_2_4_46x64-vs15\conf\httpd.conf
(or D drive etc)
-edit this line by duplicating it
line 286*
DirectoryIndex index.html
-add a new line very similar
DirectoryIndex index.php
-save your httpd.conf file in your editor
-restart apache
-you can make a shortcut for the apache server monitor
-goto here in file explorer
C:\apache2_4_46x64-vc15\bin
-right click on the ApacheMonitor.exe
-properties
-compatibility
[x]Run As Administrator
-[ok]
-left click and drag the ApacheMonitor.exe icon to your task manager bar on the bottom of windows
-left click that new icon
-right click the Apache Monitor icon near the right side of windows, near the clock
-or the down arrow showing more icons, drag them down to your task bar a bit below
-choose
Open Apache monitor
-press
RESTART
voila. easy apache server control with a GUI
============================================================================================