Spaces:
Paused
Paused
Create main.py
Browse files
main.py
ADDED
|
@@ -0,0 +1,101 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import re
|
| 2 |
+
from curl_cffi import requests
|
| 3 |
+
from bs4 import BeautifulSoup
|
| 4 |
+
from urllib.parse import urlparse
|
| 5 |
+
|
| 6 |
+
# ouo url
|
| 7 |
+
# Examples:
|
| 8 |
+
# https://ouo.io/HxFVfD - ouo.io links (no account -> only one step)
|
| 9 |
+
# https://ouo.press/Zu7Vs5 - ouo.io links (with account -> two steps)
|
| 10 |
+
# Can exchange between ouo.press and ouo.io
|
| 11 |
+
|
| 12 |
+
url = "https://ouo.press/RSevB5"
|
| 13 |
+
|
| 14 |
+
# -------------------------------------------
|
| 15 |
+
|
| 16 |
+
def RecaptchaV3():
|
| 17 |
+
import requests
|
| 18 |
+
ANCHOR_URL = 'https://www.google.com/recaptcha/api2/anchor?ar=1&k=6Lcr1ncUAAAAAH3cghg6cOTPGARa8adOf-y9zv2x&co=aHR0cHM6Ly9vdW8ucHJlc3M6NDQz&hl=en&v=pCoGBhjs9s8EhFOHJFe8cqis&size=invisible&cb=ahgyd1gkfkhe'
|
| 19 |
+
url_base = 'https://www.google.com/recaptcha/'
|
| 20 |
+
post_data = "v={}&reason=q&c={}&k={}&co={}"
|
| 21 |
+
client = requests.Session()
|
| 22 |
+
client.headers.update({
|
| 23 |
+
'content-type': 'application/x-www-form-urlencoded'
|
| 24 |
+
})
|
| 25 |
+
matches = re.findall('([api2|enterprise]+)\/anchor\?(.*)', ANCHOR_URL)[0]
|
| 26 |
+
url_base += matches[0]+'/'
|
| 27 |
+
params = matches[1]
|
| 28 |
+
res = client.get(url_base+'anchor', params=params)
|
| 29 |
+
token = re.findall(r'"recaptcha-token" value="(.*?)"', res.text)[0]
|
| 30 |
+
params = dict(pair.split('=') for pair in params.split('&'))
|
| 31 |
+
post_data = post_data.format(params["v"], token, params["k"], params["co"])
|
| 32 |
+
res = client.post(url_base+'reload', params=f'k={params["k"]}', data=post_data)
|
| 33 |
+
answer = re.findall(r'"rresp","(.*?)"', res.text)[0]
|
| 34 |
+
return answer
|
| 35 |
+
|
| 36 |
+
# -------------------------------------------
|
| 37 |
+
|
| 38 |
+
client = requests.Session()
|
| 39 |
+
client.headers.update({
|
| 40 |
+
'authority': 'ouo.io',
|
| 41 |
+
'accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7',
|
| 42 |
+
'accept-language': 'en-GB,en-US;q=0.9,en;q=0.8',
|
| 43 |
+
'cache-control': 'max-age=0',
|
| 44 |
+
'referer': 'http://www.google.com/ig/adde?moduleurl=',
|
| 45 |
+
'upgrade-insecure-requests': '1',
|
| 46 |
+
})
|
| 47 |
+
|
| 48 |
+
# -------------------------------------------
|
| 49 |
+
# OUO BYPASS
|
| 50 |
+
|
| 51 |
+
|
| 52 |
+
def ouo_bypass(url):
|
| 53 |
+
tempurl = url.replace("ouo.press", "ouo.io")
|
| 54 |
+
p = urlparse(tempurl)
|
| 55 |
+
id = tempurl.split('/')[-1]
|
| 56 |
+
res = client.get(tempurl, impersonate="chrome110")
|
| 57 |
+
next_url = f"{p.scheme}://{p.hostname}/go/{id}"
|
| 58 |
+
|
| 59 |
+
for _ in range(2):
|
| 60 |
+
|
| 61 |
+
if res.headers.get('Location'): break
|
| 62 |
+
|
| 63 |
+
bs4 = BeautifulSoup(res.content, 'lxml')
|
| 64 |
+
inputs = bs4.form.findAll("input", {"name": re.compile(r"token$")})
|
| 65 |
+
data = { input.get('name'): input.get('value') for input in inputs }
|
| 66 |
+
data['x-token'] = RecaptchaV3()
|
| 67 |
+
|
| 68 |
+
h = {
|
| 69 |
+
'content-type': 'application/x-www-form-urlencoded'
|
| 70 |
+
}
|
| 71 |
+
|
| 72 |
+
res = client.post(next_url, data=data, headers=h,
|
| 73 |
+
allow_redirects=False, impersonate="chrome110")
|
| 74 |
+
next_url = f"{p.scheme}://{p.hostname}/xreallcygo/{id}"
|
| 75 |
+
|
| 76 |
+
return {
|
| 77 |
+
'original_link': url,
|
| 78 |
+
'bypassed_link': res.headers.get('Location')
|
| 79 |
+
}
|
| 80 |
+
|
| 81 |
+
# -------------------------------------------
|
| 82 |
+
|
| 83 |
+
out = ouo_bypass(url)
|
| 84 |
+
print(out)
|
| 85 |
+
|
| 86 |
+
# -------------------------------------------
|
| 87 |
+
'''
|
| 88 |
+
SAMPLE OUTPUT
|
| 89 |
+
|
| 90 |
+
{
|
| 91 |
+
'original_link': 'https://ouo.io/go/HxFVfD',
|
| 92 |
+
'bypassed_link': 'https://some-link.com'
|
| 93 |
+
}
|
| 94 |
+
|
| 95 |
+
'''
|
| 96 |
+
'''
|
| 97 |
+
_._ _,-'""`-._
|
| 98 |
+
(,-.`._,'( |\`-/|
|
| 99 |
+
`-.-' \ )-`( , o o)
|
| 100 |
+
`- \`_`"'-
|
| 101 |
+
'''
|