Skip to content

Commit

Permalink
Update direct_link_generator.py
Browse files Browse the repository at this point in the history
  • Loading branch information
weebzone authored Nov 21, 2022
1 parent 3df85bc commit 7de6d57
Showing 1 changed file with 9 additions and 17 deletions.
26 changes: 9 additions & 17 deletions bot/helper/mirror_utils/download_utils/direct_link_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,33 +114,25 @@ def rock(url: str) -> str:
soup = BeautifulSoup(resp.content, "html.parser")

try: inputs = soup.find(id="go-link").find_all(name="input")
except: return "Incorrect Link"

except: return "Incorrect Link"
data = { input.get('name'): input.get('value') for input in inputs }

h = { "x-requested-with": "XMLHttpRequest" }

time.sleep(10)
h = { "x-requested-with": "XMLHttpRequest" }
sleep(10)
r = client.post(f"{DOMAIN}/links/go", data=data, headers=h)
try:
return r.json()['url']
except: return "Something went wrong :("

def try2link(url):
client = create_scraper()

url = url[:-1] if url[-1] == '/' else url

client = create_scraper()
url = url[:-1] if url[-1] == '/' else url
params = (('d', int(time.time()) + (60 * 4)),)
r = client.get(url, params=params, headers= {'Referer': 'https://newforex.online/'})

r = client.get(url, params=params, headers= {'Referer': 'https://newforex.online/'})
soup = BeautifulSoup(r.text, 'html.parser')
inputs = soup.find_all("input")
data = { input.get('name'): input.get('value') for input in inputs }
time.sleep(7)

headers = {'Host': 'try2link.com', 'X-Requested-With': 'XMLHttpRequest', 'Origin': 'https://try2link.com', 'Referer': url}

sleep(7)
headers = {'Host': 'try2link.com', 'X-Requested-With': 'XMLHttpRequest', 'Origin': 'https://try2link.com', 'Referer': url}
bypassed_url = client.post('https://try2link.com/links/go', headers=headers,data=data)
return bypassed_url.json()["url"]

Expand All @@ -154,7 +146,7 @@ def ez4(url):
inputs = soup.find_all("input")
data = { input.get('name'): input.get('value') for input in inputs }
h = { "x-requested-with": "XMLHttpRequest" }
time.sleep(8)
sleep(8)
r = client.post(f"{DOMAIN}/links/go", data=data, headers=h)
try:
return r.json()['url']
Expand Down

0 comments on commit 7de6d57

Please sign in to comment.