Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --[[ <HCExtension>
- @name IDM limit Single Con (BETA2)
- @author reges007 (inspirasi by bdstd aka budi )
- @version 1.2
- @event RequestHeaderReceived
- </HCExtension> ]]
- function RequestHeaderReceived()
- if re.find(hc.request_header, [[^User-Agent:\sMozilla/4.0]]) then -- User Agent default download manager
- if hc.cache_file_name=='' and re.match(hc.request_header, [[^Range:\sbytes=.*\r\n]]) then -- only empty file and range byte can be process
- hc.action = 'save'
- local file = hc.get_cache_file_name(hc.url)
- local new = hc.get_cache_file_size(file..'.new')
- if new==-1 then
- hc.call_me_for('BeforeAnswerBodySend', 'hapus')
- hc.put_msg(2, 'IDM Limit Active')
- else
- hc.sleep(50)
- if new~=nil then
- hc.client_disconnect()
- hc.monitor_string = 'SKIP'
- end
- end
- end
- end
- end
- function hapus() -- Destroy everything
- if hc.last_part then
- local file = hc.get_cache_file_name(hc.url)
- hc.delete_file(file)
- -- hc.put_msg(2, file)
- end
- end
- -- versi 1.2 BETA2
- -- + Perbaikan pada metode penghapusan fake cache file dengan demikian aman untuk multi thread
Advertisement
Add Comment
Please, Sign In to add comment