From 049053efc4d155579973b886096fd04568719432 Mon Sep 17 00:00:00 2001 From: daniel-Jones Date: Wed, 31 Jan 2018 09:58:02 +1030 Subject: added list of forced urls to open with the default application, useful for websites that require you to be logged in for content, ie slack --- urlopen.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/urlopen.py b/urlopen.py index 495956a..2c2b8da 100755 --- a/urlopen.py +++ b/urlopen.py @@ -14,11 +14,15 @@ def main(args): videourls = ["youtube.com", "youtu.be", "streamable.com"]; pdf = ["pdf"]; pdfapp = ["mupdf"]; defaultapp = ["/home/daniel_j/compiled/waterfox/waterfox"]; + defaultforcedurls = ["slack.com"] x = 0; for each in args: parsed_uri = urlparse(each); domain = '{uri.scheme}://{uri.netloc}/'.format(uri=parsed_uri); - if (each.endswith(tuple(images))): + if (any (s in domain for s in defaultforcedurls)): + print("running with forced default application {}".format(each)); + run(defaultapp, each); + elif (each.endswith(tuple(images))): print("image {}".format(each)); run(imageapp, each); elif (each.endswith(tuple(videos))): -- cgit v1.2.3