Compare commits
No commits in common. "04bac1f201bc102775b07c7bdad525a681592eb6" and "f8cbf40e1d1da62ff8c7f4eddd80e75a14f7472c" have entirely different histories.
04bac1f201
...
f8cbf40e1d
3 changed files with 4 additions and 5 deletions
|
|
@ -7,9 +7,7 @@ lang = '1080p'
|
||||||
start = ''
|
start = ''
|
||||||
lights = False
|
lights = False
|
||||||
font = 'Menlo'
|
font = 'Menlo'
|
||||||
# SimHei for chinese
|
|
||||||
font_size = 28
|
font_size = 28
|
||||||
# 30 for chinese
|
|
||||||
|
|
||||||
conf = os.path.expanduser('~/.config/cdosea.json')
|
conf = os.path.expanduser('~/.config/cdosea.json')
|
||||||
if os.path.exists(conf):
|
if os.path.exists(conf):
|
||||||
|
|
|
||||||
|
|
@ -42,6 +42,7 @@ def main():
|
||||||
logging.basicConfig(level=logging.DEBUG, format=log_format)
|
logging.basicConfig(level=logging.DEBUG, format=log_format)
|
||||||
base = os.path.dirname(os.path.abspath(__file__))
|
base = os.path.dirname(os.path.abspath(__file__))
|
||||||
os.chdir(base)
|
os.chdir(base)
|
||||||
|
|
||||||
player = get_player(font=config.font, font_size=config.font_size)
|
player = get_player(font=config.font, font_size=config.font_size)
|
||||||
player.register_key_binding('q', q_binding)
|
player.register_key_binding('q', q_binding)
|
||||||
|
|
||||||
|
|
@ -68,7 +69,7 @@ def main():
|
||||||
player.pause = True
|
player.pause = True
|
||||||
pause_next = False
|
pause_next = False
|
||||||
play_lights = False
|
play_lights = False
|
||||||
elif player.path and player.path.decode().endswith('black.mp4'):
|
elif player.path.decode().endswith('black.mp4'):
|
||||||
pause_next = True
|
pause_next = True
|
||||||
play_lights = False
|
play_lights = False
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -26,8 +26,8 @@ def get_subtitle(url, name):
|
||||||
try:
|
try:
|
||||||
r = requests.get(url)
|
r = requests.get(url)
|
||||||
if r.status_code == 200:
|
if r.status_code == 200:
|
||||||
with open('%s.tmp' % name, 'wb') as fd:
|
with open('%s.tmp' % name, 'w') as fd:
|
||||||
fd.write(r.content)
|
fd.write(r.text)
|
||||||
shutil.move('%s.tmp' % name, name)
|
shutil.move('%s.tmp' % name, name)
|
||||||
else:
|
else:
|
||||||
print('%s failed (%s)' % (url, r.status_code))
|
print('%s failed (%s)' % (url, r.status_code))
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue