mirror of
https://gitea.phreedom.club/localhost_frssoft/funkwlmpv
synced 2024-11-22 15:59:21 +02:00
Retry get track to cache and mark reused cache files
This commit is contained in:
parent
71ad1daf2b
commit
74b5f59684
|
@ -32,10 +32,11 @@ function make_cache_track(url)
|
||||||
if false == file_exists(cache_path_file) then
|
if false == file_exists(cache_path_file) then
|
||||||
createDir('cache/' .. host .. '/')
|
createDir('cache/' .. host .. '/')
|
||||||
msg.verbose('Caching ' .. cache_path_file .. '')
|
msg.verbose('Caching ' .. cache_path_file .. '')
|
||||||
os.execute('curl -s "' .. url .. '" -o "' .. cache_path_file .. '"')
|
os.execute('curl -s --retry 3 "' .. url .. '" -o "' .. cache_path_file .. '"')
|
||||||
mp.set_property("stream-open-filename", cache_path_file)
|
mp.set_property("stream-open-filename", cache_path_file)
|
||||||
else
|
else
|
||||||
msg.verbose('Already cached ' .. cache_path_file .. '')
|
msg.verbose('Already cached ' .. cache_path_file .. '')
|
||||||
|
os.execute('touch ' .. cache_path_file .. '')
|
||||||
mp.set_property("stream-open-filename", cache_path_file)
|
mp.set_property("stream-open-filename", cache_path_file)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue