Commit Graph

71 Commits

Author SHA1 Message Date
Sude
d83ba7ff30 Add option to select network interface for operations 2024-11-15 19:31:40 +02:00
Sude
b30515bfea Check for errors in Util::htmlToXhtml 2024-08-22 18:59:41 +03:00
Sude
1567c2a3c6 Use tidyBufInit to initialize buffer 2024-05-26 22:49:36 +03:00
Sude
ebdee25fe6 Fix libtidy settings 2024-05-26 22:32:25 +03:00
Sude
1c0ab298e4 Remove htmlcxx dependency and use libtidy with tinyxml2 to parse html 2024-05-09 14:37:53 +03:00
nerdspice
71a299e80b add --save-product-json option 2023-12-28 14:25:11 -05:00
nerdspice
d7c10ae6fe add --save-api-json option 2023-12-28 09:27:59 -05:00
nerdspice
86b90b4d59 fix dlc logo/icon path from going into "no_platform" folders 2023-12-11 03:15:00 -05:00
Sude
cdc3569f3c Add option to disable fast status checking
Adds --no-fast-status-check which makes --status much slower but able to catch corrupted files by calculating local file hash for all files.
2023-07-25 20:00:47 +03:00
Sude
ed1a61e2b3 Improve include/exclude options
DLC files can now be included/excluded separately
Bumped game details cache version number

Game specific config file changes:
- "dlc" option is deprecated and will be ignored
- "include" option is added
2023-05-17 18:03:31 +03:00
Sude
06c033eda1 Add support for exceptions in transformation rules 2023-04-26 13:59:57 +03:00
Sude
b4fdc2929c Add helper function Util::readJsonFile 2023-04-26 12:36:43 +03:00
Sude
a1a7fb4a28 Fix transforming gamename using multiple rules
The transformation was always applied to original name.
This fixes it by applying additional rules to already transfromed name.
2023-04-16 13:08:31 +03:00
Sude
dabfcfc180 Add option to transform gamenames
Configuration file $XDG_CONFIG_HOME/lgogdownloader/transformations.json can be used to set rules for transforming gamenames.
New subdir templates: %gamename_transformed% and %gamename_transformed_firstletter%
"--list transformations" can be used to show transformed gamenames
2023-04-15 22:19:07 +03:00
Sude
546982c717 Show total size before download and add option to check for free space
The downloader now shows total size to be downloaded
Added --check-free-space option to check if there is enough free space and abort if not enough is available
2023-04-03 14:52:09 +03:00
Sude
3f6b2315eb Fix getting DLC names 2023-03-27 22:09:13 +03:00
Sude
a81d63b375 Fix cookies getting overwritten
Sometimes curl handles in downloader and galaxy api class could overwrite cookies with blank cookies
Fixed this by not setting CURLOPT_COOKIEJAR by default and only using it for curl handles in website class
2023-03-24 16:08:01 +02:00
loki-47-6F-64
33ec0434aa Upload local saves to the cloud 2022-08-04 16:57:15 +02:00
loki-47-6F-64
c97a828aa7 Download cloud save files 2022-08-02 18:36:31 +02:00
loki-47-6F-64
c4f604aec0 Show cloud save paths 2022-07-31 14:11:32 +02:00
Sude
983592d09e Reduce the amount of request to cdn with --galaxy-install
Should fix the issue of getting temporarily blocked by GOG cdn when installing game with lots of small files
2022-02-17 10:30:38 +02:00
Sude
4e09d6357e Add directory template %gamename_firstletter%
Feature request by "coffeecup" on GOG forums
Useful for sorting big libraries with --subdir-game option
Takes the first letter from %gamename%
If %gamename% begins with a number then 0 (zero) is used instead
2021-08-06 11:46:07 +03:00
Timotej Lazar
8fe1fc4118 Fix getting redirect URL from curl
The char* set by curl_easy_getinfo may not be valid after the next
curl_easy_perform, so copy it to a std::string instead.
2020-11-28 22:31:54 +01:00
Sude
26315b23b8 Add retry support to --galaxy-install
Added retry support to --galaxy-install
Changed some retry conditions
Show reason for retry attempts
Added some Curl related helper functions to Util
2020-09-26 22:09:38 +03:00
Sude
8caca0e62a Galaxy: Add split file support to MojoSetup hack 2020-02-19 13:49:06 +02:00
Sude
a8d9d466c9 Make progress info show estimated total remaining size and time 2019-03-01 14:09:52 +02:00
nathanel23
f65599e216 Fix for memory corruption/crash related to rhash
This patch fixes issues with some calls to the rhash C library that
cause subtle memory corruptions. There are two main issues that this
patch addresses:

1) The library init function is called multiple times in various places
within in the Util class. This is not necessary and may cause issues
if the initialization is repeated simultaneously in multiple threads.
Therefore the call was moved to the beginning of the main() function.

2) There is not enough space in the output buffers to store the
terminating NUL character of the hex-formatted hashes. The print
function from the rhash library writes a regular C string to
the output buffer and expects enough space to include the end
marker.

Depending on the memory layout generated by the compiler, this results
in one byte of the stack to be overwritten, which might lead to random
issues that are hard to find. On AArch64 (ARM) with GCC 6.3 the call to
the rhash_print() function happens to destroy the lower byte of the
frame pointer and causes a crash due to an invalid free() operation some
time after the Util::createXML function returned.
2019-01-06 01:06:23 +01:00
Sude
f559c6c014 Fix unclosed file handle in Util::createXML
File handle for input file was not closed in case of errors.
Added fclose() to all error cases.
2018-12-20 11:10:42 +02: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
Hans Philipp Annen
76d8548fc9 Remove usage of obolete Json::Reader class. 2017-12-20 18:12:59 +01:00
Sude
257946dbc1 Workaround for crash with older version of jsoncpp 2017-10-12 00:29:04 +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
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
Steffan Byrne
5822bce376 Made getTerminalWidth detect if it is running in a terminal before trying to get the width. 2016-12-02 21:26:37 -05: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
Ferdinand Thiessen
c83f6294ab Ported code to use tinyxml2 instead of tinyxml 2016-05-13 14:37:02 +02:00
Sude
519cb78d38 Fix compiling with JsonCpp 1.7.1 2016-03-25 23:09:17 +02:00
Thomas J. Moore
c0735d5993 Use cerr for password prompts, error messages, rolling status
messages, and other stuff that shouldn't clutter saved stdout.
Probably needs more work.
2016-02-20 14:56:44 -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
d648d3a073 Add Util::getOptionNameString to reduce some duplicate code 2015-10-03 19:03:24 +03:00
Sude
16b14d091b Simplify "all" value calculation to make it easier to understand
No idea why I was shifting 2 instead of 1 here.
2015-09-03 12:42:00 +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
Sandy Carter
fe314869c1 Factor out protol string as a constant 2015-08-14 21:09:27 -04:00