hb-downloader
hb-downloader copied to clipboard
WIP 0.6: Add trove support
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 :)
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% |
<!-- | Total: | 110 | 153 |
Totals | |
---|---|
Change from base Build 43: | 17.2% |
Covered Lines: | 534 |
Relevant Lines: | 917 |
💛 - Coveralls
waiting for the stuff to be merged
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 :wink:
If you want, though (if you are in a hurry), I could make a quick-and-dirty branch that should work.
Take your time, i can wait, i saw you working on proton steam stuff, nice!
@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 )
@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 https://github.com/tkashkin/GameHub/commit/9d040dba46fc734f1b6d1e8ca5e433c5efcc4afb#diff-6973b921678612944b5591a83b23c195 for implementation example.
@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...
thanks for your work, waiting for the final version. Still working and using May version.