steamcommunity\.com/trade/\d++#~#(?-x)(<h2>Предложение [^:]++:</h2>)(.*?)UserThem\.SetProfileURL\( "http:\\/\\/steamcommunity\.com\\/profiles\\(/\d++)" \);#~#<a href="http://steamcommunity.com/profiles\3">\1</a>\2http://steamcommunity.com/profiles\3
steamcommunity\.com/trade/\d++#~#(?-x)(<h2>Предложение [^:]++:</h2>)(?=.*?UserThem\.SetProfileURL\( "http:\\/\\/steamcommunity\.com\\/profiles\\(/\d++)" \);)#~#<a href="http://steamcommunity.com/profiles\2">\1</a>
steamcommunity\.com/trade/\d++#~#(?-x)(<h2>[^:]++:</h2>)(?=.*?UserThem\.SetProfileURL\( "http:\\/\\/steamcommunity\.com\\/profiles\\(/\d++)" \);)#~#<a href="http://steamcommunity.com/profiles\2">\1</a>
URL: http://google.com/downloads?client=navclient-auto-ffoxHTTP/1.1 302 FoundLocation: https://deneg.day.ru/overload/?h=google.com&u=/downloads&p=client=navclient-auto-ffoxContent-Type: text/html; charset=utf-8Content-Length: 380Connection: keep-alive
--[[ <HCExtension>@name antiprovider@author mai62@version 0.1@description Correct answer from bad provider@event AnswerHeaderReceived/Answer</HCExtension> ]]function GetAnswerCode() _,_,x = string.find(hc.answer_header, 'HTTP/1%.%d +(%d+)') if x==nil then return -1 else return tonumber(x) endendfunction Answer() answ_code = GetAnswerCode() if answ_code == 302 and re.find(hc.answer_header, [[deneg\.day\.ru]]) then hc.put_to_log('Correction') hc.answer_header= 'HTTP/1.1 302\r\n'.. 'Server: HandyCache\r\n'.. 'Location: '..hc.url..'\r\n'.. 'Connection: close\r\n\r\n' endend
--[[ <HCExtension>@name Автопереключение на резевный прокси (#2)@author Anymore@version 0.0.001@description http://handycache.ru/forum/index.php?topic=1120.msg35365#msg35365@event Init/init@event Timer1m/timer@event BeforeAnswerHeaderSend/Event@event RequestHeaderReceived/Request</HCExtension> ]]function init() hc_static['count']=0 hc.set_global('sw2reserve', '') hc_static['CheckURL']='http://www.google.de/'endfunction GetAnswerCode() _,_,x = string.find(hc.answer_header, 'HTTP/1%.%d +(%d+)') if x==nil then return -1 else return tonumber(x) endendfunction Request() if hc.url==hc_static['CheckURL'] then hc.monitor_string = '#?' else if hc_static['count']>1 or hc.get_global('sw2reserve')=='sw' then hc.monitor_string = '#2 '..hc.monitor_string hc.use_proxy="127.0.0.1:80" --Внешинй прокси hc.use_proxy_login="user:password" end endendfunction timer() if not hc.offline_on and hc_static['count']>0 then hc_static['count']=hc_static['count']-1 end if hc.get_global('sw2reserve')=='sw' then hc.put_msg(10, 'Резервный прокси') hc.set_global('sw2reserve', '') hc_static['count']=3 end if hc_static['count']==2 then hc.execute_cmd('LoadURL '..hc_static['CheckURL']) end if hc_static['count']==1 then hc.put_msg(10, 'взврат на основной канал') endendfunction Event() answ_code = GetAnswerCode() if answ_code == 502 or answ_code == 504 then hc.set_global('sw2reserve', 'sw') hc.action='dont_save' if hc.url==hc_static['CheckURL'] then else hc.answer_header= 'HTTP/1.1 302\r\n'.. 'Server: HandyCache\r\n'.. 'Location: '..hc.url..'\r\n'.. 'Connection: close\r\n\r\n' end endend