HandyCache форум

Главная категория => English forum => Тема начата: hc.addict от 04 Сентябрь 2017, 20:50:34



Название: Override/Update URLtoCache filename in AnswerHeaderReceived event
Отправлено: hc.addict от 04 Сентябрь 2017, 20:50:34
Hi.

Anybody knew about how to override/update the URLToCache filename in AnswerHeaderReceived event?

AnswerHeaderReceived:
Код:
if re.match(hc.answer_header, [[Content-Range: bytes (\d+-\d+)\/\d+]]) then
local cRange = re.find(hc.answer_header, [[Content-Range: bytes (\d+-\d+)\/(\d+)]], 1)
local cLen = re.find(hc.answer_header, [[Content-Range: bytes (\d+-\d+)\/(\d+)]], 2)
if cRange then
local url, ext = re.find(hc.url, [[(.*?)(\.dat)$]], 1), re.find(hc.url, [[(.*?)(\.dat)$]], 2)
local filename = hc.prepare_url(url..', range='..cRange..', clen='..cLen..ext)
filename = hc.cache_path..filename
hc.preform_cache_file_name(filename)
hc.action = 'save'
end
end



Название: Re: Override/Update URLtoCache filename in AnswerHeaderReceived event
Отправлено: mai62 от 05 Сентябрь 2017, 12:11:19
See for an example of the extension in attaching.