Private GIT

Skip to content
Snippets Groups Projects
Commit a24a96f6 authored by Luca's avatar Luca
Browse files

Fix Subliminal download_zip_file now respecting the correct CR

parent e05b96a2
No related branches found
No related tags found
No related merge requests found
...@@ -219,18 +219,10 @@ class ServiceBase(object): ...@@ -219,18 +219,10 @@ class ServiceBase(object):
# TODO: could check if maybe we already have a text file and # TODO: could check if maybe we already have a text file and
# download it directly # download it directly
raise DownloadFailedError('Downloaded file is not a zip file') raise DownloadFailedError('Downloaded file is not a zip file')
# with zipfile.ZipFile(zippath) as zipsub:
# for subfile in zipsub.namelist():
# if os.path.splitext(subfile)[1] in EXTENSIONS:
# with open(filepath, 'w') as f:
# f.write(zipsub.open(subfile).read())
# break
# else:
# raise DownloadFailedError('No subtitles found in zip file')
zipsub = zipfile.ZipFile(zippath) zipsub = zipfile.ZipFile(zippath)
for subfile in zipsub.namelist(): for subfile in zipsub.namelist():
if os.path.splitext(subfile)[1] in EXTENSIONS: if os.path.splitext(subfile)[1] in EXTENSIONS:
with open(filepath, 'w') as f: with open(filepath, 'wb') as f:
f.write(zipsub.open(subfile).read()) f.write(zipsub.open(subfile).read())
break break
else: else:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment