File tree Expand file tree Collapse file tree 2 files changed +29
-1
lines changed
Expand file tree Collapse file tree 2 files changed +29
-1
lines changed Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ import (
1212)
1313
1414func FindTagValue (b []byte , tag string ) string {
15- re := regexp .MustCompile (`(?s)[:<] ` + tag + `>([^<]+)` )
15+ re := regexp .MustCompile (`(?s)<(?:\w+:)? ` + tag + `\b[^>]* >([^<]+)` )
1616 m := re .FindSubmatch (b )
1717 if len (m ) != 2 {
1818 return ""
Original file line number Diff line number Diff line change @@ -84,6 +84,34 @@ func TestGetStreamUri(t *testing.T) {
8484</SOAP-ENV:Envelope>` ,
8585 url : "rtsp://192.168.5.53:8090/profile1=r" ,
8686 },
87+ {
88+ name : "go2rtc 1.9.4" ,
89+ xml : `<?xml version="1.0" encoding="utf-8"?><s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope">
90+ <s:Body>
91+ <trt:GetStreamUriResponse xmlns:trt="http://www.onvif.org/ver10/media/wsdl">
92+ <trt:MediaUri>
93+ <tt:Uri xmlns:tt="http://www.onvif.org/ver10/schema">rtsp://192.168.1.123:8554/rtsp-dahua1</tt:Uri>
94+ </trt:MediaUri>
95+ </trt:GetStreamUriResponse>
96+ </s:Body>
97+ </s:Envelope>` ,
98+ url : "rtsp://192.168.1.123:8554/rtsp-dahua1" ,
99+ },
100+ {
101+ name : "go2rtc 1.9.8" ,
102+ xml : `<?xml version="1.0" encoding="utf-8" standalone="no"?>
103+ <s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope" xmlns:tds="http://www.onvif.org/ver10/device/wsdl" xmlns:trt="http://www.onvif.org/ver10/media/wsdl" xmlns:tt="http://www.onvif.org/ver10/schema">
104+ <s:Body>
105+ <trt:GetStreamUriResponse>
106+ <trt:MediaUri>
107+ <tt:Uri>rtsp://192.168.1.123:8554/rtsp-dahua2</tt:Uri>
108+ </trt:MediaUri>
109+ </trt:GetStreamUriResponse>
110+ </s:Body>
111+ </s:Envelope>
112+ ` ,
113+ url : "rtsp://192.168.1.123:8554/rtsp-dahua2" ,
114+ },
87115 }
88116
89117 for _ , test := range tests {
You can’t perform that action at this time.
0 commit comments