Post Reply 
Change image filename that only contains numbers to a unique name
Nov. 08, 2009, 07:12 PM
Post: #1
Change image filename that only contains numbers to a unique name
This filter will change the name of an image file that only has numbers in its name into a unique name.
This way if your downloading from multiple galleries to the same directory that all name their files like 10.jpg, 06.jpg it will be changed to something that wont be the same of whats already there.
The url in the url bar wont change but if you Save Image the name will be different.

[HTTP headers]
In = TRUE
Out = FALSE
Key = "Content-Disposition: Change images that have numbers only for filename to a unique name for saving (in)"
URL = "*/[0-9]+.(jpg|jpeg|png|gif)"
Replace = "inline; filename="$DTM(YMDHmst)";"

...Now for the truth :P ...this seems to work for me with my very limited testing but I cant do regex stuff and kinda guessed that match expression...so if any one could validate it for me or show me a better way of doing this it would be much appreciated.
Add Thank You Quote this message in a reply
Nov. 08, 2009, 10:25 PM
Post: #2
RE: Change image filename that only contains numbers to a unique name
cool! neat idea...
Add Thank You Quote this message in a reply
Nov. 08, 2009, 11:24 PM (This post was last modified: Nov. 08, 2009 11:25 PM by Kye-U.)
Post: #3
RE: Change image filename that only contains numbers to a unique name
Tested it here and it works fine. I tried it at http://4chan.org/ (beware, some sections are NSFW and explicit).

As for improving the matching expression, I can't really suggest anything since I've had limited experience working with header filters (I've worked more with web filters), but it looks fine to me.
Visit this user's website
Add Thank You Quote this message in a reply
Post Reply 


Forum Jump: