Enigma 78 Posted February 2, 2011 Report Share Posted February 2, 2011 Having issues with downloading a file.Scraping part of a url, then Set the other part of the url to make the url complete.So i have a direct download link to a file (in this case a .jpg). http://img214.imageshack.us/img214/5107/downloadfilebot.png Is there a tutorial where to see how the "download file" works?If i remind it well there was no tutorial about that (i might be wrong though, please let me know).Did i forgot to add something? The #savetofile #imagelink was just for test purposes to see whether i get the full url to the file and that works.So #imagelink contains the correct full link to the file. Quote Link to post Share on other sites
UBotBuddy 331 Posted February 2, 2011 Report Share Posted February 2, 2011 Not knowing what you are seeing is kind of hard so let me ask a question. Are you downloading an image that you see on the website? If so then why not do this; http://screencast.com/t/5p1RtokT If you are downloading a File then ignore my post here as others may have a solution for you. Quote Link to post Share on other sites
Enigma 78 Posted February 2, 2011 Author Report Share Posted February 2, 2011 Not knowing what you are seeing is kind of hard so let me ask a question. Are you downloading an image that you see on the website? If so then why not do this; http://screencast.com/t/5p1RtokT If you are downloading a File then ignore my post here as others may have a solution for you. I'm downloading a file (.jpg in this case).$save choosen image makes a screenshot and not saving the original .jpg file. http://ubotstudio.com/forum/index.php?/topic/6103-really-download-images-instead-of-taking-a-screenshot Thanks for your time though Quote Link to post Share on other sites
UBotBuddy 331 Posted February 2, 2011 Report Share Posted February 2, 2011 Nooooooo "Save Chosen Image" saves the image of the object. Trust me on this. I sold a few bots that saves the Google Maps image to a special folder. Not only the small image that Google produces but the large map too. So screenshot? Noooooo. It don't do that. Quote Link to post Share on other sites
Enigma 78 Posted February 2, 2011 Author Report Share Posted February 2, 2011 Nooooooo "Save Chosen Image" saves the image of the object. Trust me on this. I sold a few bots that saves the Google Maps image to a special folder. Not only the small image that Google produces but the large map too. So screenshot? Noooooo. It don't do that. Well it does not save the actual file.It DOES make screenshots, as it leave parts of the website on the saved images borders.I got that to work but that's really not what i want. Quote Link to post Share on other sites
Enigma 78 Posted February 2, 2011 Author Report Share Posted February 2, 2011 This is what happen when using $save choosen image http://img684.imageshack.us/img684/379/kqzfjwxlfoilnay2.png See the borders, it's having parts of the website on it.Absolutely not what i want.So it's a screenshot. I want to $download file the actual file (whether it's a .jpg in this case or any other extension in the future). Quote Link to post Share on other sites
UBotBuddy 331 Posted February 2, 2011 Report Share Posted February 2, 2011 You know...I guess I do remember that now that you mention it from waaaaaaay back. I have never tried what you are attempting. I think I will give that a shot and see what happens for me. I'll let you know. Quote Link to post Share on other sites
Enigma 78 Posted February 2, 2011 Author Report Share Posted February 2, 2011 Alright BotBuddy. In the meanwhile, if someone can point me how to get the $download file to work that would be very kind Quote Link to post Share on other sites
UBotBuddy 331 Posted February 2, 2011 Report Share Posted February 2, 2011 Enigma, Here is what I did. http://screencast.com/t/qgs5QztXba After looking at your original post I think I see the problem. You were specifying the folders where you wanted to save the image but you did not have a filename. Quote Link to post Share on other sites
Enigma 78 Posted February 2, 2011 Author Report Share Posted February 2, 2011 Enigma, Here is what I did. http://screencast.com/t/qgs5QztXba After looking at your original post I think I see the problem. You were specifying the folders where you wanted to save the image but you did not have a filename. That makes sense.LOL. Well i assumed it keeps the original filename.So when a file is called blabla.jpg or blabla.exe then i assume it's been saved to the path i enter but keeps the original filename. Isn't that possible, to just keep the original filename? Quote Link to post Share on other sites
UBotBuddy 331 Posted February 2, 2011 Report Share Posted February 2, 2011 That would be a development question. For me I guess it is a toss up. Quote Link to post Share on other sites
Enigma 78 Posted February 2, 2011 Author Report Share Posted February 2, 2011 That would be a development question. For me I guess it is a toss up. Was thinking of scraping the url but the directories (i.e. domain.com/439/283/9932/imagefile.jpg) are random.So you can't say scrape url and remove "domain.com/439/283/9932" to keep imagefile.jpg as name because the directories are always different. Quote Link to post Share on other sites
Enigma 78 Posted February 2, 2011 Author Report Share Posted February 2, 2011 That would be a development question. For me I guess it is a toss up. Thanks for your time anyway.Hope someone else has a solution: Save the file with original filename. Quote Link to post Share on other sites
UBotBuddy 331 Posted February 2, 2011 Report Share Posted February 2, 2011 Well you can scrape that whole url and then strip out the filename. It would take some thought but it can be done. Quote Link to post Share on other sites
Enigma 78 Posted February 2, 2011 Author Report Share Posted February 2, 2011 Enigma, Here is what I did. http://screencast.com/t/qgs5QztXba After looking at your original post I think I see the problem. You were specifying the folders where you wanted to save the image but you did not have a filename. The following code would result: C:\Users\User\Pictures\Download\day-month-year-time-minute-second\randomstring20characters.jpg http://img651.imageshack.us/img651/6364/sameerror.png As you see, it results in error again. Quote Link to post Share on other sites
UBotBuddy 331 Posted February 3, 2011 Report Share Posted February 3, 2011 One step at a time. Just do the Folder with the randomized filename. Don't do the "random list item" yet. Build up to that node. Quote Link to post Share on other sites
Enigma 78 Posted February 3, 2011 Author Report Share Posted February 3, 2011 One step at a time. Just do the Folder with the randomized filename. Don't do the "random list item" yet. Build up to that node. Random list item is just set otherwise getting an error.I clean $foldername at the begin of every loop, so there will only be 1 item in that list.But before that i already did a $next list item, so if i do $next list item again it gives me an error.There is nothing to randomize if there is only 1 item in the list.It keeps using that item. Anyway as said and shown in my last post, issue still not solved.Isn't there anyone that never downloaded a file with uBot who can finally explain how it works? Quote Link to post Share on other sites
UBotBuddy 331 Posted February 3, 2011 Report Share Posted February 3, 2011 WHAT! I showed you how to use it. Dude. My feelings are hurt. I've got to take a break now. My eyes are watering. (sniff...sniff...sniff...) I'll be back............................ Quote Link to post Share on other sites
Enigma 78 Posted February 3, 2011 Author Report Share Posted February 3, 2011 WHAT! I showed you how to use it. Dude. My feelings are hurt. I've got to take a break now. My eyes are watering. (sniff...sniff...sniff...) I'll be back............................ Well you see the error that comes up.I have nothing changed on the script, only how to save it. So it saves the file as fjn43r3rbsdfejf834.jpgBut it does not work.I would rather save it as the original filename, but it's no problem for me to rename it while save it.Both are ok but both don't work. Quote Link to post Share on other sites
Enigma 78 Posted February 3, 2011 Author Report Share Posted February 3, 2011 Quote Link to post Share on other sites
UBotBuddy 331 Posted February 3, 2011 Report Share Posted February 3, 2011 Enigma! The download node is working perfectly. I have already shown that. Give me a few minutes and I will duplicate what you are doing. Quote Link to post Share on other sites
Enigma 78 Posted February 3, 2011 Author Report Share Posted February 3, 2011 Enigma! The download node is working perfectly. I have already shown that. Give me a few minutes and I will duplicate what you are doing. Well at least it gives an error on my end Quote Link to post Share on other sites
UBotBuddy 331 Posted February 3, 2011 Report Share Posted February 3, 2011 Dude you owe me big time. Just save the contents of the Zip to a folder. Look at my text file and you will see four folders that I tested with. You should rename those to fit your system. Some of the code can probably be reduced but it works including stripping out the original file name of the image.4Enigma.zip Quote Link to post Share on other sites
Enigma 78 Posted February 3, 2011 Author Report Share Posted February 3, 2011 Dude you owe me big time. Just save the contents of the Zip to a folder. Look at my text file and you will see four folders that I tested with. You should rename those to fit your system. Some of the code can probably be reduced but it works including stripping out the original file name of the image. Thanks for your time.Will take a look at it and let you know Quote Link to post Share on other sites
Josh 37 Posted March 12, 2012 Report Share Posted March 12, 2012 I'm having this same issue. Our clients upload a bunch of photos to their account for us to use in their campaigns. Our system then spits out a spreadsheet with various data some of which includes urls to random images that the client uploaded. My issue is more with downloading different image types (jpg, jpeg, gif, png) When I save them I need to keep the name of the file and at the very least the file type. Anyone have any ideas? Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.