I am really enjoying Kantu and have written a script to download photos from FB.
It works but the file names are annoying, so I wanted to rename the image files to the timestamp the photo was taken.
But… every time I try using onDownload
I get the error
[error] until: download start expired!
What happens is the onDownload
row runs, and it moves to the next row, where it hangs.
I have tried setting the second parameter to true
, false
and <<blank>>
, but none of them work.
This is:
- Windows 10
- Chrome 71
- Kantu 3.5.5
- Storage mode: File system (on hard drive)
Here’s the script. To use:
- Go to a photo gallery
- Open the first photo in the lightbox by clicking on it
- Start the macro running
{
"Name": "FB test with OnDownload",
"CreationDate": "2018-12-19",
"Commands": [
{
"Command": "storeAttribute",
"Target": "//*[@id='fbPhotoSnowliftTimestamp']//abbr@data-utime",
"Value": "myfilename"
},
{
"Command": "onDownload",
"Target": "${myfilename}.jpg",
"Value": "true"
},
{
"Command": "click",
"Target": "//a[@data-action-type=\"open_options_flyout\"]/span",
"Value": ""
},
{
"Command": "click",
"Target": "//div[@class='uiContextualLayerPositioner uiLayer']//a[@data-action-type='download_photo']/span/span",
"Value": ""
},
{
"Command": "click",
"Target": "//*[@id=\"photos_snowlift\"]/div[2]/div/div[1]/div[1]/div[1]/a[2]/i",
"Value": ""
},
{
"Command": "pause",
"Target": "2400",
"Value": "2400"
},
{
"Command": "echo",
"Target": "${myfilename}",
"Value": ""
}
]
}
Is there a better approach?
Ideally I want to append the timestamp to the existing file name. The alternative idea I’ve had is to log the file name and timestamp to a CSV, and then write another (offline) program to rename the photos.