Page MenuHomeDevCentral

D3976.id10315.diff
No OneTemporary

D3976.id10315.diff

diff --git a/support/terminator/resolve_hash.py b/support/terminator/resolve_hash.py
new file mode 100644
--- /dev/null
+++ b/support/terminator/resolve_hash.py
@@ -0,0 +1,32 @@
+from terminatorlib.plugin import URLHandler
+import subprocess
+import os
+
+from resolvehash.resolvehash import parse_config, find_hash
+
+AVAILABLE = ["ResolveHashURLHandler"]
+
+
+class ResolveHashURLHandler(URLHandler):
+ capabilities = ["url_handler"]
+ handler_name = "resolve_hash"
+ name = "Nasqueron Resolve Hash"
+
+ # Long enough hexadecimal expressions are good hash candidates
+ match = r"\b[0-9a-f]{7,40}\b"
+
+ def __init__(self):
+ URLHandler.__init__(self)
+ self.config = parse_config()
+
+ def callback(self, needle_hash):
+ try:
+ final_url = find_hash(self.config, needle_hash)
+
+ if final_url.startswith("http"):
+ return final_url
+
+ except Exception:
+ pass
+
+ return None

File Metadata

Mime Type
text/plain
Expires
Thu, Apr 16, 06:53 (13 h, 25 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3628955
Default Alt Text
D3976.id10315.diff (984 B)

Event Timeline