ultrafunkamsterdam / googletranslate

Python Google Translate (using reverse-engineered public API, so free)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Does not work if text has emoji

Lonami opened this issue · comments

Example code:

print(translate('🌕 Важная', 'ru', 'en'))

Returns the 403 status HTML page. Probably this else is wrong:

for i in text:
val = ord(i)
if val < 0x10000:
a += [val]
else:
a += [
math.floor((val - 0x10000) / 0x400 + 0xD800),
math.floor((val - 0x10000) % 0x400 + 0xDC00),
]