about summary refs log tree commit diff
path: root/pkgs/games/humblebundle/fetch-humble-bundle
Commit message (Collapse)AuthorAgeFilesLines
* treewide: Replace pkgconfig with pkg-configaszlig2021-06-161-2/+2
| | | | | | | | | | | | | | This is another alias which got introduced in 2018, because the actual command is "pkg-config" and so the package name containing a dash is more reasonable. The reason why I'm doing this is because NixOS VM tests now disallow aliases and while the evaluation error in question only affected the "gnupg" test, I decided to change all occurences in the event that we might want to disallow aliases for things other than VM tests. Signed-off-by: aszlig <aszlig@nix.build> Cc: @sternenseemann for "opam-env"
* treewide: stdenv.lib -> pkgs.libProfpatsch2021-02-051-3/+3
| | | | Upstream is deprecating `stdenv.lib`, so let’s do the same.
* fetch-humble-bundle: Fix login with guard codeaszlig2019-09-302-15/+195
| | | | | | | | | | | | | | | | | | | | | | | HumbleBundle has introduced a new guard code, which is sent to the email address of the account owner after the captcha has been solved. Unfortunately, the humblebundle-python[1] library is no longer maintained and there are no forks with fixups. In addition, the code of the library is sub-par and also doesn't support Python 3. So I added a patch containing a _very_ dirty fix to include the guard code during the login procedure for now until we have decided to either go with the existing library and fork it or use another library or implement it ourselves, since we only use a tiny fraction of the HB API. I also fixed up the Qt plugin path for the captcha prompt if a newer nixpkgs revision is used, where we have wrapQtAppsHook. One downside of the guard code is that we get prompted for it _every_ time we download something, which might be annoying, but at least it's better than not working at all. Signed-off-by: aszlig <aszlig@nix.build>
* games: Use preferLocalBuild for fetchersaszlig2019-06-111-0/+2
| | | | | | | | | | | | | | | | If we're on a machine with remote builds enabled, we'd like to prefer not having our login credentials to be pushed on a remote server. We of course also don't want the actual games to end up on a different machine, so let's use preferLocalBuild to avoid this. Unfortunately avoidance is not at any cost, because if we for example use a different system attribute, it might be built on a remote machine nevertheless. Ideally there would be something like "forceLocalBuild", which avoids remote builds at any cost. Signed-off-by: aszlig <aszlig@nix.build> Cc: @Profpatsch
* fetchHumbleBundle: Fix fetching productsaszlig2019-02-131-0/+2
| | | | | | | | | | The "Product" model expects to have a "supports_canonical" attribute in the JSON Product object, which since a while is no longer there. We really don't need that attribute for our purposes, so we can simply drop the line where we do the lookup. Signed-off-by: aszlig <aszlig@nix.build>
* fetchHumbleBundle: Fix getting recaptcha responseaszlig2019-02-131-1/+5
| | | | | | | | | | | | | | | | | | The object in question to get the response from the Recaptcha widget is now called "grecaptcha" instead of just "captcha" and the method to call now is also called "getResponse" instead of "get_response". Another change is that the grecaptcha object isn't available immediately once the page is loaded, so I added a try...catch loop for that. I know it's evil to do that, but I tried to check just for whether grecaptcha is available and then call the getResponse method but found out that during object construction there is a small time window where getResponse is available but isn't a callable method. There is still another issue with the HB fetcher, but the first step is hereby fixed. Signed-off-by: aszlig <aszlig@nix.build>
* fetchHumbleBundle: Fix subproduct name collisionaszlig2018-07-151-2/+2
| | | | | | | | | | | | | | Every HumbleBundle purchase has a list of subproducts and those have so-called 'machine_name' attributes which are unique. However in our fetcher we used the 'human_name' as a unique key, which isn't really unique and in case of bastion the soundtrack subproduct is has the human_name "Bastion" and the actual game has the *same* name as well. Using the machine_name as the unique key now solves the problem that certain games couldn't be found if you for example also have the soundtrack. Signed-off-by: aszlig <aszlig@nix.build>
* fetchHumbleBundle: Run get-captcha off-the-recordaszlig2018-02-011-1/+4
| | | | | | | | | | | | | | | | | | | | | We don't want this little helper to leave all kinds of junk on the disk, so let's enable offTheRecord mode for the default QtWebEngine profile. This in turn causes all stuff like cache, cookies, local storage and whatnot to only reside in memory. For example on my machine I had lots of files like this in ~/.local/share and ~/.cache: * 014bxyklf1xm99jd5rg8y4q0blmqw6yc-get-captcha * 18j0knrwrsamsrpwjz741midspxbqmpp-get-captcha * 4817rvjnj249ifvk7dsvv2p0kxi2jwkg-get-captcha So if you ran this helper you should probably remove *-get-captcha in XDG_DATA_HOME (by default ~/.local/share) and XDG_CACHE_HOME (by default ~/.cache). Signed-off-by: aszlig <aszlig@nix.build> Cc: @Profpatsch, @Sternenseemann, @layus
* pkgs/games: Fix fetchHumbleBundleaszlig2017-09-131-0/+4
| | | | | | | | | The login URL for HumbleBundle has changed from /login to /processlogin, so let's fix it quickly via sed. Signed-off-by: aszlig <aszlig@redmoonstudios.org> Issue: saik0/humblebundle-python#16 Cc: @saik0
* pkgs/fetch-humble-bundle: s/requests2/requests/aszlig2017-06-161-1/+1
| | | | | | | The requests2 package has been merged into the original project upstream and thus is deprecated. Signed-off-by: aszlig <aszlig@redmoonstudios.org>
* humble-bundle: Add helper for solving captchasaszlig2017-06-091-2/+96
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is not only a major annoyance for us but seems to bother a few other people using the humblebundle-python API: * saik0/humblebundle-python#11 * saik0/humblebundle-python#14 * saik0/humblebundle-python#15 While digging through the reCaptcha2 API and also the implementation of the Humble Bundle site, I stumbled over this code from https://www.humblebundle.com/user/captcha: var captcha = new Recaptcha2('captcha-holder'); $('input[type=submit]').click(function(e){ e.preventDefault(); // recaptcha v2 only cares about response, but we can let the Android app interface stay the same var challenge = ''; var response = captcha.get_response(); var android_defined = false; if (typeof Android != 'undefined') { Android.setCaptchaResponse(challenge, response); } }) So we only need the response, which we do now using a very ugly written Qt 5 QWebEngine GUI which we use to ask the user to solve the captcha. Combined with our downloader, it works like this: Whenever the login fails with a HumbleCaptchaException, we print a message with the store path to the GUI helper. We're inside a fixed-output derivation builder, so we do have networking. The GUI helper also runs a small TCP server listening on port 18123 and the downloader inside the Nix builder constantly tries to connect to that port and waits until it gets just one string (the connection is directly closed afterwards and the GUI helper exits), which is the response. This is then passed as recaptcha_response keyword argument to the login() method of the HumbleApi object. Signed-off-by: aszlig <aszlig@redmoonstudios.org>
* Revert "runCommand -> runCommandCC"aszlig2016-10-171-14/+2
| | | | | | | | | | | | | This reverts commit e3f8d28d6be67257d70035d122263f3a35adc438 and my attempts to mitigate this in 0a50f5fab1abf2e70fd5d7a2dd717c2f2c1b983b and 3b91f25b37ea709f5c86e38a50061199bbed5341. Vuizvui is a repository for experimental stuff, but NOT a dumpster. So please refrain from pushing waste into this repository, like markers for a failed merge. Signed-off-by: aszlig <aszlig@redmoonstudios.org> Cc: @Profpatsch
* runCommand -> runCommandCCProfpatsch2016-10-151-2/+14
|
* pkgs: Switch to pythonPackages.buildPythonPackageaszlig2016-09-271-2/+2
| | | | | | | Since 771ed59b48bc1257439b4529426cc9047aebc27b, there is no top-level attribute anymore, so let's fix this. Signed-off-by: aszlig <aszlig@redmoonstudios.org>
* fetch-humble-bundle: Allow single-output curlaszlig2016-08-161-1/+2
| | | | | | | This should make sure it can be evaluated on NixOS versions where the closure-size branch has not yet been merged. Signed-off-by: aszlig <aszlig@redmoonstudios.org>
* games/fetch-humble-bundle: Fix path to curlaszlig2016-06-041-1/+1
| | | | | | | Since the merge of the closure-size branch, the curl binary now is in a dedicated output ".bin". Signed-off-by: aszlig <aszlig@redmoonstudios.org>
* Merge aszlig/nixgames into vuizvuiaszlig2016-02-081-0/+87
This is a subtree merge of the full nixgames repository including history. Right now it isn't linked to vuizvui at all but we're going to do that very soon. The reason why I'm merging both repositories together is that it's easier for me to manage updates and also facilitate contributions by people from the OpenLab. Another reason to merge it is that we can write more generic functions for building both, the games and the rest. Right now the licensing is still the Apache License version 2.0, but we're going to change it to the vuizvui license as well.