Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --[[ <HCExtension>
- @name blok preload dan autoplay video facebook
- @author reges007
- @version 1
- @description memblokir preload dan autoplay video untuk facebook
- @rule ^.*fbcdn.net.*?.mp4
- @event AnswerHeaderReceived/Answer
- </HCExtension> ]]
- function GetAnswerCode(s)
- _,_,x = string.find(s, 'HTTP/1%.%d +(%d+)')
- if x==nil then return -1 else return tonumber(x) end
- end
- function Answer()
- answ_code = GetAnswerCode(hc.answer_header)
- local ck = re.match(hc.answer_header, [[^Content-Range:\sbytes\s0\-]])
- local clen = re.find(hc.answer_header, [[^Content-Length:\s\d+]])
- local clen = re.replace(clen, [[Content-Length:\s]], '', true)
- local ck1 = re.find(hc.answer_header, [[^Content-Range:\sbytes\s0\-\d+/\d+]])
- local crng = re.replace(ck1, [[Content-Range:\sbytes\s0\-\d+/]], '', true)
- if answ_code==206 and ck then
- if clen==crng then
- hc.action = 'stop'
- hc.monitor_string = 'preload off'
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement