Skip to content

Instantly share code, notes, and snippets.

@oktavianto
Last active April 18, 2020 13:38
Show Gist options
  • Save oktavianto/c6f4c8f6261770d60c2ddd06eb60da83 to your computer and use it in GitHub Desktop.
Save oktavianto/c6f4c8f6261770d60c2ddd06eb60da83 to your computer and use it in GitHub Desktop.
# pip install requests
# cloudflare-wrap-bug.py
import requests
import json
import datetime
import random
import string
import time
def genString(stringLength):
letters = string.ascii_letters + string.digits
return ''.join(random.choice(letters) for i in range(stringLength))
url = 'https://api.cloudflareclient.com/v0a745/reg'
# Ganti jadi ID sendiri
# Pengaturan > Lanjutan > Diagnostik > ID
# Change your own ID
# Setting > Advanced > Diagnostic > ID
refId = 'bca9ada5-5af3-4ef2-bf16-4f1843768c10'
def run():
install_id = genString(11)
body = {
"key": "{}=".format(genString(42)),
"install_id": install_id,
"fcm_token": "{}:APA91b{}".format(install_id, genString(134)),
"referrer": refId,
"warp_enabled": False,
"tos": datetime.datetime.now().isoformat()[:-3] + "+07:00",
"type": "Android",
"locale": "zh-CN"
}
bodyString = json.dumps(body)
headers = {
'Content-Type': 'application/json; charset=UTF-8',
'Host': 'api.cloudflareclient.com',
'Connection': 'Keep-Alive',
'Accept-Encoding': 'gzip',
'User-Agent': 'okhttp/3.12.1'
}
r = requests.post(url, data=bodyString, headers=headers)
return r
c = 1
while True:
result = run()
if result.status_code == 200:
print(c,"GB added successfully!")
c = c + 1
else:
time.sleep(1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment