Skip to content

Commit

Permalink
fix: fix py-pkger outdated
Browse files Browse the repository at this point in the history
  • Loading branch information
txperl committed Jun 28, 2024
1 parent 5d54948 commit 5d376f5
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 19 deletions.
9 changes: 6 additions & 3 deletions .pkg/py-pkger.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@

with warnings.catch_warnings():
warnings.simplefilter('ignore', DeprecationWarning)
import imp
from modulefinder import ModuleFinder

ROOT_PATH = os.path.split(os.path.realpath(sys.argv[0]))[0]
Expand Down Expand Up @@ -83,11 +82,12 @@ def files(path, frmt="*", OTH=["", "pyc", "DS_Store"]):


# 修复 ModuleFinder 可能 BUG
_PY_SOURCE = 1
class ModuleFinderR(ModuleFinder):
def run_script(self, pathname):
self.msg(2, "run_script", pathname)
with open(pathname, encoding="utf-8") as fp:
stuff = ("", "r", imp.PY_SOURCE)
stuff = ("", "rb", _PY_SOURCE)
self.load_module('__main__', fp, pathname, stuff)


Expand Down Expand Up @@ -126,7 +126,10 @@ def run_script(self, pathname):
oargs.append(f"--add-data {ori[1:]}{BET}{dest[1:]}")
# 分析动态加载文件中所使用的包
if x[2] == "py":
finder.run_script(x[0])
try:
finder.run_script(x[0])
except:
continue
for name, mod in finder.modules.items():
module = name.split(".")[0] if os.name == "nt" else name
if module[0] == "_" and module[1:] in hiddenImport:
Expand Down
32 changes: 16 additions & 16 deletions app/config/language/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,44 +11,44 @@ app.core.biu:
hint_exist_new: "A new version is available"
fail_to_check: "Failed to check for update"
fail_to_check_duo_to_network: "Failed to check for update, probably because the server didn't respond for a long time"
tell_to_download: "Visit https://biu.tls.moe/ to download"
press_to_use_old: "Press any key to continue using this old version..."
tell_to_download: "Go https://biu.tls.moe/ and download"
press_to_use_old: "Press any key to continue with the old version..."
network:
hint_in_check: "Checking network status..."
fail_pixiv_and_use_bypass: "Cannot connect to Pixiv, enable bypassSNI route (may not be available temporarily)"
loginHelper:
hint_token_only: "Since Pixiv disables password login, you can only use Token to login for now"
hint_token_only: "Since Pixiv disables password login, you can only use token to login for now"
hint_before_start: "Network detection is about to start, this process can reduce the probability of not being able to use PixivBiu due to network problems"
fail_to_get_token_due_to_network: "Your network is not working properly for Pixiv Token login, please adjust it and try again."
fail_to_get_token_anyway: "There was an error getting the Token, please try again."
fail_to_get_token_due_to_network: "Your network is not working properly for Pixiv token login, please adjust it and try again."
fail_to_get_token_anyway: "There was an error getting the token, please try again."
fail_by_cloudflare_captcha: "Encountered Cloudflare protection when logging in, it may be caused by network environment issues. You can try to get the token again, or wait a while and log in again"
is_need_to_get_token: "Continue? (y / n): "
ready:
hint_run: "Run"
hint_how_to_use: "Enter the address into a modern browser"
hint_how_to_use: "Visit the address in a modern browser"
hint_version: "Version"
hint_function_types: "Function Types"
hint_image_service: "Image Service"
hint_download_path: "Download Save Path"
hint_program_path: "Program Directory"
done_init: "Initialization completed"
hint_download_path: "Download Folder"
hint_program_path: "PixivBiuFolder"
done_init: "Init Done"
others:
hint_in_update_token: "Trying to update token"
hint_in_update_token: "Try to update token"

app.common.loginHelper:
network:
press_need_to_type_proxy: "Please enter the proxy listener address (can be blank): "
hint_in_check: "Starting network detection..."
hint_detect_proxy: "Proxy listener address (%s) detected, do you want to change it? (y / n): "
press_need_to_type_proxy: "Please enter the proxy address (can be blank): "
hint_in_check: "Doing network detection..."
hint_detect_proxy: "Proxy address (%s) detected, do you want to change it? (y / n): "
is_need_to_type_proxy: "The system proxy address was not detected, do you need to set it manually? (y / n): "
login:
hint_intro_step_head: "[Login] Please follow these steps:"
hint_intro_step_head: "[Login] Please follow steps below:"
hint_intro_step_1: "1. Visit: %s?%s"
hint_intro_step_2: "2. Open the browser's [Developer Tools / F12] and switch to the [Network] tab"
hint_intro_step_3: "3. Turn on [Preserve log]"
hint_intro_step_4: "4. Type [callback?] in the [Filter] input box"
hint_intro_step_5: "5. Login to your Pixiv account"
hint_intro_step_6: "6. After successfully logging in, there will be a message like [https://app-api.pixiv.net/...&code=...]"
hint_intro_step_7: "7. Enter the parameter after [code] into this program"
fail_code_918: "Code error. Please note that the program requires a different code each time it starts, and cannot reuse the previous one, and the Code doesn't contain quotation marks."
fail_code_1508: "Code has expired. Please hurry up while doing the code fetching operation."
fail_code_918: "Code error. Please note that the program requires a different code each time it starts, and the Code doesn't contain quotation marks."
fail_code_1508: "Code is expired. Please get a bit faster while doing the code fetching operation."

0 comments on commit 5d376f5

Please sign in to comment.