-
Notifications
You must be signed in to change notification settings - Fork 2
/
psa_bypass.py
51 lines (37 loc) · 1.79 KB
/
psa_bypass.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
import time
import requests
import re
import cloudscraper
import concurrent.futures
from bs4 import BeautifulSoup
def try2link_bypass(url):
client = cloudscraper.create_scraper(allow_brotli=False)
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/'})
soup = BeautifulSoup(r.text, 'html.parser')
inputs = soup.find(id="go-link").find_all(name="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}
bypassed_url = client.post('https://try2link.com/links/go', headers=headers,data=data)
return bypassed_url.json()["url"]
def try2link_scrape(url):
client = cloudscraper.create_scraper(allow_brotli=False)
h = {
'upgrade-insecure-requests': '1', 'user-agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/105.0.0.0 Safari/537.36',
}
res = client.get(url, cookies={}, headers=h)
url = 'https://try2link.com/'+re.findall('try2link\.com\/(.*?) ', res.text)[0]
print(try2link_bypass(url))
def psa_bypasser(psa_url):
client = cloudscraper.create_scraper(allow_brotli=False)
r = client.get(psa_url)
soup = BeautifulSoup(r.text, "html.parser").find_all(class_="dropshadowboxes-drop-shadow dropshadowboxes-rounded-corners dropshadowboxes-inside-and-outside-shadow dropshadowboxes-lifted-both dropshadowboxes-effect-default")
with concurrent.futures.ThreadPoolExecutor() as executor:
for link in soup:
try:
exit_gate = link.a.get("href")
executor.submit(try2link_scrape, exit_gate)
except: pass
psa_bypasser("https://psa.pm/tv-show/reservation-dogs/")