Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #auto direct link
- #file: autodl.rb
- #support mp4upload.com, uppit.com, clicknupload.org, racaty.com
- #author: agunq
- #chatango: agunq.chatango.com
- #email: idk lol :v
- #last test: April 21, 2019
- require 'net/http'
- require 'net/https'
- require 'json'
- require 'uri'
- class AutoDl
- def getDirect(url)
- uri = URI(url)
- value = {
- "op" =>"download2",
- "id" => uri.path.split("/")[1],
- "rand" => "",
- "referer" => "",
- "method_free" => "",
- "method_premium" => ""
- }
- req = Net::HTTP::Post.new(uri)
- req.set_form_data(value)
- http = Net::HTTP.new(uri.host, uri.port)
- if uri.scheme == "https"
- http.use_ssl = true
- http.verify_mode = OpenSSL::SSL::VERIFY_NONE
- end
- response = http.request(req)
- if uri.host == "uppit.com"
- link = response.body.match(/<meta HTTP-EQUIV=\"REFRESH\" content=\"3; url=(.*?)\">/)
- if link
- link = link.captures[0]
- end
- elsif uri.host == "clicknupload.org"
- link = response.body.match(/<button id=\"downloadbtn\" class=\"downloadbtn\" href=\"javascript:void\(0\);\" onClick=\"window.open\(\'(.*?)\'\);\"><span><i class=\"fas fa-external-link-alt\"><\/i> Click to Start Download<\/span><\/button>/)
- if link
- link = link.captures[0]
- end
- else
- link = response.to_hash
- if link.keys.include?("location")
- link = link["location"]
- else
- link = ""
- end
- end
- return link
- end
- end
- #puts AutoDl.new.getDirect('https://clicknupload.org/5rro880uhnyg')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement