add headers.json and fix relative singlefile path resolving for sonic

This commit is contained in:
Nick Sweeting 2021-01-30 21:58:38 -05:00
parent c089501073
commit 24e24934f7
2 changed files with 3 additions and 1 deletions

View file

@ -427,6 +427,7 @@ class Link:
'archive_org_path': 'https://web.archive.org/web/{}'.format(self.base_url), 'archive_org_path': 'https://web.archive.org/web/{}'.format(self.base_url),
'git_path': 'git/', 'git_path': 'git/',
'media_path': 'media/', 'media_path': 'media/',
'headers_path': 'headers.json',
} }
if self.is_static: if self.is_static:
# static binary files like PDF and images are handled slightly differently. # static binary files like PDF and images are handled slightly differently.

View file

@ -34,10 +34,11 @@ def get_indexable_content(results: QuerySet):
return [] return []
# This should come from a plugin interface # This should come from a plugin interface
# TODO: banish this duplication and get these from the extractor file
if method == 'readability': if method == 'readability':
return get_file_result_content(res, 'content.txt') return get_file_result_content(res, 'content.txt')
elif method == 'singlefile': elif method == 'singlefile':
return get_file_result_content(res, '') return get_file_result_content(res,'',use_pwd=True)
elif method == 'dom': elif method == 'dom':
return get_file_result_content(res,'',use_pwd=True) return get_file_result_content(res,'',use_pwd=True)
elif method == 'wget': elif method == 'wget':