summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordaniel-Jones <daniel@danieljon.es>2018-01-31 09:28:39 +1030
committerdaniel-Jones <daniel@danieljon.es>2018-01-31 09:28:39 +1030
commitf824ac093f0649c01b4da709257c94e5c27a4d30 (patch)
treec8cc78af564e8ca302828fae9a7dc648ba5d90b5
parent46990513a0528eee0561fa7cee2f591c9f81bb96 (diff)
downloadurlopen-f824ac093f0649c01b4da709257c94e5c27a4d30.tar.gz
urlopen-f824ac093f0649c01b4da709257c94e5c27a4d30.zip
added videourls array, any domain the array will be treated as a video
-rwxr-xr-xurlopen.py3
1 files changed, 2 insertions, 1 deletions
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: