Commit Graph

207 Commits

Author SHA1 Message Date
Sude
bcccec416f Galaxy: Add option to delete orphaned files 2019-06-06 20:00:38 +03:00
Sude
bdf2716eaa Add language: Hebrew 2019-05-27 16:42:51 +03:00
Sude
86bb528c39 Add regex support to --galaxy-install and --galaxy-show-builds
Check if option value is regex and then ask user to select one product from a list of products matching the regex.
2019-04-22 18:14:53 +03:00
Sude
8540955af8 Reverse previous behavior of GUI login being enabled by default
Adds option --enable-login-gui which is used to enable GUI login when reCAPTCHA is encountered on login form.
This reverses the previous behavior added in ea0ec2a9bd and removes --disable-login-gui option.
It's better to have GUI login disabled by default just in case user is running lgogdownloader through SSH without X forwarding.
Because user has to enable login GUI first there won't be any unexpected behavior.
2019-04-22 18:01:19 +03:00
Sude
deb29802d2 GUI: Add autofill
Make login GUI automatically fill email and password fields
Users no longer need to type email and password again just because normal login method failed due to reCAPTCHA and GUI was launched
2019-04-22 17:39:10 +03:00
Sude
ea0ec2a9bd Add option to disable GUI login
Adds option --disable-login-gui which is used to disable GUI login when reCAPTCHA is encountered on login form.
Useful when downloader is compiled with GUI support but user is using it through SSH without X forwarding.
2019-03-01 23:12:04 +02:00
Sude
a8d9d466c9 Make progress info show estimated total remaining size and time 2019-03-01 14:09:52 +02:00
Sude
1e8ebbfd94 Add GUI login
Use QtWebEngine for getting cookies and authorization code if login form contains recaptcha and downloader is compiled with -DUSE_QT_GUI=ON
2019-03-01 10:05:16 +02:00
Sude
01eed3ec9e Add language: Arabic, Romanian 2019-02-17 01:19:37 +02:00
Sude
df628b2a59 Add option to include hidden products
Adds option --include-hidden-products that allows user to list and download products that have been set hidden in account page.
2018-12-20 13:10:27 +02:00
Sude
ab84d6f827 Galaxy: Add option to set CDN priority
--galaxy-cdn-priority option allows to set priorities for content delivery networks
2018-09-12 20:07:59 +03:00
Sude
8e55b81ca1 Galaxy: Extend subdir option to work with MojoSetup hack
Extends subdir option introduced in 1b3b04b28c to work with Downloader::galaxyInstallGame_MojoSetupHack
2018-09-12 16:02:34 +03:00
Sude
1b3b04b28c Galaxy: Add option to set subdirectory for installation
New option --subdir-galaxy-install allows user to set installation subdirectory when using --galaxy-install
2018-09-12 15:18:54 +03:00
Sude
35b178e674 Galaxy: Add support for downloading dependencies
Adds support for downloading dependencies for a game
Added --galaxy-no-dependencies option to disable downloading dependencies during --galaxy-install
2018-09-05 17:41:43 +03:00
Sude
8e9c094929 Replace --update-check option and remove --game aliases
Replace --update-check option with --updated and --notifications options
--updated restricts downloader to operate only on games that have update flag set in account page
--notifications shows the number of new forum replies, updates games, unread chat messages and pending friend requests
--clear-update-flags clears update notification flags for all games

