Downloader::login will fail if Galaxy API login is not successful.
Exporting cookies no longer works because Galaxy API login is tied to website login.
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.
If repairing a chunk failed then the downloader could get stuck in infinite loop trying to repair the chunk.
This fixes the issue by adding a retry limit for failed chunk repairs.
Get timestamps from server for all downloaded files and set the last modified date to that.
Should also change timestamps for previously downloaded files when using single or multi threaded mode.
Retroactively changing timestamps doesn't work for files downloaded with --galaxy-install because Downloader::galaxyInstallGame doesn't try to download the file if it already exists and is the same file as on server.
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.
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
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
Use install directory value from json as subdirectory in directory specified by --directory
If install directory was not set then use product id as subdirectory
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
JSON value for updates can be null in some cases. For example when user owns a dlc but not the base game.
This caused a crash due to std::stoi throwing std::invalid_argument exception
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
- 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
If we print shorter progress text than we printed earlier then characters from the earlier string would remain on the terminal because the line was not cleared.
Clear the line before printing to avoid the extra characters.
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.
Properly fixes the skipped file downloads due to race condition caused by trying create same directory from multiple threads at the same time.
4c480465b3 fixed the issue by having additional check to see if the directory exists after boost::filesystem::create_directories() returned false.
This fix uses mutex to make sure only one thread at a time can check if the directory exists and create it
If multiple threads detected that directory didn't exist at the same time and tried to create it then one thread would succeed in creating it first and other threads would be trying to create a directory that already exists.
boost::filesystem::create_directories() would then return false for those threads and skip the file download.
Having additional check to see if the directory exists after boost::filesystem::create_directories() returns false fixes the problem.
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
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.
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.
Some GOG XML data files contain additional nodes/elements that were not handled properly and caused issues.
We only care about the "chunk" elements so lets ignore all other xml elements.
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.
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.
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
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.
- 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
"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>
If stdin isn't a tty, the behaviour of std::getline(std::cin, email) and getpass() is different (the latter always uses /dev/tty). If input is redirected, it's probably best to just fail.
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"
Fixes issue with --status when remote xml data is already downloaded but the download was incomplete
Downloader::getLocalFileHash returned the same file hash as Downloader::getRemoteFileHash which caused --status to report it as OK
... especially when using generic --ignore-dlc-count='.*'
previously, lgogdownloader would fetch game details for every game
that indicated that it has DLCs. Which were all of them when used with
--ignore-dlc-count - potentialy hundreds of http queries and cause of very slow
startup with larger accounts. Regardless of what --game regex said.
After the change, only initial list of all games is fetched, and then details
for games that both the user is interested in AND they are suspected of
having DLC. So it should help with startup time even when user doesn't use
--ignore-dlc-count option.
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.
Sometimes when trying to get XML data failed and set API error it was never cleared.
This caused some files being skipped due to API still being in error state.
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