Recommended Posts

shEiD 0

shEiD 0

If I use InetGet I need to define a filename, but I want to define ONLY the directory where to put the files, as I want them to keep the "source" names. How do I do that? I tried defining only directory - doesn't work

Share this post

Link to post

Share on other sites

Tvern 5

Tvern 5

As far as I know there is no build in functionality, but to use Inetget you have to know the filename. You can look for the last "/" in the url and whatever is to the right of that is the filename.

Something like this:

$url="http://www.test.com/folder/subfolder/filename.jpg";source$folder="C:\somefolder\";destination folderInetGet($url,$folder&StringTrimLeft($url,StringInStr($url,"/",Default,-1)));stringinstr finds the last "/". Stringtrimleft trims all but the filename.

Yes, I know, there are "titles" that I could use as a file name, but I can't do that. The main reason I'm writing this script is that I need to download the files with their source names (scene names), and the way to do this is using the api. I can't use the names in the feed and then manipulate/replace/whatever strings, as some files have group names, some don't and there is no reliable way to sort this out and it is pointless, as API provides a switch "&scenename=1" which I add to the end of url and I get a file in it's proper scene name format.

The problem is how do I use InetGet() without knowing filename before hand? Is there another way? Pardon my ignorance in general programming, but any web browser or any rss addon in torrent clients or in my case AltBinz rss handler can download files somehow and save them with their "source" name. That is what I want to do: simply set the download folder and save files with their "source" names in it.

Share this post

Link to post

Share on other sites

shEiD 0

shEiD 0

Would like to ask again, could anyone, please, at least tell me the direction in which I should look for a solution to this?

I have no programming knowledge accept some autoit scripting. I tried googling for hours and hours and it gave me nothing, coz I pretty much have no idea what I'm looking for. All I understand is, that it's obviously possible to get the file info from the server, as browsers always get source file name and location, when they ask you where you want to save the downloaded file. But how do they communicate this information and how to do it in AutoIt or maybe using some other tool, I have no idea.