Skip to content

Instantly share code, notes, and snippets.

@Bluscream
Created August 17, 2018 13:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Bluscream/2055a4f72a7676735b35bd2ae10d509f to your computer and use it in GitHub Desktop.
Save Bluscream/2055a4f72a7676735b35bd2ae10d509f to your computer and use it in GitHub Desktop.
TS3Cloud TeamSpeak Proxy generator
#!/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)
@Bluscream
Copy link
Author

Example output:

('213.32.113.196:14653', ('213.32.113.196', 14653))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment