Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

recursive extraction for rar files containing rar files #6

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions service.py
Original file line number Diff line number Diff line change
Expand Up @@ -302,12 +302,17 @@ def _handle_compressed_subs(workdir, compressed_file):
workdir.encode("utf-8")))

retval = False
fpath = None
if _wait_for_extract(workdir, filecount, base_mtime, MAX_UNZIP_WAIT):
files = os.listdir(workdir)
for fname in files:
# There could be more subtitle files, so make
# sure we get the newly created subtitle file
if not is_subs_file(fname):
if re.match(r'.*\.rar', fname, re.I):
retval, fpath = _handle_compressed_subs(workdir, pjoin(workdir, fname))
if retval:
break
continue
fpath = pjoin(workdir, fname.decode("utf-8"))
if os.stat(fpath).st_mtime > base_mtime:
Expand Down