summaryrefslogtreecommitdiff
path: root/discover-url.py
diff options
context:
space:
mode:
Diffstat (limited to 'discover-url.py')
-rwxr-xr-xdiscover-url.py23
1 files changed, 23 insertions, 0 deletions
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()
+