diff --git a/cdoseaplay/config.py b/cdoseaplay/config.py index c83db96..4b88206 100644 --- a/cdoseaplay/config.py +++ b/cdoseaplay/config.py @@ -7,9 +7,7 @@ lang = '1080p' start = '' lights = False font = 'Menlo' -# SimHei for chinese font_size = 28 -# 30 for chinese conf = os.path.expanduser('~/.config/cdosea.json') if os.path.exists(conf): diff --git a/cdoseaplay/play.py b/cdoseaplay/play.py index 500e24e..1d90854 100755 --- a/cdoseaplay/play.py +++ b/cdoseaplay/play.py @@ -42,6 +42,7 @@ def main(): logging.basicConfig(level=logging.DEBUG, format=log_format) base = os.path.dirname(os.path.abspath(__file__)) os.chdir(base) + player = get_player(font=config.font, font_size=config.font_size) player.register_key_binding('q', q_binding) @@ -68,7 +69,7 @@ def main(): player.pause = True pause_next = False play_lights = False - elif player.path and player.path.decode().endswith('black.mp4'): + elif player.path.decode().endswith('black.mp4'): pause_next = True play_lights = False diff --git a/cdoseaplay/update.py b/cdoseaplay/update.py index d9ced70..9469783 100755 --- a/cdoseaplay/update.py +++ b/cdoseaplay/update.py @@ -26,8 +26,8 @@ def get_subtitle(url, name): try: r = requests.get(url) if r.status_code == 200: - with open('%s.tmp' % name, 'wb') as fd: - fd.write(r.content) + with open('%s.tmp' % name, 'w') as fd: + fd.write(r.text) shutil.move('%s.tmp' % name, name) else: print('%s failed (%s)' % (url, r.status_code))