summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordaniel-Jones <daniel@danieljon.es>2018-01-31 09:58:02 +1030
committerdaniel-Jones <daniel@danieljon.es>2018-01-31 09:58:02 +1030
commit049053efc4d155579973b886096fd04568719432 (patch)
tree1aad3f800855c6f947061a714f6cb718a6890673
parentf824ac093f0649c01b4da709257c94e5c27a4d30 (diff)
downloadurlopen-049053efc4d155579973b886096fd04568719432.tar.gz
urlopen-049053efc4d155579973b886096fd04568719432.zip
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
-rwxr-xr-xurlopen.py6
1 files changed, 5 insertions, 1 deletions
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))):