virace / lol_extract_voice Goto Github PK
View Code? Open in Web Editor NEW提取英雄联盟语音文件
License: GNU General Public License v3.0
提取英雄联盟语音文件
License: GNU General Public License v3.0
Lines 264 to 280 in 613457e
一.运行环境:
os版本: win10 latest
python版本: Python 3.9.5
英雄联盟服务器及版本: CN, latest
python库版本:latest
二.debug过程(只想解决问题的可以不看):
1.按照README.md一步步弄好,最后python test.py
时,会报错:
D:\lol_extract_voice>python test.py
Traceback (most recent call last):
File "D:\lol_extract_voice\test.py", line 3, in <module>
main(r'C:\英雄联盟',
File "D:\lol_extract_voice\Utils\wrapper.py", line 24, in wrapper
ret = func(*args)
File "D:\lol_extract_voice\index.py", line 202, in main
update = check_game_version(game_path)
File "D:\lol_extract_voice\index.py", line 278, in check_game_version
with open(LOCAL_VERSION_FILE, 'w+', encoding='utf-8') as f:
FileNotFoundError: [Errno 2] No such file or directory: 'D:\\lol_extract_voice\\Temp\\game_version'
2.查看index.py的278行和上下代码及相关代码,发现LOCAL_VERSION_FILE引用自config.py文件,此文件很简单,查看源代码并打印相关变量可以得知LOCAL_VERSION_FILE的值为lol_extract_voice目录下的Temp文件夹下的game_version文件,查看lol_extract_voice目录发现Temp文件夹并不存在,因此报错代码使用open("w+")创建文件时会报错
三.解决方法:
第一种,最快,不需要改动源代码,但是希望作者可以尽快修复此bug:
在lol_extract_voice目录下创建Temp文件夹,然后正常使用即可
第二种,需要修改源代码:
思路:在创建game_version文件文件之前,判断上层目录Temp文件夹是否存在,不存在则创建
具体方法:
1.在config.py的12行之后添加以下代码:
TEMP_FOLDER = 'Temp'
将原config.py的13行
修改为以下代码:
TEMP_PATH = os.path.join(BASE_PATH, TEMP_FOLDER)
3.在index.py的24行添加导入TEMP_FOLDER和TEMP_PATH:
from config import LOCAL_VERSION_FILE, TEMP_FOLDER, TEMP_PATH
4.在index.py的269行之后添加以下代码
if not os.path.exists(TEMP_PATH):
os.makedirs(TEMP_FOLDER)
然后正常使用即可
四.建议:
把Temp文件夹放在其他文件夹里,或者把缓存文件放在其他文件夹里,或者把README.md里要创建的test.py文件改名为其他文件名,不然运行test.py时输入t再按tab会先出来Temp,多少有点麻烦
运行环境:
os版本: win10 latest
python版本: Python 3.9.5
英雄联盟服务器及版本: CN, latest
python库版本:latest
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.