From 04bac1f201bc102775b07c7bdad525a681592eb6 Mon Sep 17 00:00:00 2001 From: j Date: Wed, 29 Dec 2021 11:47:31 +0100 Subject: [PATCH] don't decode/encode subs --- cdoseaplay/config.py | 2 ++ cdoseaplay/update.py | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/cdoseaplay/config.py b/cdoseaplay/config.py index 4b88206..c83db96 100644 --- a/cdoseaplay/config.py +++ b/cdoseaplay/config.py @@ -7,7 +7,9 @@ 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/update.py b/cdoseaplay/update.py index 9469783..d9ced70 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, 'w') as fd: - fd.write(r.text) + with open('%s.tmp' % name, 'wb') as fd: + fd.write(r.content) shutil.move('%s.tmp' % name, name) else: print('%s failed (%s)' % (url, r.status_code))