Update .gitignore, StoreXLS.py, and 4 more files...

This commit is contained in:
2024-10-31 16:08:01 +09:00
parent 401627a58f
commit 8f64bb2fc1
6 changed files with 303 additions and 12 deletions

66
main.py
View File

@@ -5,7 +5,15 @@ import MgrCalibreLibs as mgrCal
import UtilPack as util
import StoreXLS as xls
def main():
import os
import sys
def main(argc, argv):
if argc != 2:
printUsage()
return
trgPath = argv[1]
#getHitomi.GetSearchResult("2890685")
#etEhentai.GetSearchResult("artist%3A%22kotomi+yo-ji%24%22")
@@ -15,18 +23,56 @@ def main():
#artist:"kotomi yo-ji$"
#"artist%3A%22kotomi+yo-ji%24%22"
tempxls = xls.DBXLStorage("./temp.xls")
tempxls.DBXLSOpen()
tempxls.AddArtistInfo("Kuno Inu", "/artist/kunoinu/")
tempxls.AddSeriesInfo("Original", "/serires/original/")
tempxls.AddTagInfo("female:bondage", "/tag/bondage/")
tempxls.AddTagInfo("female:slave", "/tag/slave/")
tempxls.DBXLSClose()
#tempxls = xls.DBXLStorage("./temp.xls")
#tempxls.DBXLSOpen()
#tempxls.AddArtistInfo("Kuno Inu", "/artist/kunoinu/")
#tempxls.AddSeriesInfo("Original", "/serires/original/")
#tempxls.AddTagInfo("female:bondage", "/tag/bondage/")
#tempxls.AddTagInfo("female:slave", "/tag/slave/")
#tempxls.DBXLSClose()
if False == os.path.exists(trgPath):
printUsage()
return
listPaths = util.ListSubDirectories(trgPath)
util.DbgOut(f"Folder Cnt : {len(listPaths)}")
PupilDB_EXT = ".data"
PupilImg_EXT = ".img"
CalbCvr = "cover"
CalbCvr_EXT = ".jpg"
nIdx = 0
# 각 pupil 만화책 폴더 -> path
for path in listPaths:
# 퍼필에서 저장한 만화책 폴더의 절대경로를 구한다
# 퍼필 만화책 정보 파일을 파싱
# - 만약 만화책 파일이 하나도 없거나 정보 파일과 다르다면..
# - - 정보 파일만 적당히 백업하고 다음으로 넘어간다
#
# 캘리버 정보 파일로 저장한다
# 퍼필에서 생성한 표지 파일을 찾는다.
# webp 인지 확인해서 jpg 로 변환하여 저장, JPG 라면 이름만 바꾼다
# 만약 없다면 1번 파일을 적당히 줄여서 표지 파일을 생성
# 이미지 파일 리스트를 생성
# 압축한다
# 압축파일, 캘리버 정보 파일, 표지 파일이 다 있는지 확인하고 메시지 출력
# 하나라도 없으면 에러 리스트에 저장
nIdx += 1
def printUsage():
print("Usage : python main.py <DataFilesFolderPath>")
# For Main Loop
if __name__ == '__main__':
main()
argc = len(sys.argv)
argv = sys.argv
main(argc, argv)