Skip to content

Commit

Permalink
fix: 支持python低版本
Browse files Browse the repository at this point in the history
  • Loading branch information
yuhldr committed Aug 18, 2024
1 parent 42650ec commit c8db7c0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lfy/api/server/bing.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import requests
from requests import RequestException

from lfy.api.server import Server, TIME_OUT
from lfy.api.server import TIME_OUT, Server


def _init_session():
Expand Down Expand Up @@ -91,7 +91,7 @@ def translate_text(self, text, lang_to="zh-cn", lang_from="auto", n=0):
iid = f"translator.{random.randint(5019, 5026)}.{random.randint(1, 3)}"
self.session.headers.update({'my_iid': iid})
hs = self.session.headers
url = f'https://{host}/ttranslatev3?isVertical=1&&IG={hs["IG"]}&IID={hs['my_iid']}'
url = f'https://{host}/ttranslatev3?isVertical=1&&IG={hs["IG"]}&IID={hs["my_iid"]}'

data = {'': '', 'text': text, 'to': lang_to,
'token': hs['token'], 'key': hs['key'], "fromLang": lang_from}
Expand Down

0 comments on commit c8db7c0

Please sign in to comment.