Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

python小白请教下大佬使用方法 #4

Closed
KalaMeetsT1 opened this issue Mar 3, 2023 · 5 comments
Closed

python小白请教下大佬使用方法 #4

KalaMeetsT1 opened this issue Mar 3, 2023 · 5 comments

Comments

@KalaMeetsT1
Copy link

请问如何配置位置参数呢,我尝试用Pycharm配置了一下,返回了以下提示:

TypeError: expected str, bytes or os.PathLike object, not NoneType

这是我在Pycharm中尝试的配置内容:
C:\Users\Downloads\LpkUnpacker-master\LpkUnpacker-master\xxx.lpk
C:\Users\Downloads\LpkUnpacker-master\LpkUnpacker-master

@MissPinkElfLady
Copy link

Here is a fix without having to debug:

  1. go to directory of LpkUnpacker-master
  2. put your lpk and config.json in a new folder called "lpk"
  3. create a new folder called "new" which will contain all your unzipped files
  4. change your LpkUnpacker.py into:
    import sys
    import argparse
    from Core.lpk_loader import *
    from Core.utils import *
    loader = LpkLoader("./lpk/[Insert your lpk name here and delete bracket].lpk", "./lpk/config.json")
    loader.extract("./new")
  5. Use a text editor to open the config.json and copy it for use
  6. Go to Core\lpkloader.py and change the
    self.config = json.loads(open(self.configpath, "r", encoding="utf8").read())
    line into
    self.config = [replace with what you copied from step 5]
  7. Add a line
    self.config = {}
    at line 18 just to be safe that it knows self.config is supposed to be dictionary
  8. run LpkUnpacker.py and you should be able to get what you want in the folder.

P.S. the bug is very weird, at first I thought its just one simple directory issue (win error 123) but after fixing the class definition, traceback is telling me something is wrong with stuff I commented out which is rediculuous. That is why I have decided enough is enough and started stripping down LpkUnpacker.py

PPS. Great work! Would be even better if there were another script to zip stuff back but thanks a lot!!!

@ihopenot
Copy link
Owner

请问如何配置位置参数呢,我尝试用Pycharm配置了一下,返回了以下提示:

TypeError: expected str, bytes or os.PathLike object, not NoneType

这是我在Pycharm中尝试的配置内容: C:\Users\Downloads\LpkUnpacker-master\LpkUnpacker-master\xxx.lpk C:\Users\Downloads\LpkUnpacker-master\LpkUnpacker-master

你这个问题看起来是参数配错了,pycharm的话你要配置启动参数(命令行参数)。你只说配置内容我也不知道你到底配了个啥,但是看起来你是配歪了。

@ihopenot
Copy link
Owner

你可以详细描述下你遇到的bug,另外这只是个解包工具,重打包可以用Live2dViewerEx自带的studio打包。

@KalaMeetsT1
Copy link
Author

Here is a fix without having to debug:

  1. go to directory of LpkUnpacker-master
  2. put your lpk and config.json in a new folder called "lpk"
  3. create a new folder called "new" which will contain all your unzipped files
  4. change your LpkUnpacker.py into:
    import sys
    import argparse
    from Core.lpk_loader import *
    from Core.utils import *
    loader = LpkLoader("./lpk/[Insert your lpk name here and delete bracket].lpk", "./lpk/config.json")
    loader.extract("./new")
  5. Use a text editor to open the config.json and copy it for use
  6. Go to Core\lpkloader.py and change the
    self.config = json.loads(open(self.configpath, "r", encoding="utf8").read())
    line into
    self.config = [replace with what you copied from step 5]
  7. Add a line
    self.config = {}
    at line 18 just to be safe that it knows self.config is supposed to be dictionary
  8. run LpkUnpacker.py and you should be able to get what you want in the folder.

P.S. the bug is very weird, at first I thought its just one simple directory issue (win error 123) but after fixing the class definition, traceback is telling me something is wrong with stuff I commented out which is rediculuous. That is why I have decided enough is enough and started stripping down LpkUnpacker.py

PPS. Great work! Would be even better if there were another script to zip stuff back but thanks a lot!!!

非常感谢!它成功运行了!

@KalaMeetsT1
Copy link
Author

你可以详细描述下你遇到的bug,另外这只是个解包工具,重打包可以用Live2dViewerEx自带的studio打包。

感谢作者!已经成功运行了!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants