Commit 67b19716 authored by dmknght's avatar dmknght

add strip url to download

parent 69c84a0e
Pipeline #1453 failed with stages
......@@ -102,11 +102,21 @@ proc downloadFiles(folder: string, agent: string) =
# Error: read
let resp = waitFor(client.get(eachResult.realURL))
if resp.status != "200 OK":
continue
echo "[+] Downloading \e[33m" & eachResult.realURL & "\e[0m"
waitFor(client.downloadFile(eachResult.realURL, finalPath))
echo "[*] Saved at \e[96m" & finalPath & "\e[0m"
downloaded += 1
if "&" in eachResult.realURL:
let
reTryURL = eachResult.realURL.split("&")[0]
reTryResp = waitFor(client.get(reTryURL))
if reTryResp.status != "200 OK":
continue
echo "[+] Downloading \e[33m" & reTryURL & "\e[0m"
waitFor(client.downloadFile(reTryURL, finalPath))
echo "[*] Saved at \e[96m" & finalPath & "\e[0m"
downloaded += 1
else:
echo "[+] Downloading \e[33m" & eachResult.realURL & "\e[0m"
waitFor(client.downloadFile(eachResult.realURL, finalPath))
echo "[*] Saved at \e[96m" & finalPath & "\e[0m"
downloaded += 1
except:
discard
# stderr.write("[x] Error " & getCurrentExceptionMsg() & " \e[31m" & eachResult.realURL & "\e[0m\n")
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment