From 46dca9db5a372517a41cf1a4a9a2e3e3119fc884 Mon Sep 17 00:00:00 2001 From: Klein <11241686+Klein422@user.noreply.gitee.com> Date: Wed, 30 Aug 2023 19:50:45 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=97=E9=B1=BC=E7=9B=B4=E6=92=AD=E8=8E=B7?= =?UTF-8?q?=E5=8F=96=E7=9B=B4=E6=92=AD=E6=BA=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../org/example/core/parser/impl/DouyuFlvUrlParser.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/LiveRecordModule/src/main/java/org/example/core/parser/impl/DouyuFlvUrlParser.java b/LiveRecordModule/src/main/java/org/example/core/parser/impl/DouyuFlvUrlParser.java index cb4d843..75b7d26 100644 --- a/LiveRecordModule/src/main/java/org/example/core/parser/impl/DouyuFlvUrlParser.java +++ b/LiveRecordModule/src/main/java/org/example/core/parser/impl/DouyuFlvUrlParser.java @@ -15,7 +15,6 @@ import java.time.LocalDate; public class DouyuFlvUrlParser implements PlatformVideoUrlParser { - String flvBaseUrl = "http://openflv-huos.douyucdn2.cn/dyliveflv1/"; String did = "818074ef9c05a3fe94acdfe500091601"; @Override @@ -63,12 +62,16 @@ public class DouyuFlvUrlParser implements PlatformVideoUrlParser { JSONObject dataObj = respObj.getJSONObject("data"); if(dataObj!=null){ String fileUrl = dataObj.getString("rtmp_live"); + System.out.println(fileUrl); + String flvBaseUrl = dataObj.getString("rtmp_url"); if(fileUrl!=null){ String name = fileUrl.substring(0,fileUrl.indexOf(".")); + String token = fileUrl.substring(fileUrl.indexOf(".")); + System.out.println(name); if(name.contains("_")){ - return String.format(flvBaseUrl+"%s_%s.xs",name.substring(0,name.indexOf("_")),clarity); + return String.format(flvBaseUrl+"/%s_%s%s",name.substring(0,name.indexOf("_")),clarity,token); } - return String.format(flvBaseUrl+"%s_%s.xs",name,clarity); + return String.format(flvBaseUrl+"/%s",fileUrl); } } }