play
This commit is contained in:
parent
87b4d1bd0d
commit
6bce711ea3
1 changed files with 15 additions and 3 deletions
|
@ -5,6 +5,8 @@ import sys
|
|||
from glob import glob
|
||||
import datetime
|
||||
import time
|
||||
import string
|
||||
import random
|
||||
|
||||
import ox
|
||||
import mpv
|
||||
|
@ -32,10 +34,20 @@ playlist = 'play.m3u'
|
|||
today = datetime.date.today()
|
||||
seconds_since_midnight = time.time() - time.mktime(today.timetuple())
|
||||
|
||||
prefix = ''
|
||||
if os.path.exists('local'):
|
||||
files = sorted(glob('/srv/pandora/static/render/*/*.mp4'))
|
||||
else:
|
||||
files = sorted(glob('*/*.mp4'))
|
||||
prefix = '/srv/pandora/static/render/'
|
||||
|
||||
files = []
|
||||
videos = {}
|
||||
for letter in string.ascii_uppercase:
|
||||
videos[letter] = glob('%s*/%s.mp4' % (prefix, letter))
|
||||
random.shuffle(videos[letter])
|
||||
|
||||
for i in range(10):
|
||||
for letter in string.ascii_uppercase:
|
||||
files.append(videos[letter][i])
|
||||
|
||||
position = 0
|
||||
while position < seconds_since_midnight:
|
||||
f = files.pop(0)
|
||||
|
|
Loading…
Reference in a new issue