function GDL(origUrl) -- GetDirectLink local logpref = script.name .. '_GDL_v12' usd.setstatus(script.name) local dirUrl if origUrl:find('^http://dl.old%-games.ru/') then origUrl = 'http://letitbit.net/download.php?uid=link&name=link&page=7&link=' .. origUrl if not origUrl:find('&pin=',1,true) then origUrl = origUrl .. '&pin=1643776' end end local page, badpage = tryDl(origUrl, nil, nil, '') debugSaveInc(logpref..'.html', page or badpage) if badpage then return usd.setretresult('%Bad page?') end if page:find('url(/images/mailru_rebrand/bg_body_not_found.jpg)',1,true) or page:find('404',1,true) or usd.getcookie():find('file_info_uid5=deleted',1,true) or usd.getheaders():find('404 Not Found',1,true) then usd.setretresult('%notfound%') return end local form = page:match('
]-ifree_form".-
') if not form then return usd.setretresult('%No free download?') end local mirrors = {} for i=1, 10 do local timeout = page:match('}%s+timeout = (%d+);') or page:match('%sseconds = (%d+);') or page:match('function StartGlide.-%sy = (%d+);') timeout = tonumber(timeout or 0) if timeout >= 1000 then timeout = timeout/1000 end usd.waittime( timeout + math.random(3)) local sf = page:match(']-ifree_form".-') or page:match('
]-/download%d+.php".-
') or page:match('
]-id="dvifree".-
') or page:match(']-id="d3_form".-') form = Form.parse(form) --page = form:submit() if form.action=='http://shareflare.net/download3.php' then page, badpage = trySubmit(form, nil, nil, '') else page, badpage = trySubmit(form, nil, nil, '') end debugSaveInc(logpref..'.html', page or badpage) if badpage then return usd.setretresult('%Bad page?') end end local mintime = math.huge for _, u in ipairs(mirrors) do local server = u:match('^(http://[^/]+/)') local tstart = os.clock() usd.get( server ) local resptime = os.clock() - tstart debugLog('Time: '..resptime) mintime = math.min(mintime, resptime) if mintime == resptime then dirUrl = u end end if dirUrl then usd.setretresult(dirUrl,1,1) return end return usd.setretresult('%plugindefect') end regDirSuccess('//letitbit.net/download/', GDL) -- MD5: -- Cookie: file_info_index= --