|
|
|
|
@ -22,7 +22,7 @@ public class M3U8 { |
|
|
|
|
try { |
|
|
|
|
if (TextUtils.isEmpty(url)) return ""; |
|
|
|
|
Response response = OkHttp.newCall(url, getHeader(headers)).execute(); |
|
|
|
|
if (response.header(HttpHeaders.ACCEPT_RANGES) != null && !url.contains(".m3u8")) return ""; |
|
|
|
|
if (response.header(HttpHeaders.ACCEPT_RANGES) != null) return ""; |
|
|
|
|
String result = response.body().string(); |
|
|
|
|
Matcher matcher = Pattern.compile("#EXT-X-STREAM-INF(.*)\\n?(.*)").matcher(result.replaceAll("\r\n", "\n")); |
|
|
|
|
if (matcher.find() && matcher.groupCount() > 1) return get(UriUtil.resolve(url, matcher.group(2)), headers); |
|
|
|
|
|