From 13a1153d52347b769c71cdf0fdec37d91cc602af Mon Sep 17 00:00:00 2001 From: Yaohan Chen Date: Thu, 16 Apr 2015 20:37:15 -0400 Subject: Use humblebundle-python to work with HIB API --- discover-url.py | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100755 discover-url.py (limited to 'discover-url.py') diff --git a/discover-url.py b/discover-url.py new file mode 100755 index 0000000..b60d608 --- /dev/null +++ b/discover-url.py @@ -0,0 +1,23 @@ +#!/usr/bin/env python + +import humblebundle +import sys +import os + +filename = sys.argv[2] +username = sys.argv[3] +password = os.environ['PASSWORD'] + +client = humblebundle.HumbleApi() +client.login(username, password) + +order_list = client.order_list() +for order in order_list: + for subproduct in order.subproducts: + for download in subproduct.downloads: + for download_struct in download.download_struct: + url = download_struct.url.web + if filename in url: + print(url) + exit() + -- cgit v1.2.3-70-g09d2