diff options
author | daniel-Jones <daniel@danieljon.es> | 2018-01-31 09:58:02 +1030 |
---|---|---|
committer | daniel-Jones <daniel@danieljon.es> | 2018-01-31 09:58:02 +1030 |
commit | 049053efc4d155579973b886096fd04568719432 (patch) | |
tree | 1aad3f800855c6f947061a714f6cb718a6890673 | |
parent | f824ac093f0649c01b4da709257c94e5c27a4d30 (diff) | |
download | urlopen-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-x | urlopen.py | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -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))): |