From 5c692fb11ac82b72b9b157a679ad4835543973ba Mon Sep 17 00:00:00 2001 From: Pieter Vander Vennet Date: Thu, 2 Nov 2023 17:55:01 +0100 Subject: [PATCH] Scripts: configurable path to download all imgur images --- scripts/generateImageAnalysis.ts | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/scripts/generateImageAnalysis.ts b/scripts/generateImageAnalysis.ts index b5b36f6bf..13478819e 100644 --- a/scripts/generateImageAnalysis.ts +++ b/scripts/generateImageAnalysis.ts @@ -15,7 +15,13 @@ import Constants from "../src/Models/Constants" export default class GenerateImageAnalysis extends Script { constructor() { super( - "Downloads (from overpass) all tags which have an imgur-image; then analyses the licenses" + [ + "Downloads (from overpass) all tags which have an imgur-image; then analyses the licenses and downloads all the images", + "", + "Arguments:", + "Path to download the images to", + "Path to save the overview to", + ].join("\n") ) } @@ -380,11 +386,12 @@ export default class GenerateImageAnalysis extends Script { console.log("Args are", args) const cached = args.indexOf("--cached") < 0 args = args.filter((a) => a !== "--cached") - const datapath = args[0] ?? "../../git/MapComplete-data/ImageLicenseInfo" + const datapath = args[1] ?? "../../git/MapComplete-data/ImageLicenseInfo" + const imageBackupPath = args[0] await this.downloadData(datapath, cached) await this.downloadMetadata(datapath) - await this.downloadAllImages(datapath, "/home/pietervdvn/data/imgur-image-backup") + await this.downloadAllImages(datapath, imageBackupPath) this.analyze(datapath) } }