Last active
December 12, 2021 14:37
-
-
Save melowody/c2af64cfca846e7bd871f6f8d8d0b070 to your computer and use it in GitHub Desktop.
Function to post to the GD servers from python
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import urllib.request, json | |
import urllib.parse | |
def send_request(url: str, **kw): | |
opener = urllib.request.build_opener() | |
opener.addheaders = [(header, value) | |
for header, value in opener.addheaders | |
if header.casefold() != 'user-agent'] | |
with opener.open("http://www.boomlings.com/database/" + url, data=bytes(urllib.parse.urlencode(kw), 'utf-8')) as response: | |
x = response.read().decode() | |
return x |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Example use:
send_request("downloadGJLevel22.php", levelID=14278830, secret="Wmfd2893gb7")