Hello, guys! I’m trying to loop a photo download. I was able to loop the parsing of files, but I can’t save them so that each file has its own name. When saving, the same name is simply overwritten.
BLOCK:HttpRequest
url = "https://url.com"
method = POST
customHeaders = {("Action", "GetFiles"), ("x-requested-with", "XMLHttpRequest")}
TYPE:STANDARD
$"FileID=1%2F50&NextMarker=&flag=1&isRootImage=true&isFilesImages=true&InternalExternalMarker=true&selectedDevice=<deviceid>&selectedDeviceFlag=<deviceflag>"
"application/x-www-form-urlencoded"
ENDBLOCK
BLOCK:Parse
LABEL:FileName
input = @data.SOURCE
leftDelim = "\"FileName\":\""
rightDelim = "\""
RECURSIVE
MODE:LR
=> VAR @FileNames
ENDBLOCK
FOREACH FileName IN FileNames
// Query the single URL
BLOCK:Parse
LABEL:key
input = @data.RAWSOURCE
leftDelim = "ImageNew?Key="
rightDelim = "\\"
RECURSIVE
MODE:LR
=> VAR @keys
ENDBLOCK
FOREACH key IN keys
// Query the single URL
BLOCK:HttpRequest
LABEL:url
url = $"https://url.com/ImageNew?Key=<key>&Type=s&UserID=<UserID>&selectedDevice=<deviceid>"
customHeaders = {}
TYPE:STANDARD
$""
"application/x-www-form-urlencoded"
ENDBLOCK
BLOCK:FileWriteBytes
path = $"D:\\x\\OpenBullet\\ob2\\url.com\\<input.USER>_<input.PASS>\\<FileName>.png"
content = @data.RAWSOURCE
ENDBLOCK
END
END