From a39f8a798e99060f0e874ca2662ef4501906a51b Mon Sep 17 00:00:00 2001 From: Brian Schkerke Date: Sun, 19 Nov 2017 15:24:21 -0600 Subject: [PATCH 1/8] Update README.md --- README.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/README.md b/README.md index 497b6a5..99953d9 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,9 @@ +# Question! + +How many of use Windows vs. Linux to run this software? I have an idea to accommodate the CAPTCHA and make the downloader more interactive, but I don't have the expertise to create it on Linux -- thus will only do it if you guys are using Windows. + +Please let me know at bmschkerke@gmail.com which OS you use and if you'd be interested. + # hb-downloader An automated utility to download your Humble Bundle purchases with support for the Authy token. From 0fb4eed0d2d3886a57d6c5dab873744c6608a3b7 Mon Sep 17 00:00:00 2001 From: Vincent Dahmen Date: Sat, 9 Feb 2019 00:20:32 +0100 Subject: [PATCH 2/8] easy_install: moves files into a package dir --- hb_downloader/__init__.py | 0 actions.py => hb_downloader/actions.py | 0 config_data.py => hb_downloader/config_data.py | 0 configuration.py => hb_downloader/configuration.py | 0 event_handler.py => hb_downloader/event_handler.py | 0 {humble_api => hb_downloader/humble_api}/__init__.py | 0 {humble_api => hb_downloader/humble_api}/events.py | 0 {humble_api => hb_downloader/humble_api}/exceptions/__init__.py | 0 .../humble_api}/exceptions/humble_download_needed_exception.py | 0 .../humble_api}/exceptions/humble_exception.py | 0 .../humble_api}/exceptions/humble_parse_exception.py | 0 .../humble_api}/exceptions/humble_response_exception.py | 0 {humble_api => hb_downloader/humble_api}/humble_api.py | 0 {humble_api => hb_downloader/humble_api}/humble_hash.py | 0 {humble_api => hb_downloader/humble_api}/model/__init__.py | 0 {humble_api => hb_downloader/humble_api}/model/base_model.py | 0 {humble_api => hb_downloader/humble_api}/model/download.py | 0 {humble_api => hb_downloader/humble_api}/model/download_struct.py | 0 {humble_api => hb_downloader/humble_api}/model/order.py | 0 {humble_api => hb_downloader/humble_api}/model/payee.py | 0 {humble_api => hb_downloader/humble_api}/model/product.py | 0 {humble_api => hb_downloader/humble_api}/model/subproduct.py | 0 {humble_api => hb_downloader/humble_api}/model/subscription.py | 0 humble_download.py => hb_downloader/humble_download.py | 0 logger.py => hb_downloader/logger.py | 0 progress_tracker.py => hb_downloader/progress_tracker.py | 0 {test => hb_downloader/test}/test_parse_cmdline.py | 0 27 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 hb_downloader/__init__.py rename actions.py => hb_downloader/actions.py (100%) rename config_data.py => hb_downloader/config_data.py (100%) rename configuration.py => hb_downloader/configuration.py (100%) rename event_handler.py => hb_downloader/event_handler.py (100%) rename {humble_api => hb_downloader/humble_api}/__init__.py (100%) rename {humble_api => hb_downloader/humble_api}/events.py (100%) rename {humble_api => hb_downloader/humble_api}/exceptions/__init__.py (100%) rename {humble_api => hb_downloader/humble_api}/exceptions/humble_download_needed_exception.py (100%) rename {humble_api => hb_downloader/humble_api}/exceptions/humble_exception.py (100%) rename {humble_api => hb_downloader/humble_api}/exceptions/humble_parse_exception.py (100%) rename {humble_api => hb_downloader/humble_api}/exceptions/humble_response_exception.py (100%) rename {humble_api => hb_downloader/humble_api}/humble_api.py (100%) rename {humble_api => hb_downloader/humble_api}/humble_hash.py (100%) rename {humble_api => hb_downloader/humble_api}/model/__init__.py (100%) rename {humble_api => hb_downloader/humble_api}/model/base_model.py (100%) rename {humble_api => hb_downloader/humble_api}/model/download.py (100%) rename {humble_api => hb_downloader/humble_api}/model/download_struct.py (100%) rename {humble_api => hb_downloader/humble_api}/model/order.py (100%) rename {humble_api => hb_downloader/humble_api}/model/payee.py (100%) rename {humble_api => hb_downloader/humble_api}/model/product.py (100%) rename {humble_api => hb_downloader/humble_api}/model/subproduct.py (100%) rename {humble_api => hb_downloader/humble_api}/model/subscription.py (100%) rename humble_download.py => hb_downloader/humble_download.py (100%) rename logger.py => hb_downloader/logger.py (100%) rename progress_tracker.py => hb_downloader/progress_tracker.py (100%) rename {test => hb_downloader/test}/test_parse_cmdline.py (100%) diff --git a/hb_downloader/__init__.py b/hb_downloader/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/actions.py b/hb_downloader/actions.py similarity index 100% rename from actions.py rename to hb_downloader/actions.py diff --git a/config_data.py b/hb_downloader/config_data.py similarity index 100% rename from config_data.py rename to hb_downloader/config_data.py diff --git a/configuration.py b/hb_downloader/configuration.py similarity index 100% rename from configuration.py rename to hb_downloader/configuration.py diff --git a/event_handler.py b/hb_downloader/event_handler.py similarity index 100% rename from event_handler.py rename to hb_downloader/event_handler.py diff --git a/humble_api/__init__.py b/hb_downloader/humble_api/__init__.py similarity index 100% rename from humble_api/__init__.py rename to hb_downloader/humble_api/__init__.py diff --git a/humble_api/events.py b/hb_downloader/humble_api/events.py similarity index 100% rename from humble_api/events.py rename to hb_downloader/humble_api/events.py diff --git a/humble_api/exceptions/__init__.py b/hb_downloader/humble_api/exceptions/__init__.py similarity index 100% rename from humble_api/exceptions/__init__.py rename to hb_downloader/humble_api/exceptions/__init__.py diff --git a/humble_api/exceptions/humble_download_needed_exception.py b/hb_downloader/humble_api/exceptions/humble_download_needed_exception.py similarity index 100% rename from humble_api/exceptions/humble_download_needed_exception.py rename to hb_downloader/humble_api/exceptions/humble_download_needed_exception.py diff --git a/humble_api/exceptions/humble_exception.py b/hb_downloader/humble_api/exceptions/humble_exception.py similarity index 100% rename from humble_api/exceptions/humble_exception.py rename to hb_downloader/humble_api/exceptions/humble_exception.py diff --git a/humble_api/exceptions/humble_parse_exception.py b/hb_downloader/humble_api/exceptions/humble_parse_exception.py similarity index 100% rename from humble_api/exceptions/humble_parse_exception.py rename to hb_downloader/humble_api/exceptions/humble_parse_exception.py diff --git a/humble_api/exceptions/humble_response_exception.py b/hb_downloader/humble_api/exceptions/humble_response_exception.py similarity index 100% rename from humble_api/exceptions/humble_response_exception.py rename to hb_downloader/humble_api/exceptions/humble_response_exception.py diff --git a/humble_api/humble_api.py b/hb_downloader/humble_api/humble_api.py similarity index 100% rename from humble_api/humble_api.py rename to hb_downloader/humble_api/humble_api.py diff --git a/humble_api/humble_hash.py b/hb_downloader/humble_api/humble_hash.py similarity index 100% rename from humble_api/humble_hash.py rename to hb_downloader/humble_api/humble_hash.py diff --git a/humble_api/model/__init__.py b/hb_downloader/humble_api/model/__init__.py similarity index 100% rename from humble_api/model/__init__.py rename to hb_downloader/humble_api/model/__init__.py diff --git a/humble_api/model/base_model.py b/hb_downloader/humble_api/model/base_model.py similarity index 100% rename from humble_api/model/base_model.py rename to hb_downloader/humble_api/model/base_model.py diff --git a/humble_api/model/download.py b/hb_downloader/humble_api/model/download.py similarity index 100% rename from humble_api/model/download.py rename to hb_downloader/humble_api/model/download.py diff --git a/humble_api/model/download_struct.py b/hb_downloader/humble_api/model/download_struct.py similarity index 100% rename from humble_api/model/download_struct.py rename to hb_downloader/humble_api/model/download_struct.py diff --git a/humble_api/model/order.py b/hb_downloader/humble_api/model/order.py similarity index 100% rename from humble_api/model/order.py rename to hb_downloader/humble_api/model/order.py diff --git a/humble_api/model/payee.py b/hb_downloader/humble_api/model/payee.py similarity index 100% rename from humble_api/model/payee.py rename to hb_downloader/humble_api/model/payee.py diff --git a/humble_api/model/product.py b/hb_downloader/humble_api/model/product.py similarity index 100% rename from humble_api/model/product.py rename to hb_downloader/humble_api/model/product.py diff --git a/humble_api/model/subproduct.py b/hb_downloader/humble_api/model/subproduct.py similarity index 100% rename from humble_api/model/subproduct.py rename to hb_downloader/humble_api/model/subproduct.py diff --git a/humble_api/model/subscription.py b/hb_downloader/humble_api/model/subscription.py similarity index 100% rename from humble_api/model/subscription.py rename to hb_downloader/humble_api/model/subscription.py diff --git a/humble_download.py b/hb_downloader/humble_download.py similarity index 100% rename from humble_download.py rename to hb_downloader/humble_download.py diff --git a/logger.py b/hb_downloader/logger.py similarity index 100% rename from logger.py rename to hb_downloader/logger.py diff --git a/progress_tracker.py b/hb_downloader/progress_tracker.py similarity index 100% rename from progress_tracker.py rename to hb_downloader/progress_tracker.py diff --git a/test/test_parse_cmdline.py b/hb_downloader/test/test_parse_cmdline.py similarity index 100% rename from test/test_parse_cmdline.py rename to hb_downloader/test/test_parse_cmdline.py From 781496bfc8dfef14486ffd3d927bb51c377f54be Mon Sep 17 00:00:00 2001 From: Vincent Dahmen Date: Sat, 9 Feb 2019 00:21:12 +0100 Subject: [PATCH 3/8] update script: modifies to use package --- hb-downloader.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/hb-downloader.py b/hb-downloader.py index 27d034c..f32da51 100755 --- a/hb-downloader.py +++ b/hb-downloader.py @@ -1,11 +1,11 @@ #!/usr/bin/env python3 # -*- coding: utf-8 -*- -import logger -from config_data import ConfigData -from configuration import Configuration -from event_handler import EventHandler -from humble_api.humble_api import HumbleApi -from actions import Action +import hb_downloader.logger as logger +from hb_downloader.config_data import ConfigData +from hb_downloader.configuration import Configuration +from hb_downloader.event_handler import EventHandler +from hb_downloader.humble_api.humble_api import HumbleApi +from hb_downloader.actions import Action __author__ = "Brian Schkerke" __copyright__ = "Copyright 2016 Brian Schkerke" From d08f6193077b19afc3d0d57c8ed63e9dfb0c0e30 Mon Sep 17 00:00:00 2001 From: Vincent Dahmen Date: Sat, 9 Feb 2019 00:21:48 +0100 Subject: [PATCH 4/8] easy_install: adds minimal setup.py --- setup.py | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 setup.py diff --git a/setup.py b/setup.py new file mode 100644 index 0000000..4c1829e --- /dev/null +++ b/setup.py @@ -0,0 +1,10 @@ +from setuptools import setup + +setup(name='hb_downloader', + version='0.5.0', + description='an unofficial api client for humblebundle', + url='https://github.com/MayeulC/hb-downloader/releases', + author='Brian Schkerke', + license='MIT', + packages=['hb_downloader'], + zip_safe=False) From e4f409d02c4d4e5ff2427ea9b68ea506dfc41adc Mon Sep 17 00:00:00 2001 From: Vincent Dahmen Date: Sat, 9 Feb 2019 01:54:41 +0100 Subject: [PATCH 5/8] easy_install: fixes paths and adds testing --- hb_downloader/actions.py | 8 ++++---- hb_downloader/configuration.py | 6 +++--- hb_downloader/event_handler.py | 4 ++-- hb_downloader/humble_download.py | 6 +++--- hb_downloader/logger.py | 2 +- hb_downloader/progress_tracker.py | 2 +- hb_downloader/test/test_parse_cmdline.py | 4 ++-- setup.py | 2 ++ 8 files changed, 18 insertions(+), 16 deletions(-) diff --git a/hb_downloader/actions.py b/hb_downloader/actions.py index 7664392..ced630b 100644 --- a/hb_downloader/actions.py +++ b/hb_downloader/actions.py @@ -3,10 +3,10 @@ __license__ = "MIT" -from humble_download import HumbleDownload -from progress_tracker import ProgressTracker -from config_data import ConfigData -import logger +from hb_downloader.humble_download import HumbleDownload +from hb_downloader.progress_tracker import ProgressTracker +from hb_downloader.config_data import ConfigData +from hb_downloader import logger class Action: diff --git a/hb_downloader/configuration.py b/hb_downloader/configuration.py index 7e0ee93..dfab9ee 100644 --- a/hb_downloader/configuration.py +++ b/hb_downloader/configuration.py @@ -3,9 +3,9 @@ import argparse import os import yaml -import logger -from config_data import ConfigData -from humble_api.humble_hash import HumbleHash +from hb_downloader import logger +from hb_downloader.config_data import ConfigData +from hb_downloader.humble_api.humble_hash import HumbleHash __author__ = "Brian Schkerke" __copyright__ = "Copyright 2016 Brian Schkerke" diff --git a/hb_downloader/event_handler.py b/hb_downloader/event_handler.py index e3786e0..aae538f 100644 --- a/hb_downloader/event_handler.py +++ b/hb_downloader/event_handler.py @@ -1,8 +1,8 @@ #!/usr/bin/env python3 # -*- coding: utf-8 -*- import sys -import logger -from humble_api.events import Events +from hb_downloader import logger +from hb_downloader.humble_api.events import Events __author__ = "Brian Schkerke" __copyright__ = "Copyright 2016 Brian Schkerke" diff --git a/hb_downloader/humble_download.py b/hb_downloader/humble_download.py index 5f45f87..58003e2 100644 --- a/hb_downloader/humble_download.py +++ b/hb_downloader/humble_download.py @@ -2,9 +2,9 @@ # -*- coding: utf-8 -*- import os import requests -from config_data import ConfigData -from humble_api.events import Events -from humble_api.humble_hash import HumbleHash +from hb_downloader.config_data import ConfigData +from hb_downloader.humble_api.events import Events +from hb_downloader.humble_api.humble_hash import HumbleHash __author__ = "Brian Schkerke" __copyright__ = "Copyright 2016 Brian Schkerke" diff --git a/hb_downloader/logger.py b/hb_downloader/logger.py index e0e609a..22d315e 100644 --- a/hb_downloader/logger.py +++ b/hb_downloader/logger.py @@ -1,6 +1,6 @@ #!/usr/bin/env python3 # -*- coding: utf-8 -*- -from config_data import ConfigData +from hb_downloader.config_data import ConfigData import time import sys diff --git a/hb_downloader/progress_tracker.py b/hb_downloader/progress_tracker.py index ccce8f0..8f9027a 100644 --- a/hb_downloader/progress_tracker.py +++ b/hb_downloader/progress_tracker.py @@ -1,6 +1,6 @@ #!/usr/bin/env python3 # -*- coding: utf-8 -*- -import logger +from hb_downloader import logger __author__ = "Brian Schkerke" __copyright__ = "Copyright 2016 Brian Schkerke" diff --git a/hb_downloader/test/test_parse_cmdline.py b/hb_downloader/test/test_parse_cmdline.py index e50dd43..b012b84 100644 --- a/hb_downloader/test/test_parse_cmdline.py +++ b/hb_downloader/test/test_parse_cmdline.py @@ -3,8 +3,8 @@ import sys import subprocess -from config_data import ConfigData -from configuration import Configuration +from hb_downloader.config_data import ConfigData +from hb_downloader.configuration import Configuration actions = ["download", "list"] diff --git a/setup.py b/setup.py index 4c1829e..60017fc 100644 --- a/setup.py +++ b/setup.py @@ -7,4 +7,6 @@ author='Brian Schkerke', license='MIT', packages=['hb_downloader'], + test_suite='nose.collector', + tests_require=['nose'], zip_safe=False) From 6514ae30bbaba09841ab3c17ef2fed7a293ad896 Mon Sep 17 00:00:00 2001 From: Vincent Dahmen Date: Sat, 9 Feb 2019 02:14:02 +0100 Subject: [PATCH 6/8] easy_install: includes subpackage --- setup.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 60017fc..1fba8ad 100644 --- a/setup.py +++ b/setup.py @@ -6,7 +6,12 @@ url='https://github.com/MayeulC/hb-downloader/releases', author='Brian Schkerke', license='MIT', - packages=['hb_downloader'], + packages=[ + 'hb_downloader', + 'hb_downloader.humble_api', + 'hb_downloader.humble_api.model', + 'hb_downloader.humble_api.exceptions' + ], test_suite='nose.collector', tests_require=['nose'], zip_safe=False) From 934261140c8c83989976661ec974c3ebb53bf7f5 Mon Sep 17 00:00:00 2001 From: Vincent Dahmen Date: Sat, 9 Feb 2019 03:22:20 +0100 Subject: [PATCH 7/8] config: search in /etc rather than local --- hb-downloader.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/hb-downloader.py b/hb-downloader.py index f32da51..3dd94c6 100755 --- a/hb-downloader.py +++ b/hb-downloader.py @@ -19,7 +19,13 @@ print("") # Load the configuration from the YAML file... -Configuration.load_configuration("hb-downloader-settings.yaml") +try: + Configuration.load_configuration("/etc/hb_downloader.yaml") +except FileNotFoundError: + print("Configuration File not found in /etc") + print("Trying local instead...") + Configuration.load_configuration("hb-downloader-settings.yaml") + Configuration.parse_command_line() Configuration.dump_configuration() Configuration.push_configuration() From 0135dd2fa0dfbb98a58146841fea082434e776cc Mon Sep 17 00:00:00 2001 From: Claudius Coenen Date: Sat, 2 Mar 2019 11:00:04 +0100 Subject: [PATCH 8/8] fixing wrong filename written to md5 hash file. --- hb_downloader/humble_api/humble_hash.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hb_downloader/humble_api/humble_hash.py b/hb_downloader/humble_api/humble_hash.py index 28c3668..351181e 100644 --- a/hb_downloader/humble_api/humble_hash.py +++ b/hb_downloader/humble_api/humble_hash.py @@ -154,7 +154,7 @@ def write_md5file(full_filename, checksum): return md5full_filename = HumbleHash.md5filename(full_filename) - local_filename = os.path.basename(md5full_filename) + local_filename = os.path.basename(full_filename) if os.path.exists(md5full_filename): os.remove(md5full_filename)