Merge pull request #608 from cdvv7788/extractor-bugs

This commit is contained in:
Nick Sweeting 2021-01-07 16:38:56 +02:00 committed by GitHub
commit f2a0068c17
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 1 deletions

View file

@ -28,7 +28,7 @@ def ShellError(cmd: List[str], result: CompletedProcess, lines: int=20) -> Archi
# parse out last line of stderr # parse out last line of stderr
return ArchiveError( return ArchiveError(
f'Got {cmd[0]} response code: {result.returncode}).', f'Got {cmd[0]} response code: {result.returncode}).',
*( " ".join(
line.strip() line.strip()
for line in (result.stdout + result.stderr).decode().rsplit('\n', lines)[-lines:] for line in (result.stdout + result.stderr).decode().rsplit('\n', lines)[-lines:]
if line.strip() if line.strip()

View file

@ -181,4 +181,8 @@ def wget_output_path(link: Link) -> Optional[str]:
if str(search_dir) == link.link_dir: if str(search_dir) == link.link_dir:
break break
search_dir = Path(link.link_dir) / domain(link.url).replace(":", "+") / urldecode(full_path)
if not search_dir.is_dir():
return str(search_dir.relative_to(link.link_dir))
return None return None