-
Notifications
You must be signed in to change notification settings - Fork 98
/
vidplay.py
47 lines (42 loc) · 1.56 KB
/
vidplay.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
import glob, os, random, sys
import threading, numpy as np
import datetime, random
from rsync import ls
import select, kutil
def pick_file():
dir = "/media/burak/Backup Plus/shows"
dirs,flist = ls(dir)
def fin(s,l): return np.any([x in l for x in s])
playlist = [f[0] for f in flist if fin(['.mp4','.mkv','.avi'], f[0])]
print ('count', len(playlist))
# playlist = [f for f in playlist if 'SG-1' not in f]
# playlist = [f for f in playlist if 'DS9' not in f]
playlist = [f for f in playlist if 'VOYAGER' not in f]
playlist = [f for f in playlist if 'Atlantis' not in f]
# playlist = [f for f in playlist if 'The Next Generation' not in f]
# playlist = [f for f in playlist if 'Enterprise' not in f]
# playlist = [f for f in playlist if 'Firefly' not in f]
# playlist = [f for f in playlist if 'Expanse' not in f]
# playlist = [f for f in playlist if 'Lost' not in f]
# playlist = [f for f in playlist if '/TLS/' not in f]
# playlist = [f for f in playlist if 'BSG' not in f]
# playlist = [f for f in playlist if 'Doctor' not in f]
print ('filterd count', len(playlist))
idx = util.my_random(len(playlist))
#idx = util.my_random2(len(playlist))
f = playlist[idx]
print ("show idx selected", idx)
return f
def rnd_play():
f = pick_file()
cmd = "vlc '%s' -f " % f
print (cmd)
os.system(cmd)
def rnd_copy():
f = pick_file()
cmd = "cp '%s' /home/burak/Downloads/ " % f
print (cmd)
os.system(cmd)
if __name__ == "__main__":
rnd_play()
#rnd_copy()