From 6cac3cf2b2114dbb97f746ff2b4ca4a96a98b4c1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=81=8D=E5=85=AE=E6=83=9A=E5=85=AE?= <101191390+HIllya51@users.noreply.github.com> Date: Mon, 8 Jul 2024 01:42:49 +0800 Subject: [PATCH] redirect --- .github/ISSUE_TEMPLATE/03_question.yaml | 4 +- .github/ISSUE_TEMPLATE/config.yml | 2 +- .../LunaTranslator/gui/setting_about.py | 83 +------------------ .../gui/setting_display_text.py | 4 +- .../files/defaultconfig/static_data.json | 28 +++---- README.md | 4 +- README_en.md | 6 +- README_ru.md | 6 +- build.py | 17 ++-- docs/en/README.md | 4 +- docs/en/start.md | 2 +- docs/ru/README.md | 4 +- docs/ru/start.md | 2 +- docs/zh/README.md | 4 +- docs/zh/sidebar.md | 2 +- docs/zh/start.md | 2 +- plugins/shareddllproxy/update.cpp | 2 +- 17 files changed, 49 insertions(+), 127 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/03_question.yaml b/.github/ISSUE_TEMPLATE/03_question.yaml index 5d52f45a..a11142a9 100644 --- a/.github/ISSUE_TEMPLATE/03_question.yaml +++ b/.github/ISSUE_TEMPLATE/03_question.yaml @@ -7,9 +7,7 @@ body: value: > Before asking questions, make sure it hasn't been mentioned before. - 提问之前应先检索以下列表检查是否已有相关的回答。 - - https://github.com/test123456654321/LunaTranslator/issues + 提问之前应先检查是否已有相关的回答。 Don't ask questions about bugs. To open the right template from the previous selection. diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml index ad8e7508..b5849035 100644 --- a/.github/ISSUE_TEMPLATE/config.yml +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -1,5 +1,5 @@ blank_issues_enabled: true contact_links: - name: Specific Game Related 特定游戏相关 - url: https://github.com/test123456654321/LunaHook/issues/new?assignees=&labels=enhancement&projects=&template=01_game_request.yaml + url: https://lunatranslator.xyz/Github/LunaHook/issues/new?assignees=&labels=enhancement&projects=&template=01_game_request.yaml about: Request for an unsupported game, or hooked text is incorrect 请求支持尚未支持的游戏,或提取的文本不正确 diff --git a/LunaTranslator/LunaTranslator/gui/setting_about.py b/LunaTranslator/LunaTranslator/gui/setting_about.py index 9f9b41d0..7959bd6d 100644 --- a/LunaTranslator/LunaTranslator/gui/setting_about.py +++ b/LunaTranslator/LunaTranslator/gui/setting_about.py @@ -19,30 +19,6 @@ from gui.usefulwidget import ( versionchecktask = queue.Queue() -def getvesionmethod_github(): - try: - headers = { - "Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9", - "Accept-Language": "zh-CN,zh;q=0.9", - "Cache-Control": "max-age=0", - "Proxy-Connection": "keep-alive", - "Upgrade-Insecure-Requests": "1", - "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/106.0.0.0 Safari/537.36", - } - res = requests.get( - "https://api.github.com/repos/HIllya51/LunaTranslator/releases/latest", - headers=headers, - verify=False, - proxies=getproxy(("github", "versioncheck")), - ).json() - # print(res) - _version = res["tag_name"] - return _version - except: - print_exc() - return None - - def getvesionmethod(): try: res = requests.get( @@ -137,60 +113,6 @@ def updatemethod(info, self): return savep -@tryprint -def updatemethod_github(_version, self): - - check_interrupt = lambda: not ( - globalconfig["autoupdate"] and versionchecktask.empty() - ) - if platform.architecture()[0] == "64bit": - bit = "" - elif platform.architecture()[0] == "32bit": - bit = "_x86" - else: - raise Exception - url = "https://github.com/HIllya51/LunaTranslator/releases/download/{}/LunaTranslator{}.zip".format( - _version, bit - ) - - savep = gobject.getcachedir("update/LunaTranslator{}.zip".format(bit)) - - r2 = requests.get( - url, stream=True, verify=False, proxies=getproxy(("github", "download")) - ) - size = int(r2.headers["Content-Length"]) - if check_interrupt(): - return - if updatemethod_checkalready(size, savep): - return savep - with open(savep, "wb") as file: - sess = requests.session() - r = sess.get( - url, stream=True, verify=False, proxies=getproxy(("github", "download")) - ) - file_size = 0 - for i in r.iter_content(chunk_size=1024): - if check_interrupt(): - return - if not i: - continue - file.write(i) - thislen = len(i) - file_size += thislen - - prg = int(10000 * file_size / size) - prg100 = prg / 100 - sz = int(1000 * (int(size / 1024) / 1024)) / 1000 - self.progresssignal.emit( - "总大小{} MB 进度 {:0.2f}% ".format(sz, prg100), prg - ) - - if check_interrupt(): - return - if updatemethod_checkalready(size, savep): - return savep - - def uncompress(self, savep): self.progresssignal.emit("正在解压……", 10000) shutil.rmtree(gobject.getcachedir("update/LunaTranslator/")) @@ -260,10 +182,10 @@ def createdownloadprogress(self): def wraplink(text: str): - link = "https://github.com/HIllya51/LunaTranslator/releases" + link = "https://lunatranslator.xyz/Github/LunaTranslator/releases" if text.startswith("v"): - link = f"https://github.com/HIllya51/LunaTranslator/releases/tag/{text}" + link = f"https://lunatranslator.xyz/Github/LunaTranslator/releases/tag/{text}" return makehtml( link, show=text, @@ -386,7 +308,6 @@ def setTab_update(self, basel): ] shuominggrid = [ - # ["Github", makehtml("https://github.com/HIllya51/LunaTranslator")], ["项目网站", makehtml("https://lunatranslator.xyz/")], [ "使用说明", diff --git a/LunaTranslator/LunaTranslator/gui/setting_display_text.py b/LunaTranslator/LunaTranslator/gui/setting_display_text.py index ad157f75..20567656 100644 --- a/LunaTranslator/LunaTranslator/gui/setting_display_text.py +++ b/LunaTranslator/LunaTranslator/gui/setting_display_text.py @@ -209,8 +209,8 @@ def on_not_find_qweb(self): def _okcallback(): link = [ - "https://github.com/test123456654321/RESOURCES/releases/download/other/QWebEngine_x86.zip", - "https://github.com/test123456654321/RESOURCES/releases/download/other/QWebEngine_x64.zip", + "https://lunatranslator.xyz/Resource/QWebEngine_x86.zip", + "https://lunatranslator.xyz/Resource/QWebEngine_x64.zip", ][platform.architecture()[0] == "64bit"] os.startfile(link) installqwebdialog(self, link) diff --git a/LunaTranslator/files/defaultconfig/static_data.json b/LunaTranslator/files/defaultconfig/static_data.json index 7b7fd8e1..3bc635dc 100644 --- a/LunaTranslator/files/defaultconfig/static_data.json +++ b/LunaTranslator/files/defaultconfig/static_data.json @@ -697,27 +697,27 @@ "links": [ { "name": "日语", - "link": "https://github.com/test123456654321/RESOURCES/releases/download/ocr_models/ja.zip" + "link": "https://lunatranslator.xyz/Resource/ocr_models/ja.zip" }, { "name": "英文", - "link": "https://github.com/test123456654321/RESOURCES/releases/download/ocr_models/en.zip" + "link": "https://lunatranslator.xyz/Resource/ocr_models/en.zip" }, { "name": "简体中文", - "link": "https://github.com/test123456654321/RESOURCES/releases/download/ocr_models/zh.zip" + "link": "https://lunatranslator.xyz/Resource/ocr_models/zh.zip" }, { "name": "繁体中文", - "link": "https://github.com/test123456654321/RESOURCES/releases/download/ocr_models/cht.zip" + "link": "https://lunatranslator.xyz/Resource/ocr_models/cht.zip" }, { "name": "韩语", - "link": "https://github.com/test123456654321/RESOURCES/releases/download/ocr_models/ko.zip" + "link": "https://lunatranslator.xyz/Resource/ocr_models/ko.zip" }, { "name": "俄语", - "link": "https://github.com/test123456654321/RESOURCES/releases/download/ocr_models/ru.zip" + "link": "https://lunatranslator.xyz/Resource/ocr_models/ru.zip" } ] }, @@ -750,7 +750,7 @@ "links": [ { "name": "MeCab", - "link": "https://github.com/test123456654321/RESOURCES/releases/download/dictionary/Mecab.zip" + "link": "https://lunatranslator.xyz/Resource/dictionary/Mecab.zip" }, { "name": "Unidic", @@ -760,19 +760,19 @@ }, { "name": "小学馆", - "link": "https://github.com/test123456654321/RESOURCES/releases/download/dictionary/xiaoxueguan.db" + "link": "https://lunatranslator.xyz/Resource/dictionary/xiaoxueguan.db" }, { "name": "EDICT", - "link": "https://github.com/test123456654321/RESOURCES/releases/download/dictionary/edict.db" + "link": "https://lunatranslator.xyz/Resource/dictionary/edict.db" }, { "name": "EDICT2", - "link": "https://github.com/test123456654321/RESOURCES/releases/download/dictionary/edict2" + "link": "https://lunatranslator.xyz/Resource/dictionary/edict2" }, { "name": "灵格斯词典", - "link": "https://github.com/test123456654321/RESOURCES/releases/download/dictionary/Lingoes.zip" + "link": "https://lunatranslator.xyz/Resource/dictionary/Lingoes.zip" }, { "name": "MDict", @@ -847,7 +847,7 @@ }, { "name": "win7适配版", - "link": "https://github.com/test123456654321/RESOURCES/releases/download/other/Release.zip" + "link": "https://lunatranslator.xyz/Resource/Magpie9_Win7" } ] }, @@ -857,11 +857,11 @@ "links": [ { "name": "x86", - "link": "https://github.com/test123456654321/RESOURCES/releases/download/other/QWebEngine_x86.zip" + "link": "https://lunatranslator.xyz/Resource/QWebEngine_x86.zip" }, { "name": "x64", - "link": "https://github.com/test123456654321/RESOURCES/releases/download/other/QWebEngine_x64.zip" + "link": "https://lunatranslator.xyz/Resource/QWebEngine_x64.zip" } ] } diff --git a/README.md b/README.md index 20d6a869..3283c7cc 100644 --- a/README.md +++ b/README.md @@ -2,8 +2,8 @@

