Advertisement
reges007

blok autoplay video facebook

Aug 3rd, 2016
1,103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.10 KB | None | 0 0
  1. --[[ <HCExtension>
  2. @name blok preload dan autoplay video facebook
  3. @author reges007
  4. @version 1
  5. @description memblokir preload dan autoplay video untuk facebook
  6. @rule ^.*fbcdn.net.*?.mp4
  7. @event AnswerHeaderReceived/Answer
  8. </HCExtension> ]]
  9.  
  10. function GetAnswerCode(s)
  11. _,_,x = string.find(s, 'HTTP/1%.%d +(%d+)')
  12. if x==nil then return -1 else return tonumber(x) end
  13. end
  14.  
  15.  
  16. function Answer()
  17. answ_code = GetAnswerCode(hc.answer_header)
  18. local ck = re.match(hc.answer_header, [[^Content-Range:\sbytes\s0\-]])
  19.  
  20. local clen = re.find(hc.answer_header, [[^Content-Length:\s\d+]])
  21. local clen = re.replace(clen, [[Content-Length:\s]], '', true)
  22.  
  23. local ck1 = re.find(hc.answer_header, [[^Content-Range:\sbytes\s0\-\d+/\d+]])
  24. local crng = re.replace(ck1, [[Content-Range:\sbytes\s0\-\d+/]], '', true)
  25.  
  26.  
  27. if answ_code==206 and ck then
  28. if clen==crng then
  29.  
  30. hc.action = 'stop'
  31. hc.monitor_string = 'preload off'
  32. end
  33. end
  34. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement