jianchang512/ott is tracked by TopGit as an open-source project, with 482 stars on GitHub, written primarily in Python. Api tool for local offline text translation supporting multiple languages/支持多语言的本地离线文字翻译api
Snapshot summary built from the project's own GitHub metadata — there's no written TopGit review yet. The page will update automatically when a full review is published.
WHY NO REVIEW YET
TopGit writes full reviews for the most-starred, most-requested repositories. This page is a snapshot until then — see the READ ME tab for the original README in full.
修改了 \venv\Lib\site-packages\argostranslate\networking.py 的 get 方法,当下载失败时,抛出异常,以实现下载模式出错时提醒使用代理
def get(url: str, retry_count: int = 3) -> bytes | None:
"""Downloads data from a url and returns it
Args:
url: The url to download (http, https)
retry_count: The number of retries to attempt if the initial download fails.
If retry_count is 0 the download will only be attempted once.
Returns:
The downloaded data, None is returned if the download fails
"""
if get_protocol(url) not in supported_protocols:
return None
info(f"Get {url}")
print(f'{url=}')
download_attempts_count = 0
while download_attempts_count <= retry_count:
try:
req = urllib.request.Request(
url,
headers={"User-Agent": USER_AGENT},
)
response = urllib.request.urlopen(req)
data = response.read()
info(f"Got {url}")
return data
except Exception as err:
download_attempts_count += 1
# 增加抛出异常 ++
raise Exception('download error')
error(err)
# 增加抛出异常 ++
raise Exception('download error')
return None
\venv\Lib\site-packages\argostranslate\package.py
注释掉无法连接raw.githubusercontent.com时的报错,已在入口文件做了处理
def update_package_index():
"""Downloads remote package index"""
with package_lock:
try:
response = urllib.request.urlopen(settings.remote_package_index)
except Exception as err:
# 注释掉错误输出,已在入口文件获取了index.json,此处如果无法连接则不再输出错误,避免造成小白迷惑
#error(err) --
return
data = response.read()
with open(settings.local_package_index, "wb") as f:
f.write(data)
The most recent commit recorded on jianchang512/ott was 2.0 years ago, based on the GitHub push timestamp. The repository has 69 forks — one of the better signals of community interest.
How many stars does jianchang512/ott have?
jianchang512/ott has 482 GitHub stars — refresh the page for the live number, or check github.com/jianchang512/ott. TopGit mirrors GitHub's count but does not claim minute-by-minute accuracy.
Is jianchang512/ott open source?
Yes — jianchang512/ott ships under the MIT license, which makes its source code freely readable (and, depending on license terms, forkable and reusable). Source: github.com/jianchang512/ott.
What topics is jianchang512/ott associated with?
GitHub's repository topics for jianchang512/ott: "translate", "translation", "translator". TopGit's editorial category is open-source.
Where can I see jianchang512/ott in action?
The project maintains a homepage at https://pyvideotrans.com. The README tab on this page also usually contains screenshots and a quickstart.
Where do I read more about jianchang512/ott?
This TopGit page is a snapshot — the READ ME tab shows the project's own README content (links stripped, images preserved). The GitHub repository at github.com/jianchang512/ott is the definitive source.
Read full README in the tab above.
Is ott worth your time?
ChatGPT, Claude and Perplexity can all read this page. Ask one of them what it makes of ott.