mirror of
https://github.com/clinton-hall/nzbToMedia.git
synced 2025-08-14 02:26:53 -07:00
Refactor ISO file matching to use regex only once per file.
This commit is contained in:
parent
cd64014a9d
commit
28eed3bc92
1 changed files with 9 additions and 2 deletions
|
@ -646,8 +646,15 @@ def rip_iso(item, new_dir, bitbucket):
|
||||||
print_cmd(cmd)
|
print_cmd(cmd)
|
||||||
proc = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=bitbucket)
|
proc = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=bitbucket)
|
||||||
out, err = proc.communicate()
|
out, err = proc.communicate()
|
||||||
file_list = [re.match(r'.+(VIDEO_TS[/\\]VTS_[0-9][0-9]_[0-9].[Vv][Oo][Bb])', line).groups()[0] for line in
|
file_match_gen = (
|
||||||
out.decode().splitlines() if re.match(r'.+VIDEO_TS[/\\]VTS_[0-9][0-9]_[0-9].[Vv][Oo][Bb]', line)]
|
re.match(r'.+(VIDEO_TS[/\\]VTS_[0-9][0-9]_[0-9].[Vv][Oo][Bb])', line)
|
||||||
|
for line in out.decode().splitlines()
|
||||||
|
)
|
||||||
|
file_list = [
|
||||||
|
file_match.groups()[0]
|
||||||
|
for file_match in file_match_gen
|
||||||
|
if file_match
|
||||||
|
]
|
||||||
combined = []
|
combined = []
|
||||||
for n in range(99):
|
for n in range(99):
|
||||||
concat = []
|
concat = []
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue