jianchang512/ott là dự án mã nguồn mở trên GitHub, viết chủ yếu bằng Python, với 482 sao. Api tool for local offline text translation supporting multiple languages/支持多语言的本地离线文字翻译api
Tóm tắt dựng từ metadata GitHub của chính dự án — chưa có bài review TopGit. Trang sẽ tự động cập nhật khi bài review đầy đủ được xuất bản.
VÌ SAO CHƯA CÓ REVIEW
TopGit viết bài đầy đủ cho repo có nhiều sao nhất và được yêu cầu nhiều nhất. Trang này là snapshot trong thời gian chờ — xem README gốc ở tab READ ME.
修改了 \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)
Trang TopGit này là một snapshot — tab "Readme" hiển thị nguyên văn README của repo (đã bỏ link, giữ ảnh). Repo GitHub ở github.com/jianchang512/ott là nguồn chính thức.
jianchang512/ott có bao nhiêu sao?
jianchang512/ott có 482 sao GitHub — tải lại trang để xem số mới nhất, hoặc xem trực tiếp github.com/jianchang512/ott. TopGit phản chiếu số sao của GitHub nhưng không cam kết đến từng phút.
jianchang512/ott có những chủ đề gì?
GitHub topics của jianchang512/ott: "translate", "translation", "translator". TopGit xếp repo vào nhóm mã nguồn mở.
jianchang512/ott có phải mã nguồn mở không?
Có — jianchang512/ott phát hành theo license MIT, nghĩa là mã nguồn mở để đọc, fork và (tùy license) tái sử dụng. Mã: github.com/jianchang512/ott.
jianchang512/ott có trang demo không?
Dự án có trang chủ ở https://pyvideotrans.com. Tab "Readme" ở trang này thường có ảnh chụp và hướng dẫn bắt đầu nhanh.
jianchang512/ott còn đang phát triển không?
Commit gần nhất trên jianchang512/ott là 2.0 năm trước (theo timestamp GitHub). Repo có 69 fork — một chỉ báo về mức độ quan tâm của cộng đồng.
Đọc đầy đủ README ở tab phía trên.
Vẫn đang phân vân về ott?
Một cú bấm sẽ gửi câu hỏi kèm trang này cho AI — xem AI nói gì về ott.