Remove aliases for --game option
"free" could no longer be used as originally intended and "all" was unnecessary because leaving regex empty has the same effect
2018-07-21 23:59:08 +03:00
Sude
3b733fcb4b Galaxy: Set timestamp for downloaded file 2018-05-29 11:23:51 +03:00
Sude
dd5714690c Galaxy: Use regex for language detection in --galaxy-install
Some builds use different language codes.
It looks like all of them are in format Language-Country/Region.
Added these new codes to regex in GlobalConstants::LANGUAGES.
Use regular expression to detect the language instead of language code.
2018-05-29 09:56:38 +03:00
Sude
463a9c386e Galaxy: Add hack for installing Linux games
Try to use Linux installers as replacement for Galaxy repository.
Linux installers use MojoSetup which means that the installers are Zip files that have bash script and installer binary prepended.
We can get zip file entries from zip central directory and then split the game installer to chunks based on those file entries.
Therefore we can download individual files from the installer.
2018-05-29 08:56:29 +03:00
Sude
ef1a344610 Remove cover download support 2018-05-14 11:12:10 +03:00
Sude
553c6dce1c Galaxy: Add support for generation 1 builds to --galaxy-show-builds 2018-02-12 19:03:56 +02:00
Sude
e9ac6d072f Galaxy: Make --galaxy-install multithreaded 2018-02-12 18:46:17 +02:00
Sude
90dcaf0106 Add options to set low speed timeout values for libcurl 2017-11-08 15:20:03 +02:00
Sude
3f8a8d6b68 Galaxy: Remove duplicate code
Removed duplicate code by unifying various *JsonNodeToGameFileVector functions
2017-10-18 13:13:35 +03:00
Sude
257946dbc1 Workaround for crash with older version of jsoncpp 2017-10-12 00:29:04 +03:00
Sude
257b6b0137 Update login check 2017-09-20 06:59:43 +03:00
Sude
c9b6ea4a52 Galaxy: Add some checks to GalaxyConfig class
Check that json contains the node before trying to get value
2017-09-15 02:17:44 +03:00
Sude
706158d595 Get game details using Galaxy API
Game details are now acquired using Galaxy API.
Allow using most features without valid downloader API login by changing Downloader::isLoggedIn to return false only if website is not logged in.
--download-file still uses old API and will not work without valid API login. Downloader::downloadFileWithId prints error message and exits if user doesn't have valid API login.
Game details cache version is incremented because of changes to gameFile class.
Show product id for DLCs when using --list-details option.
Rewrote Downloader::repair to remove duplicated code.
Fixed serials containing <br> tags.
2017-09-13 16:46:46 +03:00
Sude
8a71c63b20 Add option to set interval for progress bar update 2017-08-18 09:33:10 +03:00
Sude
35192fd725 Add option to set user agent 2017-08-01 23:59:11 +03:00
Sude
672e6f8207 Galaxy: Check for orphaned files
Check and list orphaned files after download/installation with --galaxy-install is finished
2017-05-23 16:53:24 +03:00
Sude
29e5febab0 Galaxy: Support selecting platform architecture
Add option --galaxy-arch to select architecture.
Supports selecting platform architecture when "osBitness" is set for depot.
If "osBitness" is not set in API response then assume that we want to download the files from depot.
2017-05-23 16:44:27 +03:00
Sude
66c1d6d51e Add language: Spanish (Latin American) 2017-05-23 12:33:47 +03:00
Sude
6c6cad4048 Add language: Ukrainian 2017-05-16 17:36:00 +03:00
Sude
d4a6791e65 Galaxy: Add option to select language 2017-03-06 07:22:34 +02:00
Sude
8cbc62b8cd Galaxy: Fix downloading DLC files
Add product id from depot JSON to galaxyDepotItem struct

Previously downloader failed to download DLC files because DLCs have different product id than base game
Fix downloading DLC files by setting product id for each depot item
2017-03-06 06:58:11 +02:00
Sude
f5af312fd4 Add option to set login info on command line or read it from file
Add --login-email and --login-password to set login info on command line

Read login info from $XDG_CONFIG_HOME/lgogdownloader/login.txt if the file exists
login.txt must contain email on the first line and password on the second line
2017-03-06 05:46:48 +02:00
Sude
f9981c1be0 Galaxy: Add option to select platform 2017-03-05 22:47:44 +02:00
Sude
602cac8b4c Add resume support to Downloader::galaxyInstallGame 2017-03-04 23:52:29 +02:00
Sude
d6d3d3a40e Fix some issues with GalaxyConfig
Fix compile error: "conversion from ‘time_t {aka long int}’ to ‘const Json::Value’ is ambiguous"
Add checks for missing "expires_in" value in Galaxy tokens json
2017-02-27 22:24:56 +02:00
Sude
f2e8dde934 Some initial Galaxy code
Add some code for initial Galaxy support.
Rewrite and move code around in preparation for GOG Galaxy API support.
2017-02-17 11:14:28 +02:00
Sude
ff8ac41fde Add missing include to util.h 2017-01-13 18:09:05 +02:00
Sude
b9bb37b36a Make --list show number of updates for games that have been updated
Allows user to check for updated games more easily
2017-01-11 19:22:38 +02:00
Sude
6d6a676e0a Add function Util::formattedString
Replace all "printf" and "sprintf" calls using Util::formattedString
2017-01-11 15:57:26 +02:00
Sude
e045612ab8 Rewrite Downloader::checkStatus
Added type for DLCs to gameFile (GFTYPE_DLC)
Added gameDetails::getGameFileVector function
Simplified Downloader::checkStatus code by removing duplicate code
Downloader::checkStatus now also tries to get remote file hash for patches and language packs
2016-12-20 22:29:56 +02:00
Sude
dea82b7991 Some code restructuring
- Move some code from Downloader::init() to constructor
- Add function API::isLoggedIn()
- Add function Downloader::isLoggedIn()
- Don't call Downloader::getGameList() from Downloader::init(). Call it from other functions if/when needed

Also fix some login issues
2016-12-17 21:01:44 +02:00
Sude
9842c070e4 Multithreaded getGameDetails
Get game details using multiple threads
2016-11-15 19:30:32 +02:00
Sude
34e3af3438 Ignore DLC count information for specific games
Ignore DLC count information for specific games by using a list of games that we know have DLC.
GOG reports wrong DLC count information for many games. By using a list of games that we know have DLC we can ignore DLC count info that GOG provides for those games.
User can use local list ($XDG_CONFIG_HOME/lgogdownloader/game_has_dlc.txt) or use remote list by using the new "--dlc-list" option.
The list uses same format as blacklist.
2016-11-05 14:51:52 +02:00
Sude
fb565f4493 Add "Message" class
Changed message queue to use the new "Message" class.
Simplifies status message printing by having the message class take care of formatting and keeping track of the message type.

Status messages are now timestamped and colored based on message type
2016-11-03 21:25:33 +02:00
Sude
0dfa610c28 Merge branch 'exit-status' of https://github.com/chewi/lgogdownloader 2016-11-03 20:54:04 +02:00
James Le Cuirot
1388c00a4e
Exit with non-zero status when --list or --list-details fails 2016-09-23 22:20:37 +01:00
James Le Cuirot
d8b8d6da96
Exit with non-zero status when at least one --download-file fails 2016-09-23 22:20:08 +01:00
James Le Cuirot
e36552c6ed
Add --respect-umask option to prevent adjusting permissions
I would like to use LGOGDownloader in conjunction with Gentoo's
package manager, which may execute it as root, portage, or some other
user in the portage group. A shared configuration under /etc will be
used to avoid sandboxing issues. This will not be world readable.
2016-09-21 23:49:32 +01:00
Sude
0b455ddedc Add option to set CA certificate path
Adds options to set path to CA certificate bundle in PEM format.
CURL_CA_BUNDLE environment variable is used if it is set and CA certificate path is not set with --cacert option.
2016-08-30 19:34:47 +03:00
Sude
ca436a9927 Add average download rate to progressInfo struct 2016-07-01 18:37:23 +03:00
Sude
442fad04db Add support for parallel downloads
New option "--threads" can be used to set how many parallel downloads to run. The default is 4 threads.