- - + + ### 简体中文 | [Русский язык](README_ru.md) | [English](README_en.md) | [Other Language](otherlang.md) diff --git a/README_en.md b/README_en.md index 7c191074..601bf3f6 100644 --- a/README_en.md +++ b/README_en.md @@ -2,8 +2,8 @@

- - + +

### [简体中文](README.md) | [Русский язык](README_ru.md) | English | [Other Languages](otherlang.md) @@ -12,7 +12,7 @@ ### Documentation -Welcome friends who want to help us improve the documentation! [Documentation Repo](https://github.com/test123456654321/LunaTranslator) +Welcome friends who want to help us improve the documentation! [Documentation Repo](https://lunatranslator.xyz/Github/LunaTranslator) ## Features diff --git a/README_ru.md b/README_ru.md index eb452342..5e1c77fd 100644 --- a/README_ru.md +++ b/README_ru.md @@ -3,8 +3,8 @@

- - + +

### [简体中文](README.md) | Русский язык | [English](README_en.md) | [Other Language](otherlang.md) @@ -14,7 +14,7 @@ ### Инструкция по настройке программы (Полностью на русском языке) -Welcome friends who find it helpful to improve the documentation together.[Documentation Repo](https://github.com/test123456654321/LunaTranslator) +Welcome friends who find it helpful to improve the documentation together.[Documentation Repo](https://lunatranslator.xyz/Github/LunaTranslator) ## Основные функции: diff --git a/build.py b/build.py index ce974fce..850391b5 100644 --- a/build.py +++ b/build.py @@ -23,11 +23,11 @@ curlFileName64 = "curl-8.7.1_7-win64-mingw.zip" ocrModelUrl = ( - "https://github.com/test123456654321/RESOURCES/releases/download/ocr_models" + "https://lunatranslator.xyz/Resource/ocr_models" ) availableLocales = ["cht", "en", "ja", "ko", "ru", "zh"] -LunaHook_latest = "https://github.com/test123456654321/LunaHook/releases/latest/download/Release_English.zip" +LunaHook_latest = "https://lunatranslator.xyz/Github/LunaHook/releases/latest/download/Release_English.zip" LocaleRe = "https://github.com/InWILL/Locale_Remulator/releases/download/v1.5.3-beta.1/Locale_Remulator.1.5.3-beta.1.zip" @@ -113,15 +113,15 @@ def downloadcommon(): os.chdir(rootDir + "\\temp") downloadlr() subprocess.run( - f"curl -LO https://github.com/test123456654321/RESOURCES/releases/download/other/mecab.zip" + f"curl -LO https://lunatranslator.xyz/Resource/build_req/mecab.zip" ) subprocess.run(f"7z x mecab.zip -oALL") subprocess.run( - f"curl -LO https://github.com/test123456654321/RESOURCES/releases/download/other/ocr.zip" + f"curl -LO https://lunatranslator.xyz/Resource/build_req/ocr.zip" ) subprocess.run(f"7z x ocr.zip -oALL") subprocess.run( - f"curl -LO https://github.com/test123456654321/RESOURCES/releases/download/other/magpie.zip" + f"curl -LO https://lunatranslator.xyz/Resource/build_req/magpie.zip" ) subprocess.run(f"7z x magpie.zip -oALL") @@ -241,8 +241,11 @@ def buildPlugins(): def downloadsomething(): os.chdir(rootDir + "\\temp") - os.system("git clone https://github.com/test123456654321/stylesheets") - move_directory_contents("stylesheets", rootDir + "\\LunaTranslator\\files\\themes") + subprocess.run( + f"curl -LO https://lunatranslator.xyz/Resource/build_req/stylesheets-main.zip" + ) + subprocess.run(f"7z x stylesheets-main.zip -oALL") + move_directory_contents("ALL/stylesheets-main", rootDir + "\\LunaTranslator\\files\\themes") if __name__ == "__main__": diff --git a/docs/en/README.md b/docs/en/README.md index f97b09af..7f29b1cd 100644 --- a/docs/en/README.md +++ b/docs/en/README.md @@ -3,8 +3,8 @@

- - + + ## Features diff --git a/docs/en/start.md b/docs/en/start.md index a3c10716..848cec9b 100644 --- a/docs/en/start.md +++ b/docs/en/start.md @@ -4,7 +4,7 @@ ## How to Download -1. Go to [the LunaTranslator releases page](https://github.com/test123456654321/LunaTranslator/releases) +1. Go to [the LunaTranslator releases page](https://lunatranslator.xyz/Github/LunaTranslator/releases) 2. In the "Assets" section of the latest release, find and download the "LunaTranslator.zip" file 3. Extract the contents of the ZIP file to any directory on your computer. ![img](../images/zh/download.jpg) diff --git a/docs/ru/README.md b/docs/ru/README.md index 8d40a592..4b54a8f4 100644 --- a/docs/ru/README.md +++ b/docs/ru/README.md @@ -3,8 +3,8 @@

- - + + diff --git a/docs/ru/start.md b/docs/ru/start.md index d5e83578..e549e0f3 100644 --- a/docs/ru/start.md +++ b/docs/ru/start.md @@ -3,7 +3,7 @@ ## Скачать -Ссылка для загрузки актуальной версии программы: https://github.com/test123456654321/LunaTranslator/releases +Ссылка для загрузки актуальной версии программы: https://lunatranslator.xyz/Github/LunaTranslator/releases Скачайте архив **LunaTranslator.zip** и распакуйте его в любое удобное для вас место. ![img](../images/ru/download_ru.png) diff --git a/docs/zh/README.md b/docs/zh/README.md index 4b607aaa..035dfbc7 100644 --- a/docs/zh/README.md +++ b/docs/zh/README.md @@ -5,8 +5,8 @@

