diff --git a/awesometts/service/naver.py b/awesometts/service/naver.py index d106533..0b5c9cc 100644 --- a/awesometts/service/naver.py +++ b/awesometts/service/naver.py @@ -146,6 +146,8 @@ # This function implements function I(a,t) found at # https://papago.naver.com/main.87cbe57a9fc46d3db5c1.chunk.js +# 2021/05/27 update: +# HMAC_KEY has changed, and the timestamp is now in milliseconds def _compute_token(timestamp, uuid_str): msg = uuid_str + '\n' + TRANSLATE_MKID + '\n' + timestamp @@ -161,9 +163,6 @@ def _generate_headers(): timestamp_str = str(int(timestamp_milliseconds)) auth = _compute_token(timestamp_str, UUID) - # auth='PPG 15b4b888-3839-46e2-926e-05612601d92b:9CTJD16jlIY7BTHzy/bcKw==' - # timestamp='1622099405030' - return {'authorization': auth, 'timestamp': timestamp_str, 'Content-Type': 'application/x-www-form-urlencoded', @@ -240,6 +239,9 @@ def run(self, text, options, path): sound_id = response_data['id'] self._logger.info(f'retrieved sound_id successfully: {sound_id}') + # actually retrieve sound file + # ============================ + final_url = TRANSLATE_ENDPOINT + sound_id self._logger.info(f'final_url: {final_url}')