Advertisement
reges007

user agent replace

Feb 23rd, 2015
1,208
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.73 KB | None | 0 0
  1. --[[ <HCExtension>
  2. @name          Google/Youtube mode http/unsecure
  3. @author        reges007
  4. @version       1
  5. @description   manipulasi user agent browser untuk youtube dan google, harap dihapus extensi user agent lainnya jika memakai yang ini
  6. @exception     ^https
  7. @rule          youtube.com|www\.google\.
  8. @rule          whatsmyuseragent.com
  9. @event         RequestHeaderReceived/Request
  10. </HCExtension> ]]
  11.  
  12.  
  13. function Request()
  14.  
  15.          if re.find(hc.request_header, [[^User-Agent:.*\(Windows]]) then
  16.             hc.request_header = re.replace(hc.request_header, [[^User-Agent: \K[^\r\n]+]], 'Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)')
  17.             hc.monitor_string = 'windows'
  18.          end
  19.  
  20. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement