mirror of
https://github.com/ggerganov/ggwave.git
synced 2026-04-19 20:57:38 +08:00
23 lines
477 B
Python
23 lines
477 B
Python
import sys
|
|
import requests
|
|
|
|
def ggwave(message: str, protocolId: int = 1):
|
|
|
|
url = 'https://ggwave.ggerganov.com/ggwave-to-file.php'
|
|
|
|
params = {
|
|
'm': message, # message to encode
|
|
'p': protocolId, # transmission protocol to use
|
|
}
|
|
|
|
response = requests.get(url, params=params)
|
|
|
|
if response == '':
|
|
raise SyntaxError('Request failed')
|
|
|
|
return response
|
|
|
|
result = ggwave("Hello world!")
|
|
|
|
sys.stdout.buffer.write(result.content)
|