diff --git a/resonite-photoexif b/resonite-photoexif index 43b709e..8af0aa3 100755 --- a/resonite-photoexif +++ b/resonite-photoexif @@ -28,18 +28,17 @@ for resrec; do curl -s "$asseturi" | tail -c +10 | brotli -d | bson2json > "$tmp_json" while read -r argline; do - echo "$argline" eval "set -- $argline" outfile="$outdir/$timestamp.webp" imguri=$1 echo "downloading image $timestamp.webp" - curl -s -o "$tmpfile" "$imguri" + aria2c -q -d / --allow-overwrite=true --auto-file-renaming=false -o "$tmpfile" "$imguri" if [ $# -gt 1 ]; then meta_place=$2 meta_host=$3 meta_photographer=$4 meta_time=$(date -u -d "@$5" +'%Y:%m:%d %H:%M:%S') - shift 4 + shift 5 meta_presentusers=$(sed 's/ /, /g' <<-EOF $* EOF @@ -79,7 +78,14 @@ Present Users: $meta_presentusers" "$tmpfile" \ select(.Type=="FrooxEngine.PhotoMetadata").Data.TimeTaken.Data/1000, select(.Type=="FrooxEngine.PhotoMetadata").Data.UserInfos.Data[].User._userId.Data ] - | select(. != []) | @sh' < "$tmp_json") + | select(. != []) | @sh' < "$tmp_json" \ + || jq -r '.Object.Children | .. | objects | .Components.Data | select(. != null) + | [ .[] + | ( select(.Type=="FrooxEngine.StaticTexture2D").Data.URL.Data + | sub("@(resdb:///(?[^.]+))?.*";"https://assets.resonite.com/\(.x)") + ) + ] + | select(. != []) | @sh' < "$tmp_json") EOF done