File naming

Post Reply
adam
Posts: 2
Joined: 13 Dec 2023, 12:39

File naming

Post by adam »

Dear Members!

Im running into a problem and i cant solve it...
I want to download product pictures from a site and name it after a product id. The pictures url-s is not contain any info about the prod id. The parent page contains but its not linked as ID=something.
Here is a link from one product:
https://zomko.hu/keziszerszamok/dugokul ... zlet-4634m

The 040103-0718 is what i need for file name. If its more and contains the name of the product is not a problem.

Pls somebody help me :)
Maksym
Site Admin
Posts: 2097
Joined: 02 Mar 2009, 17:02

Re: File naming

Post by Maksym »

There is actually a product ID in that URL. It follows the last "/" character, so you can set up your naming like this:

Image

Regular Expression: zomko\.hu/[^/]+/[^/]+/[^/]+/(\d+-\d+)-
Result: [#1]

A more generic version, which allows any number of folders before the product page name is:

Regular Expression: zomko\.hu/([^/]+/)+(\d+-\d+)-
Result: [#2]
Post Reply