Changes to behavior:
- Serials and changelogs are saved and covers downloaded for all games that match the "--game" filter before any other files are downloaded.
- Automatic XML creation is run after all files are downloaded. Previously xml data was automatically created right after download finished.
- The "--limit-rate" option sets rate limit for thread not global rate limit.
2016-05-20 20:33:07 +03:00
Sude
730c1ffe58 Move code from Downloader::getLocalFileHash to Util::getLocalFileHash 2016-05-18 14:11:37 +03:00
Sude
4c02de5d24 Add language: Bulgarian 2016-05-18 13:06:28 +03:00
Sude
112ad17e18 Drop support for libcurl < 7.32.0 2016-05-03 16:48:54 +03:00
Sude
037582d3b1 Progressbar: add function to get bar as string 2016-04-27 20:47:15 +03:00
Sude
7b1127a85e Use CURLOPT_XFERINFOFUNCTION instead of obsolete CURLOPT_PROGRESSFUNCTION
CURLOPT_XFERINFOFUNCTION was introduced in libcurl 7.32.0
Newer libcurl prefers the new callback even if both CURLOPT_PROGRESSFUNCTION and CURLOPT_XFERINFOFUNCTION are set. Therefore we can still support older versions libcurl.
2016-04-25 19:26:02 +03:00
Sude
51026efec0 Fix issue with cache update
Fixes an issue caused by 33fb004cdd
Website handle didn't have updated config which caused overridden values to be ignored
2016-04-25 18:20:00 +03:00
Sude
5bfb00bb31 Changed gameFile format and gamedetails cache format
gameFile now contains gamename and file type info
Game details cache format has been changed to match gameFile changes
Cache also has a new "gamedetails-cache-version" field that can be used to detect cache format changes
2016-04-25 18:14:04 +03:00
Sude
2538825fb2 Add missing WTFPL license text to gameDetails and gameFile classes 2016-04-18 20:39:31 +03:00
Sude
33fb004cdd Move GOG website related members of Downloader class to new Website class
Downloader::HTTP_Login --> Website::Login
Downloader::getGames --> Website::getGames
Downloader::getFreeGames --> Website::getFreeGames
Downloader::getGameDetailsJSON --> Website::getGameDetailsJSON
Getting wishlist details is split from Downloader::showWishlist to Website::getWishlistItems function
2016-04-18 20:33:19 +03:00
Sude
987e053ad4 Add option to save changelogs 2016-03-06 15:45:22 +02:00
Sude
852cb563ba Reduce the amount HTTP requests
Save game details json for later use when DLC info is downloaded in Downloader::getGames.
This reduces the amount of HTTP requests because we don't need to download the info again in Downloader::getGameDetails.
2016-03-06 14:02:30 +02:00
Thomas J. Moore
9520f3f3b7 Improvements to orphan detection:
- blacklist applies to installed files only; use ignorelist for orphans
  - blacklisted but present items are orphans, as they should be
  - use exact matching for file paths: files in wrong location are orphans
2016-02-20 14:59:52 -06:00
Thomas J. Moore
f786e94970 Remove excess semicolon warnings 2016-02-20 14:55:52 -06:00
Sude
0de2a9f64b Add support for priority in game specific language and platform options 2016-02-20 15:34:51 +02:00
Sude
4d4aaa1792 Improve game specific config options
"platform" and "language" options allow using string to set them.
This allows user to set them more easily without needing to calculate the sum of integer values and makes the config easier to understand later.
For example: this allows setting "language" to English, German and French with "en+de+fr" which is much easier to understand than setting it to "7".

Directory options can be overridden using game specific config file
New options in game specific config file:
 - "subdirectories" - <bool>
 - "directory" - <string>
 - "subdir-game" - <string>
 - "subdir-installers" - <string>
 - "subdir-extras" - <string>
 - "subdir-patches" - <string>
 - "subdir-language-packs" - <string>
 - "subdir-dlc" - <string>
2016-02-15 14:27:29 +02:00
Sude
fc88679b12 Add option to set automatic XML creation in config file 2016-02-04 11:51:11 +02:00
Sude
3465384e0b Use include/exclude options to select what to download/list/repair
The default is "--include all --exclude covers"
2015-10-07 11:52:04 +03:00
Sude
82aa604b3e Add language: Slovak 2015-10-06 15:44:36 +03:00
Sude
d648d3a073 Add Util::getOptionNameString to reduce some duplicate code 2015-10-03 19:03:24 +03:00
Sude
ba27e4fbcc Add version string and number to cached game details 2015-10-03 19:00:51 +03:00
Sude
b4fd9fcf5c Use regular expressions for getting language and platform option values
Selecting languages with --language and --language-priority
- Whatever code GOG happens to use in their API (mostly ISO 639-1)
- ISO 639-1
- ISO 639-2/T
- ISO 639-2/B
- English name

Selecting platforms with --platform and --platform-priority
- Windows: "w, win, windows"
- Linux: "l, lin, linux"
- Mac: "m, mac, osx"
2015-09-02 11:16:00 +03:00
Sude
2206e988a6 Initial support for using platform/language strings to set options 2015-09-01 14:45:34 +03:00
Sude
9b560d786e Some minor code cleanup 2015-09-01 13:59:54 +03:00
Sude
887ac52563 Some improvements to priority handling
Fixes issues with some strings that caused issues previously
For example: 4,,1 is now handled correctly
2015-08-29 16:18:20 +03:00
Sude
a8e09a7f48 Use same structure for language and platform structs 2015-08-29 15:03:20 +03:00
Sude
06d211f534 Simplify and remove duplicate code for getting config directory paths 2015-08-29 14:26:36 +03:00
Sude
b6d07f5343 Merge branch 'outname' of https://github.com/bwrsandman/lgogdownloader 2015-08-15 07:56:53 +03:00
Sandy Carter
bc92655702 Add output filename option
Add -o option to specify path and downloaded file name when using
--download-file
Overrides --directory
2015-08-14 23:15:15 -04:00
Sandy Carter
fe314869c1 Factor out protol string as a constant 2015-08-14 21:09:27 -04:00
Sude
f51cca5dff Add options to login separately to website and API 2015-08-12 16:42:54 +03:00
Erik Fleischer
7e8f707846 Fixed segmentation fault on startup on 32 bit platforms.
Fixed downloading files > 2GB on 32 bit systems.
2015-07-05 15:50:16 +02:00
Erik Fleischer
9fbf791a78 Fixed createXML declaration. 2015-07-04 20:52:12 +02:00
Erik Fleischer
23df30d7be Continued replacing size_t with uintmax_t in order to handle file larger than 2GB on 32 bit platforms. 2015-07-03 22:09:50 +02:00
Sude
2c02435157 Use correct language code for Brazilian Portuguese 2015-06-17 06:12:19 +03:00
Sude
cd5b79b3c9 Add support for Brazilian Portuguese 2015-06-15 04:26:51 +03:00
Sude
6d1c05294d Set language and platform constants by using left shift
Makes the code easier to understand
2015-06-15 04:23:43 +03:00
Sude
834e6baa7a Add options to ignore DLC count information
Ignoring DLC count information helps in situations where the account page doesn't provide accurate information about DLCs.
--ignore-dlc-count sets regular expression filter for games to ignore DLC count information.
Game specific option "ignore-dlc-count" can be used to ignore DLC count for specific game.
2015-06-01 10:45:30 +03:00
Sude
29e6b6290c Add option to show wishlist 2015-05-13 17:13:30 +03:00
Sude
b5cdf10078 Support new account page layout 2015-05-12 02:19:16 +03:00
Sude
21e6c6119d Make progressbar display 10 second average download speed 2015-04-27 16:51:17 +03:00
Sude
d97849818e Add option to download files using file id 2015-04-11 16:42:10 +03:00
Sude
3834c1e612 Add option to skip fast platform detection
Useful in case platform identifier is missing for some games in the game shelf.
Using --platform with --list doesn't work when using --no-platform-detection
2015-03-28 12:52:41 +02:00
Sude
216cfaedfe Add support for saving serial numbers 2015-03-19 09:50:50 +02:00
Sude
f039db5c65 Change jsoncpp include path 2015-01-22 09:22:48 +02:00
Sude
d04cfbae1f Make progress bar adapt to terminal width 2014-11-27 23:20:22 +02:00