\/([a-zA-Z0-9\.\-\_]{1,30}\.[a-zA-Z0-9]+)$
In [1]: from urllib.parse import urlparse
In [2]: o = urlparse('https://site.ru/images/favicon.ico?foo=bar')
In [3]: o
Out[3]: ParseResult(scheme='https', netloc='site.ru', path='/images/favicon.ico', params='', query='foo=bar', fragment='')
In [4]: o.path.split('/')[-1]
Out[4]: 'favicon.ico'