Add Donwload Mapping Table function

This commit is contained in:
yoshiko2
2021-11-05 00:49:19 +08:00
parent a5e8687639
commit 50c3975b75
2 changed files with 72 additions and 0 deletions

View File

@@ -9,6 +9,7 @@ import urllib3
import signal
from opencc import OpenCC
import ADC_function
import config
from datetime import datetime, timedelta
import time
@@ -472,6 +473,19 @@ def main():
if conf.update_check():
check_update(version)
# Download Mapping Table
if not os.path.exists(str(Path.home() / logdir / 'mapping_actor.xml')):
ADC_function.download_file_with_filename(
"https://raw.githubusercontent.com/yoshiko2/AV_Data_Capture/master/MappingTable/mapping_actor.xml",
"mapping_actor.xml", str(Path.home() / logdir))
print("[+] [1/2] Mapping Table Downloaded")
if not os.path.exists(str(Path.home() / logdir / 'mapping_info.xml')):
ADC_function.download_file_with_filename(
"https://raw.githubusercontent.com/yoshiko2/AV_Data_Capture/master/MappingTable/mapping_info.xml",
"mapping_info.xml", str(Path.home() / logdir))
print("[+] [2/2] Mapping Table Downloaded")
print(f"[+]Load Config file '{conf.ini_path}'.")
if conf.debug():
print('[+]Enable debug')