diff options
author | Tyler Schicke <tyler_schicke@brown.edu> | 2019-07-27 14:38:53 -0400 |
---|---|---|
committer | Tyler Schicke <tyler_schicke@brown.edu> | 2019-07-27 14:38:53 -0400 |
commit | c1377587f27044d89ec84befa9953de627d49873 (patch) | |
tree | 6fdc6a973fa60e7dcf29a82fe6593f4889074091 /src/scraping/buxton/scraper.py | |
parent | 18508ce86517b798e8eff2696dfe1a832837b442 (diff) |
Fixed up buxton scraper to get fullscreen images and remove bad images
Diffstat (limited to 'src/scraping/buxton/scraper.py')
-rw-r--r-- | src/scraping/buxton/scraper.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/scraping/buxton/scraper.py b/src/scraping/buxton/scraper.py index 48b8fe3fa..182b22a1a 100644 --- a/src/scraping/buxton/scraper.py +++ b/src/scraping/buxton/scraper.py @@ -1,4 +1,5 @@ import os +from shutil import copyfile import docx2txt from docx import Document from docx.opc.constants import RELATIONSHIP_TYPE as RT @@ -233,6 +234,8 @@ def parse_document(file_name: str): for image in os.listdir(dir_path): count += 1 view_guids.append(write_image(pure_name, image)) + copyfile(dir_path + "/" + image, dir_path + + "/" + image.replace(".", "_o.", 1)) os.rename(dir_path + "/" + image, dir_path + "/" + image.replace(".", "_m.", 1)) print(f"extracted {count} images...") |