Skip to content

Instantly share code, notes, and snippets.

@floshodan
Created June 28, 2022 13:31
Show Gist options
  • Save floshodan/7b65e2fe4e0afdafd4fbaba8d4ed862a to your computer and use it in GitHub Desktop.
Save floshodan/7b65e2fe4e0afdafd4fbaba8d4ed862a to your computer and use it in GitHub Desktop.
Openload direct link
from browsermobproxy import Server
import psutil
import time
import json
for proc in psutil.process_iter():
# check whether the process name matches
if proc.name() == "browsermob-proxy":
proc.kill()
dict = {'port': 8090}
server = Server(path="/bin/browsermob-proxy", options=dict) #ajust browsermob path
server.start()
time.sleep(1)
proxy = server.create_proxy()
time.sleep(1)
url = input('Enter a valid openload URL:')
from selenium import webdriver
chrome_options = webdriver.ChromeOptions()
chrome_options.add_argument("--proxy-server={0}".format(proxy.proxy))
chrome_options.add_argument("--start-maximized")
chrome_options.add_argument("--disable-gpu")
chrome_options.add_argument("--headless")
chrome_options.add_argument('--ignore-certificate-errors')
chrome_options.add_argument('--allow-insecure-localhost')
chrome_options.add_argument('--no-sandbox')
browser = webdriver.Chrome('/bin/chromedriver', chrome_options = chrome_options) #ajust chromedriverpath
browser.get(url)
ad = browser.find_element_by_id('videooverlay')
button = browser.find_element_by_xpath('//*[@id="olvideo"]/button')
proxy.new_har("openload")
ad.click()
button.click()
daten = json.dumps(proxy.har) # returns a HAR JSON blob
resp = json.loads(daten)
#
value = "https://openload.co/stream/"
for i in range(0,5):
link = resp['log']['entries'][i]['request']['url']
if value in link:
print(link)
link2 = resp['log']['entries'][i]['response']['redirectURL']
print(link2)
break
else:
continue
server.stop()
browser.quit()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment