diff options
author | daniel-Jones <daniel@danieljon.es> | 2018-01-31 09:28:39 +1030 |
---|---|---|
committer | daniel-Jones <daniel@danieljon.es> | 2018-01-31 09:28:39 +1030 |
commit | f824ac093f0649c01b4da709257c94e5c27a4d30 (patch) | |
tree | c8cc78af564e8ca302828fae9a7dc648ba5d90b5 | |
parent | 46990513a0528eee0561fa7cee2f591c9f81bb96 (diff) | |
download | urlopen-f824ac093f0649c01b4da709257c94e5c27a4d30.tar.gz urlopen-f824ac093f0649c01b4da709257c94e5c27a4d30.zip |
added videourls array, any domain the array will be treated as a video
-rwxr-xr-x | urlopen.py | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -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: |