diff --git a/util/parse.sh b/util/parse.sh index 8e3799d..455d40b 100644 --- a/util/parse.sh +++ b/util/parse.sh @@ -1,5 +1,4 @@ #!/bin/bash - echo '' echo '-------------------------------------' echo 'Parsing data ......' @@ -30,39 +29,12 @@ do XML_FILE="./tmp/checker/${i}.xml" RESULT_FILE="./tmp/parse/${i}-result.info" - # # Extract version - look between - # VERSION=$(extract_value "$XML_FILE" "" "version") - - # # Extract URLs - look between - # URL1=$(sed -n '//p' "$XML_FILE" | \ - # sed -n '/edgedl\.me\.gvt1\.com/ { - # s/.*codebase="https:\/\/edgedl\.me\.gvt1\.com\/// - # s/".*// - # p - # }' | head -1) - - # URL2=$(sed -n '//p' "$XML_FILE" | \ - # sed -n '/dl\.google\.com/ { - # s/.*codebase="https:\/\/dl\.google\.com\/// - # s/".*// - # p - # }' | head -1) - - # # Extract installer - look between - # INSTALLER=$(extract_value "$XML_FILE" "" "run") - - # # Extract SHA256 - look between - # SHA256=$(extract_value "$XML_FILE" "" "hash_sha256") - - # # Extract size - look between - # SIZE=$(extract_value "$XML_FILE" "" "size") - # Extract version - simpler pattern VERSION=$(sed -n 's/.*manifest version="\([^"]*\)".*/\1/p' "$XML_FILE") - # Extract URLs - simpler patterns - URL1=$(sed -n 's/.*codebase="https:\/\/edgedl\.me\.gvt1\.com\/\([^"]*\)".*/\1/p' "$XML_FILE" | head -1) - URL2=$(sed -n 's/.*codebase="https:\/\/dl\.google\.com\/\([^"]*\)".*/\1/p' "$XML_FILE" | head -1) + # Extract URLs - with complete base URLs + URL1=$(sed -n 's/.*codebase="\(https:\/\/edgedl\.me\.gvt1\.com\/[^"]*\)".*/\1/p' "$XML_FILE" | head -1) + URL2=$(sed -n 's/.*codebase="\(https:\/\/dl\.google\.com\/[^"]*\)".*/\1/p' "$XML_FILE" | head -1) # Extract installer name - simpler pattern INSTALLER=$(sed -n 's/.*run="\([^"]*\)".*/\1/p' "$XML_FILE" | head -1)