Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP 0.6: Add trove support #15

Open
wants to merge 19 commits into
base: next
Choose a base branch
from
Open

WIP 0.6: Add trove support #15

wants to merge 19 commits into from

Conversation

MayeulC
Copy link
Owner

@MayeulC MayeulC commented Jul 21, 2018

This needs more testing, I open this PR to have a bit more visibility on its status.

Closes #2

Please do not use this branch directly to write some code, or be prepared to rebase your changes, as I might force-push, and cherry-pick commits from time to time :)

@MayeulC MayeulC added Do not merge PR The pull request is here to be checked against the current codebase by CI and other tools rebase-needed Need to rebase on the next branch before merging labels Jul 21, 2018
@MayeulC MayeulC added this to the 0.6 milestone Jul 21, 2018
@MayeulC MayeulC self-assigned this Jul 21, 2018
@coveralls
Copy link

coveralls commented Jul 21, 2018

Pull Request Test Coverage Report for Build 45

  • 110 of 153 (71.9%) changed or added relevant lines in 12 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+17.2%) to 58.233%

Changes Missing Coverage Covered Lines Changed/Added Lines %
humble_downloader/actions.py 6 9 66.67%
humble_downloader/humble_api/model/trove_order.py 34 38 89.47%
setup.py 0 5 0.0%
humble_downloader/humble_download.py 4 16 25.0%
humble_downloader/init.py 19 38 50.0%
Totals Coverage Status
Change from base Build 43: 17.2%
Covered Lines: 534
Relevant Lines: 917

💛 - Coveralls

@felisucoibi
Copy link

waiting for the stuff to be merged

@MayeulC
Copy link
Owner Author

MayeulC commented Sep 16, 2018

Yeah sorry, I haven't had time to work on my projects lately, but I'm on holidays since yesterday, so hopefully, I'll be able to finish this up pretty quickly. I need to come back at it, see what's missing, and perform more testing. It shouldn't take very long, but I have a few changes that I didn't push/commit, and I need to make sure everything works... Thanks for reminding me of your interest 😉

If you want, though (if you are in a hurry), I could make a quick-and-dirty branch that should work.

@felisucoibi
Copy link

Take your time, i can wait, i saw you working on proton steam stuff, nice!

@MayeulC MayeulC mentioned this pull request Sep 16, 2018
@MayeulC
Copy link
Owner Author

MayeulC commented Sep 24, 2018

@felisucoibi it should now work with the latest commits, but it's still a bit rough (total size is incorrect, as well as the one first displayed, it will take a long time before downloading, resume might or might not work, and It will likely stop working after downloading for 24h). No checksums either as they are not provided.

I improved the command-line a bit, but I am planning to make further modifications.

So far, the command-line to download only trove items would be ./hb-downloader download -k Humble-trove-games.

I will likely improve the above a bit before merging, and might edit some commits, but it really should be usable.

(To download a tarball of this branch, you can use https://github.com/MayeulC/hb-downloader/archive/poc-trove.tar.gz )

@tkashkin
Copy link

tkashkin commented Dec 21, 2018

@MayeulC Humble have redesigned Trove page. Now it's impossible to extract full game info from HTML as it's now shown in dynamic popups created by JS.

But now they have all the info in an embedded JSON (<script id="webpack-monthly-trove-data" type="application/json">). Format is almost the same as what their API returns for library, but some fields are named differently (human_name is now human-name) and downloads format is a bit different.

Example:

"soma_trove": {
    "background-image": null,
    "publishers": [
        {
            "publisher-name": "Frictional Games",
            "publisher-url": "https://www.frictionalgames.com"
        }
    ],
    "machine_name": "soma_trove",
    "trove-featured": false,
    "humble-original": null,
    "downloads": {
        "windows": {
            "uploaded_at": "2018-04-09T18:04:10.784900",
            "name": "Download",
            "url": {
                "web": "SOMA_Windows_v110.zip",
                "bittorrent": "SOMA_Windows_v110.zip.torrent"
            },
            "machine_name": "soma_windows",
            "file_size": 12456084815,
            "small": 0,
            "md5": "e7234667537747427cbfa6e3f864bafc",
            "size": "11.6 GB"
        },
        "mac": {
            "uploaded_at": "2018-10-03T18:34:28.978398",
            "name": "Download",
            "url": {
                "web": "SOMA_Mac_v110_ModLauncher_Fix.zip",
                "bittorrent": "SOMA_Mac_v110_ModLauncher_Fix.zip.torrent"
            },
            "machine_name": "soma_mac",
            "file_size": 12268279926,
            "small": 0,
            "size": "11.4 GB",
            "md5": "b5796f487f5f647045bb5fb6eaf16edf"
        },
        "linux": {
            "uploaded_at": "2018-04-05T22:59:41.578640",
            "name": "Download",
            "url": {
                "web": "SOMA_Linux_v110.zip",
                "bittorrent": "SOMA_Linux_v110.zip.torrent"
            },
            "machine_name": "soma_linux",
            "file_size": 12267657895,
            "small": 0,
            "md5": "46e9dadf90d347e0f384e636e71ce746",
            "size": "11.4 GB"
        }
    },
    "trove-showcase-css": null,
    "all-access": false,
    "carousel-content": {
        "youtube-link": ["S1CU2tXnGVc"],
        "thumbnail": [...],
        "screenshot": [...]
    },
    "human-name": "SOMA",
    "logo": null,
    "description-text": "<p><em>SOMA</em> is a sci-fi horror game...",
    "developers": [
        {
            "developer-name": "Frictional Games",
            "developer-url": "https://www.frictionalgames.com"
        }
    ],
    "image": "https://hb.imgix.net/b47b15b146fd466c2c08c09ce1fd351e8e22b589.jpg?auto=compress,format&fit=crop&h=353&w=616&s=d5599a2e88aa05dfc0c09fd2adc40d7e",
    "background-color": null,
    "marketing-blurb": "<p><em>SOMA</em> is a sci-fi horror game..."
}

See tkashkin/GameHub@9d040db#diff-6973b921678612944b5591a83b23c195 for implementation example.

@MayeulC
Copy link
Owner Author

MayeulC commented Dec 21, 2018

@tkashkin Thanks a lot for the heads-up!

The addition of md5 fields is nice, I was previously quite annoyed at the lack of this :)

I hope I'll be able to finish this up later, but free time is hard to come by, these days...

@felisucoibi
Copy link

thanks for your work, waiting for the final version. Still working and using May version.

Add more tests for the API and the configuration parser.
The tests are still quite basic, but begin to exercise more code.
This prepares the introduction of a setup.py file and makes things neater.
Many thanks to Stefan Zink (@zink-chimaera) in
#11
This commit will be squashed when merging with master
The Humble Trove support is now properly wired in, and behaves just like the
other gamekeys. Tested for listing products and URLs, not for
downloading yet.
Both are now aware of the lxml dependency
It stills needs to be in the loop as the item_type subparser is created
there.
Unfortunately, the option does not play well with the next positionnal
arguments for now.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Do not merge PR The pull request is here to be checked against the current codebase by CI and other tools rebase-needed Need to rebase on the next branch before merging
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants