mirror of
https://github.com/ArchiveBox/ArchiveBox.git
synced 2025-05-14 07:04:27 -04:00
refactor: Unpack extractors tuple instead of using the index to access the relevant information
This commit is contained in:
parent
71655220ad
commit
508a0bb06e
1 changed files with 12 additions and 9 deletions
|
@ -25,16 +25,19 @@ def get_icons(snapshot: Snapshot) -> str:
|
||||||
exclude = ["favicon"]
|
exclude = ["favicon"]
|
||||||
# Missing specific entry for WARC
|
# Missing specific entry for WARC
|
||||||
|
|
||||||
for extractor in EXTRACTORS:
|
for extractor, _ in EXTRACTORS:
|
||||||
result = archive_results.filter(extractor=extractor[0], status="succeeded")
|
result = archive_results.filter(extractor=extractor, status="succeeded")
|
||||||
|
path, exists = link.archive_path, result.exists()
|
||||||
try:
|
try:
|
||||||
if extractor[0] not in exclude:
|
if extractor not in exclude:
|
||||||
output += output_template.format(link.archive_path, canon[f"{extractor[0]}_path"],
|
output += output_template.format(path, canon[f"{extractor}_path"],
|
||||||
result.exists(), extractor[0], icons.get(extractor[0], "?"))
|
exists, extractor, icons.get(extractor, "?"))
|
||||||
if extractor[0] == "wget":
|
if extractor == "wget":
|
||||||
extractor = "warc"
|
# warc isn't technically it's own extractor, so we have to add it after wget
|
||||||
output += output_template.format(link.archive_path, canon[f"{extractor}_path"],
|
|
||||||
result.exists(), extractor, icons.get(extractor, "?"))
|
output += output_template.format(path, canon[f"warc_path"],
|
||||||
|
exists, "warc", icons.get("warc", "?"))
|
||||||
|
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
print(e)
|
print(e)
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue