From 304c8f12708a7aac8555228346c2871b41a664d1 Mon Sep 17 00:00:00 2001 From: nnn-revo2012 Date: Mon, 5 Aug 2024 20:12:08 +0900 Subject: [PATCH] =?UTF-8?q?=E3=83=8B=E3=82=B3=E5=8B=95=E8=A6=96=E8=81=B4?= =?UTF-8?q?=E3=83=9A=E3=83=BC=E3=82=B8=E3=83=AA=E3=83=8B=E3=83=A5=E3=83=BC?= =?UTF-8?q?=E3=82=A2=E3=83=AB(2024/08/05)=E5=AF=BE=E5=BF=9C=20-=20?= =?UTF-8?q?=E5=90=84=E7=A8=AE=E6=83=85=E5=A0=B1=E3=81=8C=20data-api-data?= =?UTF-8?q?=20=E3=81=8B=E3=82=89server-response=20=E3=81=AB=E7=A7=BB?= =?UTF-8?q?=E5=8B=95=E3=81=97=E3=81=9F=E3=81=AE=E3=81=A7=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/saccubus/MainFrame_AboutBox.java | 4 ++-- frontend/src/saccubus/net/NicoClient.java | 16 +++++++--------- 2 files changed, 9 insertions(+), 11 deletions(-) diff --git a/frontend/src/saccubus/MainFrame_AboutBox.java b/frontend/src/saccubus/MainFrame_AboutBox.java index 281a6b4..c057e3a 100644 --- a/frontend/src/saccubus/MainFrame_AboutBox.java +++ b/frontend/src/saccubus/MainFrame_AboutBox.java @@ -52,8 +52,8 @@ public class MainFrame_AboutBox extends JDialog implements ActionListener { // String version = "ver1.22r(2008/04/27)"; - public static final String rev = "1.70.0.18"; - private static final String modefied = " (2024/04/27)"; + public static final String rev = "1.70.0.19"; + private static final String modefied = " (2024/08/06)"; String productHTML = "" + diff --git a/frontend/src/saccubus/net/NicoClient.java b/frontend/src/saccubus/net/NicoClient.java index 20da5fb..8b9e4c2 100644 --- a/frontend/src/saccubus/net/NicoClient.java +++ b/frontend/src/saccubus/net/NicoClient.java @@ -3221,13 +3221,10 @@ private String getDataApiJson(){ */ private String getDataApiData(String text, String encoding, String comment){ // 動画ページのJSONを取り出す - text = getXmlElement1(text, "body"); //body - if(text==null) - return null; - text = getXmlAttribute(text, "data-api-data"); - //div id="js-initial-watch-data" data-api-data="{ + //text = getXmlAttribute(text, "data-api-data"); + text = getXmlAttribute(text, "server-response"); //2024.8.5 if(text==null){ - log.println("error: not found data-api-data"); + log.println("error: not found server-response"); return null; } int start = text.indexOf(JSON_START2); @@ -3239,7 +3236,7 @@ private String getDataApiData(String text, String encoding, String comment){ int end = (text+json_end).indexOf(json_end, start); // end of JSON text = (text+json_end).substring(start, end); if(text==null || text.isEmpty()){ - log.println("error: not found dataApi JSON2"); + log.println("error: not found server-response JSON2"); return null; } text = text.replace(""", S_QUOTE2); @@ -3460,8 +3457,9 @@ public String getXmlElement2(String input, String key){ return null; } - private String getXmlAttribute(String input, String atribname){ - Pattern p = Pattern.compile("<[^>]*"+atribname+"=\"([^\"]+)\"[^>]*>",Pattern.DOTALL); + private String getXmlAttribute(String input, String key){ + Pattern p = Pattern.compile("\""+key+"\" content=\"([^\"]+)\"",Pattern.DOTALL); + log.print(p.toString()); Matcher m = p.matcher(input); if(m.find()) return m.group(1);