Commit Graph

507 Commits

Author SHA1 Message Date
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
2b9c7f9273 Update README.md 2017-02-17 12:11:04 +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
22f47de4fc Fix crash in Website::getGames
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
2017-01-20 00:15:50 +02:00
Sude
1d1855049c Version 3.1 2017-01-13 18:19:34 +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
9f214d9652 Limit download thread count to number of items in download queue 2016-12-18 18:25:24 +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
f93c8ee753 Merge branch 'detectTerminal' of https://github.com/chanceVermilion/lgogdownloader 2016-12-11 14:45:38 +02:00
Sude
159dfecfb2 Merge branch 'curl-nosignal' of https://github.com/pkerling/lgogdownloader 2016-12-11 14:44:34 +02:00
Philipp Kerling
08a6ee300a Make libcurl usage thread-safe
libcurl internally uses signals by default, whcih will crash the
application when using multiple threads.
Setting CURLOPT_NOSIGNAL on all handles avoids the crashes and is
recommended in the libcurl documentation.

See:
https://curl.haxx.se/libcurl/c/threadsafe.html
https://curl.haxx.se/libcurl/c/CURLOPT_NOSIGNAL.html
2016-12-11 13:10:12 +01: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
d11f376030 Version 3.0 2016-11-19 11:30:49 +02:00
Sude
c635cdabe8 Fix for extra characters in progress text in Website::getGames
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.
2016-11-15 19:50:00 +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
0b3a6643c6 Proper fix for skipped file downloads due to race condition
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
2016-11-04 09:52:35 +02:00
Sude
4c480465b3 Fix skipped file downloads due to race condition
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.
2016-11-03 21:51:20 +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
Sude
3baefaa96f Merge branch 'respect-umask' of https://github.com/chewi/lgogdownloader 2016-11-03 20:53:27 +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
4ee63f7e87 Set some curl options for API handle in Downloader::processDownloadQueue
Some curl options which were used for API handle in Downloader::init weren't set for the API handle in Downloader::processDownloadQueue
2016-08-30 21:34:58 +03:00
Sude
24bd3a7c0e Set CA cert path in Downloader::processDownloadQueue
Forgot to set CURLOPT_CAINFO in 0b455ddedc for curl handles that Downloader::processDownloadQueue creates
2016-08-30 21:21:52 +03: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
8f800c602f Make sure that website handle has updated config in Downloader::updateCheck 2016-08-27 23:27:01 +03:00
Sude
97169cef97 Get rid of getpass
Use termios to control terminal ECHO and read password with std::getline instead of using obsolete getpass()
2016-08-26 23:24:04 +03:00
Sude
e47a14836f Merge branch 'master' of https://github.com/timohaas/lgogdownloader 2016-07-22 20:10:08 +03:00
timohaas
9c58141e4e update README, added pkg-config package 2016-07-22 19:06:42 +02:00
Sude
31ebaee54c Fix issue with some GOG XML data files
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.
2016-07-15 18:33:03 +03:00
Sude
116f9d88f2 Fix error in ca436a9927
This caused average download rate to be always 0 because it was never set
2016-07-04 12:51:01 +03:00
Sude
ca436a9927 Add average download rate to progressInfo struct 2016-07-01 18:37:23 +03:00
Sude
d1a59a7d46 Merge branch 'patch-1' of https://github.com/skitt/lgogdownloader 2016-06-12 19:25:23 +03:00
Stephen Kitt
f17bb189ef Add missing spaces in the apt install command-line
Without the spaces, the command-line produces an error (see http://unix.stackexchange.com/questions/289162 for an example).
2016-06-12 18:22:38 +02:00
Sude
8845b6fb56 Update README.md
Debian/Ubuntu package list was missing libssl-dev
2016-06-03 17:56:45 +03:00
Sude
0c89f13b10 Fix indentation
Fixes the indentation in 60fb4db339
2016-06-01 14:29:16 +03:00
Sude
60fb4db339 Add DLC language packs to orphan check
Forgot to add DLC language packs to Downloader::checkOrphans in ff2264763e
2016-06-01 14:25:05 +03:00
Sude
ff2264763e Add support for DLC language packs 2016-06-01 14:17:55 +03:00
Sude
4f5300be75 Delete file on failed download
File is deleted if the download wasn't a resume attempt or the result is zero length file
2016-05-30 14:54:57 +03:00
Sude
21699adc45 CMake: Work around FindThreads bug for CMake < 3.4.0
https://cmake.org/Bug/view.php?id=14905
2016-05-29 12:56:49 +03:00
Sude
afa5d3c5da Update README.md 2016-05-20 20:40:53 +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
b7846e8bd5 Show progress for getting game names from account page 2016-05-20 12:25:29 +03:00
Sude
06fd4d496c Fix issue caused by 730c1ffe58
Util::getFileHash was called instead of Util::getLocalFileHash
This caused librhash error for files that didn't exist
2016-05-20 10:13:20 +03:00
Sude
730c1ffe58 Move code from Downloader::getLocalFileHash to Util::getLocalFileHash 2016-05-18 14:11:37 +03:00