Created
August 17, 2018 13:33
-
-
Save Bluscream/2055a4f72a7676735b35bd2ae10d509f to your computer and use it in GitHub Desktop.
TS3Cloud TeamSpeak Proxy generator
This file contains 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
#!/usr/bin/env python3 | |
# -*- coding: utf-8 -*- | |
# Origin: https://gist.github.com/Bluscream/2055a4f72a7676735b35bd2ae10d509f | |
from requests import request | |
from bs4 import BeautifulSoup | |
class TS3CloudProxy(object): | |
url = "https://www.ts3.cloud/ts3proxy" | |
payload = "input={host}%253A{port}&proxy=" | |
headers = { | |
'User-Agent': "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:60.0) Gecko/20100101 Firefox/60.0", | |
'Accept': "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8", | |
'Accept-Language': "en-US,en;q=0.5", | |
'Referer': "https://www.ts3.cloud/ts3proxy", | |
'Content-Type': "application/x-www-form-urlencoded", | |
'DNT': "1", | |
'Pragma': "no-cache", | |
'Cache-Control': "no-cache" | |
} | |
def generateProxy(self, host, port=9987): | |
response = request("POST", self.url, data=self.payload.format(host=host,port=port), headers=self.headers, verify=False) | |
page = response.content | |
soup = BeautifulSoup(page, features="html.parser") | |
div_alert = soup.find("div", {"class": "alert alert-success alert-dismissable"}) | |
proxy_adress = div_alert.find("center").find("b").text | |
_proxy_adress = proxy_adress.split(":") | |
proxy = (_proxy_adress[0], int(_proxy_adress[1])) | |
return (proxy_adress, proxy) | |
if __name__ == '__main__': | |
proxy = TS3CloudProxy().generateProxy("voice.teamspeak.com") | |
print(proxy) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Example output: