Jump to content
UBot Underground

More Problems With Downloading: What's Wrong With My Code?


Recommended Posts

Hi - I wonder if anyone can see what I'm doing wrong - or missing something.

 

I am trying to upload an image file to the Exifer - an online image metadata editor - edit the exif fields and then download. I want to repeat the process with different metadata tags  without having to upload the image every time. Everything is fine until the downloading. I've tried two methods, neither work.

 

The code for the first method is below: it uploads, edits fine, then scrapes the location of the edited image and downloads - again all OK. The problem is that this is hosing up the Javascript on the webpage, which just stops working.

 

METHOD 1

set user agent("Chrome")
set(#Image,"C://DSC_0085.JPG","Global")
navigate("https://www.thexifer.net/","Wait")
wait for element(<innertext="OR CLICK AND SELECT YOUR FILES">,"","Appear")
wait(5)
focus(<innertext="OR CLICK AND SELECT YOUR FILES">)
change file field(<class="dz-default dz-message">,#Image)
wait(3)
wait for element(<class="open-SingleExifing btn btn-primary btn-xs">,"","Appear")
wait(2)
click(<class="open-SingleExifing btn btn-primary btn-xs">,"Left Click","No")
wait for element(<innertext=w"You\'re editing this picture:*">,"","Appear")
change attribute(<name="EXIFMake">,"value","Canon")
wait(1)
click(<id="submit-exifing">,"Left Click","No")
wait for element(<innertext=w"The EXIF datas of your file:*">,"","Appear")
click(<innertext="Close The Editor">,"Left Click","No")
wait for element(<id="download-me">,"","Appear")
set(#scrapeddlurl,$scrape attribute(<outerhtml=w"<a type=\"button\" class=\"download-*">,"href"),"Global")
set(#SaveFile,"C://Users/Steve/Desktop/Exifered.jpg","Global")
download file(#scrapeddlurl,#SaveFile)
wait(2)
wait for browser event("Everything Loaded","")
click(<class="open-SingleExifing btn btn-primary btn-xs">,"Left Click","No")

 

The last line shows the problem: the download works fine but the webpage stops working. I don't want to go back to the start to upload the image. Any ideas about how to avoid the download command messing things up?

 

So I tried an alternative method just using Windows commands for downloading

METHOD 2 - In this case, I can't get the Windows commands to work.

 

set user agent("Chrome")
set(#Image,"C://DSC_0085.JPG","Global")
navigate("https://www.thexifer.net/","Wait")
wait for element(<innertext="OR CLICK AND SELECT YOUR FILES">,"","Appear")
wait(5)
focus(<innertext="OR CLICK AND SELECT YOUR FILES">)
change file field(<class="dz-default dz-message">,#Image)
wait(3)
wait for element(<class="open-SingleExifing btn btn-primary btn-xs">,"","Appear")
wait(2)
click(<class="open-SingleExifing btn btn-primary btn-xs">,"Left Click","No")
wait for element(<innertext=w"You\'re editing this picture:*">,"","Appear")
change attribute(<name="EXIFMake">,"value","Canon")
wait(1)
click(<id="submit-exifing">,"Left Click","No")
wait for element(<innertext=w"The EXIF datas of your file:*">,"","Appear")
click(<innertext="Close The Editor">,"Left Click","No")
wait for element(<id="download-me">,"","Appear")
click(<id="download-me">,"Left Click","No")
plugin command("WindowsCommands.dll", "set dialog text", "Save As", "File name:", "Exifered.jpg")
plugin command("WindowsCommands.dll", "click dialog button", "Save As", "Save")
wait(2)
wait for browser event("Everything Loaded","")

 

So  - any ideas about solutions? The key point is to try to avoid starting from scratch and uploading the image again, which of course will work, but is undesirable, especially for big images.

Link to post
Share on other sites
  • 2 weeks later...

err.. i'm sorry if this isn't what u need..

 

but maybe u can try this software: http://www.highmotionsoftware.com/products/imbatch(nope i'm not an affiliate or etc..)

 

it can remove exif and do other stuffs too, and it allows bulk edit even in free version..

 

maybe it will be easier to code in ubot since it's local and doesn't have much to do with html things..

 

good luck!

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...