kopia lustrzana https://github.com/bellingcat/auto-archiver
minimal changes: standard naming
rodzic
14c8af5cc8
commit
8a897cf601
|
@ -204,7 +204,7 @@ class WaczExtractorEnricher(Enricher, Extractor):
|
||||||
if (
|
if (
|
||||||
record.rec_type == "resource" and record.content_type == "image/png" and self.extract_screenshot
|
record.rec_type == "resource" and record.content_type == "image/png" and self.extract_screenshot
|
||||||
): # screenshots
|
): # screenshots
|
||||||
fn = os.path.join(tmp_dir, f"warc-file-{counter_screenshots}.png")
|
fn = os.path.join(tmp_dir, f"browsertrix-screenshot-{counter_screenshots}.png")
|
||||||
with open(fn, "wb") as outf:
|
with open(fn, "wb") as outf:
|
||||||
outf.write(record.raw_stream.read())
|
outf.write(record.raw_stream.read())
|
||||||
m = Media(filename=fn)
|
m = Media(filename=fn)
|
||||||
|
@ -232,9 +232,7 @@ class WaczExtractorEnricher(Enricher, Extractor):
|
||||||
|
|
||||||
# create local file and add media
|
# create local file and add media
|
||||||
ext = mimetypes.guess_extension(content_type)
|
ext = mimetypes.guess_extension(content_type)
|
||||||
|
|
||||||
warc_fn = f"warc-file-{counter_warc_files}{ext}"
|
warc_fn = f"warc-file-{counter_warc_files}{ext}"
|
||||||
|
|
||||||
fn = os.path.join(tmp_dir, warc_fn)
|
fn = os.path.join(tmp_dir, warc_fn)
|
||||||
|
|
||||||
record_url_best_qual = UrlUtil.twitter_best_quality_url(record_url)
|
record_url_best_qual = UrlUtil.twitter_best_quality_url(record_url)
|
||||||
|
|
Ładowanie…
Reference in New Issue