- - + + 使用说明 视频教程 交流群912525396 diff --git a/docs/zh/sidebar.md b/docs/zh/sidebar.md index 52ea172f..93feaa21 100644 --- a/docs/zh/sidebar.md +++ b/docs/zh/sidebar.md @@ -25,7 +25,7 @@ - [如何自动划词进 anki](/zh/qa2.md) - [如何使用离线 chatgpt](/zh/qa3.md) - [如何使用 gemini 免费 api](/zh/qa4.md) - - [其他问题](https://github.com/test123456654321/LunaTranslator/issues?q=label%3AQ%26A) + - [其他问题](https://lunatranslator.xyz/Github/LunaTranslatorissues?q=label%3AQ%26A) - 支持作者 - [支持作者](/zh/support.md) \ No newline at end of file diff --git a/docs/zh/start.md b/docs/zh/start.md index bdae09ee..644c58e7 100644 --- a/docs/zh/start.md +++ b/docs/zh/start.md @@ -2,7 +2,7 @@ ### 下载 -下载64位版 下载32位版 或从 releases 下载 LunaTranslator.zipLunaTranslator_x86.zip ,解压到任意目录 +下载64位版 下载32位版 或从 releases 下载 LunaTranslator.zipLunaTranslator_x86.zip ,解压到任意目录 #### 注意 diff --git a/plugins/shareddllproxy/update.cpp b/plugins/shareddllproxy/update.cpp index 171fafe3..2743c2f2 100644 --- a/plugins/shareddllproxy/update.cpp +++ b/plugins/shareddllproxy/update.cpp @@ -31,7 +31,7 @@ int updatewmain(int argc, wchar_t *argv[]) catch (std::exception &e) { MessageBoxA(GetForegroundWindow(), (std::string("Update failed!\r\n") + e.what()).c_str(), "Error", 0); - ShellExecute(0, L"open", L"https://github.com/test123456654321/LunaTranslator/releases", NULL, NULL, SW_SHOWNORMAL); + ShellExecute(0, L"open", L"https://lunatranslator.xyz/Github/LunaTranslator/releases", NULL, NULL, SW_SHOWNORMAL); return 0; } try