From f824ac093f0649c01b4da709257c94e5c27a4d30 Mon Sep 17 00:00:00 2001 From: daniel-Jones Date: Wed, 31 Jan 2018 09:28:39 +1030 Subject: added videourls array, any domain the array will be treated as a video --- urlopen.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/urlopen.py b/urlopen.py index 1e70844..495956a 100755 --- a/urlopen.py +++ b/urlopen.py @@ -11,6 +11,7 @@ def run(process, arg): def main(args): images = ["jpg", "png"]; imageapp = ["feh"]; videos = ["gif", "gifv", "webm", "mp4"]; videoapp = ["mpv", "--loop"]; + videourls = ["youtube.com", "youtu.be", "streamable.com"]; pdf = ["pdf"]; pdfapp = ["mupdf"]; defaultapp = ["/home/daniel_j/compiled/waterfox/waterfox"]; x = 0; @@ -26,7 +27,7 @@ def main(args): elif (each.endswith(tuple(pdf))): print("pdf {}".format(each)); run(pdfapp, each); - elif ("youtube.com" or "youtu.be" in domain): + elif (any(s in domain for s in videourls)): print("video {}".format(each)); run(videoapp, each); else: -- cgit v1.2.3