From e04c89262a95db4a7aaab52d1b6987c1582be097 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=81=8D=E5=85=AE=E6=83=9A=E5=85=AE?= <101191390+HIllya51@users.noreply.github.com> Date: Sat, 3 Aug 2024 16:40:09 +0800 Subject: [PATCH] rm --- .../LunaTranslator/gui/dialog_savedgame.py | 14 +- .../LunaTranslator/metadata/fanza.py | 181 ------------------ .../LunaTranslator/myutils/config.py | 9 +- .../LunaTranslator/myutils/utils.py | 2 +- .../files/defaultconfig/config.json | 8 - 5 files changed, 14 insertions(+), 200 deletions(-) delete mode 100644 LunaTranslator/LunaTranslator/metadata/fanza.py diff --git a/LunaTranslator/LunaTranslator/gui/dialog_savedgame.py b/LunaTranslator/LunaTranslator/gui/dialog_savedgame.py index 1c3b89cd..9fc99f65 100644 --- a/LunaTranslator/LunaTranslator/gui/dialog_savedgame.py +++ b/LunaTranslator/LunaTranslator/gui/dialog_savedgame.py @@ -765,20 +765,24 @@ class dialog_setting_game_internal(QWidget): formLayout.addRow( "首选的", getsimplecombobox( - list(globalconfig["metadata"].keys()), + list(targetmod.keys()), globalconfig, "primitivtemetaorigin", - internallist=list(globalconfig["metadata"].keys()), + internallist=list(targetmod.keys()), static=True, ), ) formLayout.addRow(None, QLabel()) - for key in globalconfig["metadata"]: + for key in targetmod: try: - idname = globalconfig["metadata"][key]["target"] - vndbid = QLineEdit(str(savehook_new_data[gameuid][idname])) + idname = targetmod[key].idname + + vndbid = QLineEdit() if globalconfig["metadata"][key].get("idtype", 1) == 0: vndbid.setValidator(QIntValidator()) + vndbid.setText(str(savehook_new_data[gameuid].get(idname, "0"))) + else: + vndbid.setText(str(savehook_new_data[gameuid].get(idname, ""))) vndbid.setSizePolicy( QSizePolicy.Policy.Preferred, QSizePolicy.Policy.Fixed ) diff --git a/LunaTranslator/LunaTranslator/metadata/fanza.py b/LunaTranslator/LunaTranslator/metadata/fanza.py deleted file mode 100644 index 033df093..00000000 --- a/LunaTranslator/LunaTranslator/metadata/fanza.py +++ /dev/null @@ -1,181 +0,0 @@ -import requests, re -from myutils.utils import simplehtmlparser - - -from metadata.abstract import common - - -class searcher(common): - def getidbytitle(self, title): - cookies = { - "top_pv_uid": "764317a4-3d99-46be-8f5a-6e6762b6059d", - "top_dummy": "d1776405-0683-4936-824a-d48d2660ccd2", - "guest_id": "DRNHXB5TDV9XVA__", - "ckcy": "1", - "mbox": "check#true#1717923986|session#1717923925784-847103#1717925786", - "is_intarnal": "true", - "__utma": "125690133.86996065.1717923926.1717923926.1717923926.1", - "__utmb": "125690133.0.10.1717923926", - "__utmc": "125690133", - "__utmz": "125690133.1717923926.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none)", - "_gcl_au": "1.1.745157082.1717923927", - "rieSh3Ee_ga": "GA1.1.1543544133.1717923927", - "AMP_TOKEN": "%24NOT_FOUND", - "_dga": "GA1.3.86996065.1717923926", - "_dga_gid": "GA1.3.1715736403.1717923928", - "_dc_gtm_UA-48257133-2": "1", - "i3_ab": "93b99577-b74d-4fef-bba7-7ba426cf40ae", - "age_check_done": "1", - "dlsoft_check_item_history": "WyJuYXZlbF8wMDEzQDAiXQ%3D%3D", - "cklg": "ja", - "_yjsu_yjad": "1717923940.9d45754c-50f7-4219-8b50-e541815f4906", - "_dga": "GA1.4.86996065.1717923926", - "_dga_gid": "GA1.4.1715736403.1717923928", - "__rtbh.uid": "%7B%22eventType%22%3A%22uid%22%2C%22id%22%3A%22unknown%22%7D", - "rieSh3Ee_ga_KQYE0DE5JW": "GS1.1.1717923926.1.1.1717923942.0.0.405570256", - "cto_bundle": "yi6GA19QYzZmZHhXT0tWaFZZN2o4Y2NBb0lFSUFiWCUyQmJ3OWlTZ05VaWtEeXpoR201SnEyYnVIU3BqRENGeXJDN1VLUU5GOGxVRCUyRjVBa2dZUGFSc2kzSHNoa1FlUGx5Z2xoTElmTE5uc0l1WXpFclFGV1B0TiUyRldXT2ZaV0lXUEV5a2k4and0c2cxJTJGUDZCMWpNV0Q3bExiQktKZyUzRCUzRA", - "XSRF-TOKEN": "eyJpdiI6ImIyY21vbVJQZloxOUR3ZmJyaWhRdUE9PSIsInZhbHVlIjoiWTRaZ1VTOUw4UmFidnhvbWJkaU11SjZGRmljeWRiQ0cwODIybXI3T29VVmt2VXpub2dZdnBEUTFtN0pZa1BSeWZUQVhzOGR5UXlhVWxPUm1CN2Rwc3c9PSIsIm1hYyI6IjY5OTQ0ZjRmZjBhMGViZGRlN2VlMTQ2M2U3MDRiYjZlODllZWUyMDNlODg4YjQxOTA3ZmQyZDkzZWFhMjM0NmIiLCJ0YWciOiIifQ%3D%3D", - "laravel_session": "eyJpdiI6Ik41QzkzTkg1alBGVVVmeUdXOWpQWGc9PSIsInZhbHVlIjoia3lYNzVMOEZ3dm15SFNCb3RlYXNQTU9vZkZCeXBzK3BVOVF2dUY0d1c3QktQczVsU2ZRdTUxdkQ4VlBTcmdjdklQMHV3cFVsRVVcL3BCRGIybTNkVUhRPT0iLCJtYWMiOiJhYjkzMjNhZDg2OWI0ZjkyMTlmNzkzNTExOTlmZTBjNDU3NmJlZWUyYmM5ZTQ5NWI4MjAxZDdmNjZiZDA5NTJjIn0%3D", - "_dd_s": "logs=0&expire=1717924840754", - } - - headers = { - "Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7", - "Accept-Language": "zh-CN,zh;q=0.9,ar;q=0.8,sq;q=0.7,ru;q=0.6", - "Cache-Control": "max-age=0", - "Connection": "keep-alive", - "Referer": "https://www.dmm.co.jp/", - "Sec-Fetch-Dest": "document", - "Sec-Fetch-Mode": "navigate", - "Sec-Fetch-Site": "same-site", - "Sec-Fetch-User": "?1", - "Upgrade-Insecure-Requests": "1", - "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124.0.0.0 Safari/537.36", - "sec-ch-ua": '"Chromium";v="124", "Google Chrome";v="124", "Not-A.Brand";v="99"', - "sec-ch-ua-mobile": "?0", - "sec-ch-ua-platform": '"Windows"', - } - - response = self.proxysession.get( - f"https://dlsoft.dmm.co.jp/search/?floor=digital_pcgame&searchstr={title}&service=pcgame", - headers=headers, - cookies=cookies, - ) - _id = re.search( - "https://pics.dmm.co.jp/digital/pcgame/(.*?)/", response.text - ).groups()[0] - return _id - - def refmainpage(self, _id): - return f"https://dlsoft.dmm.co.jp/detail/{_id}/" - - def searchfordata(self, RJ): - cookies = { - "top_pv_uid": "764317a4-3d99-46be-8f5a-6e6762b6059d", - "top_dummy": "d1776405-0683-4936-824a-d48d2660ccd2", - "guest_id": "DRNHXB5TDV9XVA__", - "ckcy": "1", - "mbox": "check#true#1717923986|session#1717923925784-847103#1717925786", - "is_intarnal": "true", - "__utma": "125690133.86996065.1717923926.1717923926.1717923926.1", - "__utmb": "125690133.0.10.1717923926", - "__utmc": "125690133", - "__utmz": "125690133.1717923926.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none)", - "_gcl_au": "1.1.745157082.1717923927", - "rieSh3Ee_ga": "GA1.1.1543544133.1717923927", - "AMP_TOKEN": "%24NOT_FOUND", - "_dga": "GA1.3.86996065.1717923926", - "_dga_gid": "GA1.3.1715736403.1717923928", - "_dc_gtm_UA-48257133-2": "1", - "i3_ab": "93b99577-b74d-4fef-bba7-7ba426cf40ae", - "age_check_done": "1", - "dlsoft_check_item_history": "WyJuYXZlbF8wMDEzQDAiXQ%3D%3D", - "cklg": "ja", - "_yjsu_yjad": "1717923940.9d45754c-50f7-4219-8b50-e541815f4906", - "_dga": "GA1.4.86996065.1717923926", - "_dga_gid": "GA1.4.1715736403.1717923928", - "__rtbh.uid": "%7B%22eventType%22%3A%22uid%22%2C%22id%22%3A%22unknown%22%7D", - "rieSh3Ee_ga_KQYE0DE5JW": "GS1.1.1717923926.1.1.1717923942.0.0.405570256", - "cto_bundle": "yi6GA19QYzZmZHhXT0tWaFZZN2o4Y2NBb0lFSUFiWCUyQmJ3OWlTZ05VaWtEeXpoR201SnEyYnVIU3BqRENGeXJDN1VLUU5GOGxVRCUyRjVBa2dZUGFSc2kzSHNoa1FlUGx5Z2xoTElmTE5uc0l1WXpFclFGV1B0TiUyRldXT2ZaV0lXUEV5a2k4and0c2cxJTJGUDZCMWpNV0Q3bExiQktKZyUzRCUzRA", - "XSRF-TOKEN": "eyJpdiI6ImIyY21vbVJQZloxOUR3ZmJyaWhRdUE9PSIsInZhbHVlIjoiWTRaZ1VTOUw4UmFidnhvbWJkaU11SjZGRmljeWRiQ0cwODIybXI3T29VVmt2VXpub2dZdnBEUTFtN0pZa1BSeWZUQVhzOGR5UXlhVWxPUm1CN2Rwc3c9PSIsIm1hYyI6IjY5OTQ0ZjRmZjBhMGViZGRlN2VlMTQ2M2U3MDRiYjZlODllZWUyMDNlODg4YjQxOTA3ZmQyZDkzZWFhMjM0NmIiLCJ0YWciOiIifQ%3D%3D", - "laravel_session": "eyJpdiI6Ik41QzkzTkg1alBGVVVmeUdXOWpQWGc9PSIsInZhbHVlIjoia3lYNzVMOEZ3dm15SFNCb3RlYXNQTU9vZkZCeXBzK3BVOVF2dUY0d1c3QktQczVsU2ZRdTUxdkQ4VlBTcmdjdklQMHV3cFVsRVVcL3BCRGIybTNkVUhRPT0iLCJtYWMiOiJhYjkzMjNhZDg2OWI0ZjkyMTlmNzkzNTExOTlmZTBjNDU3NmJlZWUyYmM5ZTQ5NWI4MjAxZDdmNjZiZDA5NTJjIn0%3D", - "_dd_s": "logs=0&expire=1717924840754", - } - - headers = { - "Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7", - "Accept-Language": "zh-CN,zh;q=0.9,ar;q=0.8,sq;q=0.7,ru;q=0.6", - "Cache-Control": "max-age=0", - "Connection": "keep-alive", - "Referer": "https://www.dmm.co.jp/", - "Sec-Fetch-Dest": "document", - "Sec-Fetch-Mode": "navigate", - "Sec-Fetch-Site": "same-site", - "Sec-Fetch-User": "?1", - "Upgrade-Insecure-Requests": "1", - "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124.0.0.0 Safari/537.36", - "sec-ch-ua": '"Chromium";v="124", "Google Chrome";v="124", "Not-A.Brand";v="99"', - "sec-ch-ua-mobile": "?0", - "sec-ch-ua-platform": '"Windows"', - } - print(self.refmainpage(RJ)) - response = self.proxysession.get( - self.refmainpage(RJ), headers=headers, cookies=cookies - ) - - title = re.search( - '