Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b6612c4544 | ||
|
|
df296d7172 |
@@ -8,8 +8,8 @@ android {
|
||||
applicationId "com.streamplayer"
|
||||
minSdk 21
|
||||
targetSdk 33
|
||||
versionCode 100100
|
||||
versionName "10.0.1"
|
||||
versionCode 100300
|
||||
versionName "10.0.3"
|
||||
buildConfigField "String", "DEVICE_REGISTRY_URL", '"http://194.163.191.200:4000"'
|
||||
}
|
||||
|
||||
|
||||
@@ -12,72 +12,72 @@ public final class ChannelRepository {
|
||||
|
||||
private static List<StreamChannel> createChannels() {
|
||||
List<StreamChannel> channels = new ArrayList<>(Arrays.asList(
|
||||
new StreamChannel("ESPN", "https://streamtpmedia.com/global2.php?stream=espn"),
|
||||
new StreamChannel("ESPN 2", "https://streamtpmedia.com/global2.php?stream=espn2"),
|
||||
new StreamChannel("ESPN 3", "https://streamtpmedia.com/global2.php?stream=espn3"),
|
||||
new StreamChannel("ESPN 4", "https://streamtpmedia.com/global2.php?stream=espn4"),
|
||||
new StreamChannel("ESPN 3 MX", "https://streamtpmedia.com/global2.php?stream=espn3mx"),
|
||||
new StreamChannel("ESPN 5", "https://streamtpmedia.com/global2.php?stream=espn5"),
|
||||
new StreamChannel("Fox Sports 3 MX", "https://streamtpmedia.com/global2.php?stream=foxsports3mx"),
|
||||
new StreamChannel("ESPN 6", "https://streamtpmedia.com/global2.php?stream=espn6"),
|
||||
new StreamChannel("Fox Sports MX", "https://streamtpmedia.com/global2.php?stream=foxsportsmx"),
|
||||
new StreamChannel("ESPN 7", "https://streamtpmedia.com/global2.php?stream=espn7"),
|
||||
new StreamChannel("Azteca Deportes", "https://streamtpmedia.com/global2.php?stream=azteca_deportes"),
|
||||
new StreamChannel("Win Plus", "https://streamtpmedia.com/global2.php?stream=winplus"),
|
||||
new StreamChannel("DAZN 1", "https://streamtpmedia.com/global2.php?stream=dazn1"),
|
||||
new StreamChannel("Win Plus 2", "https://streamtpmedia.com/global2.php?stream=winplus2"),
|
||||
new StreamChannel("DAZN 2", "https://streamtpmedia.com/global2.php?stream=dazn2"),
|
||||
new StreamChannel("Win Sports", "https://streamtpmedia.com/global2.php?stream=winsports"),
|
||||
new StreamChannel("DAZN LaLiga", "https://streamtpmedia.com/global2.php?stream=dazn_laliga"),
|
||||
new StreamChannel("Win Plus Online 1", "https://streamtpmedia.com/global2.php?stream=winplusonline1"),
|
||||
new StreamChannel("Caracol TV", "https://streamtpmedia.com/global2.php?stream=caracoltv"),
|
||||
new StreamChannel("Fox 1 AR", "https://streamtpmedia.com/global2.php?stream=fox1ar"),
|
||||
new StreamChannel("Fox 2 USA", "https://streamtpmedia.com/global2.php?stream=fox_2_usa"),
|
||||
new StreamChannel("Fox 2 AR", "https://streamtpmedia.com/global2.php?stream=fox2ar"),
|
||||
new StreamChannel("TNT 1 GB", "https://streamtpmedia.com/global2.php?stream=tnt_1_gb"),
|
||||
new StreamChannel("TNT 2 GB", "https://streamtpmedia.com/global2.php?stream=tnt_2_gb"),
|
||||
new StreamChannel("Fox 3 AR", "https://streamtpmedia.com/global2.php?stream=fox3ar"),
|
||||
new StreamChannel("Universo USA", "https://streamtpmedia.com/global2.php?stream=universo_usa"),
|
||||
new StreamChannel("DSports", "https://streamtpmedia.com/global2.php?stream=dsports"),
|
||||
new StreamChannel("Univision USA", "https://streamtpmedia.com/global2.php?stream=univision_usa"),
|
||||
new StreamChannel("DSports 2", "https://streamtpmedia.com/global2.php?stream=dsports2"),
|
||||
new StreamChannel("Fox Deportes USA", "https://streamtpmedia.com/global2.php?stream=fox_deportes_usa"),
|
||||
new StreamChannel("DSports Plus", "https://streamtpmedia.com/global2.php?stream=dsportsplus"),
|
||||
new StreamChannel("Fox Sports 2 MX", "https://streamtpmedia.com/global2.php?stream=foxsports2mx"),
|
||||
new StreamChannel("TNT Sports Chile", "https://streamtpmedia.com/global2.php?stream=tntsportschile"),
|
||||
new StreamChannel("Fox Sports Premium", "https://streamtpmedia.com/global2.php?stream=foxsportspremium"),
|
||||
new StreamChannel("TNT Sports", "https://streamtpmedia.com/global2.php?stream=tntsports"),
|
||||
new StreamChannel("ESPN MX", "https://streamtpmedia.com/global2.php?stream=espnmx"),
|
||||
new StreamChannel("ESPN Premium", "https://streamtpmedia.com/global2.php?stream=espnpremium"),
|
||||
new StreamChannel("ESPN 2 MX", "https://streamtpmedia.com/global2.php?stream=espn2mx"),
|
||||
new StreamChannel("TyC Sports", "https://streamtpmedia.com/global2.php?stream=tycsports"),
|
||||
new StreamChannel("TUDN USA", "https://streamtpmedia.com/global2.php?stream=tudn_usa"),
|
||||
new StreamChannel("Telefe", "https://streamtpmedia.com/global2.php?stream=telefe"),
|
||||
new StreamChannel("TNT 3 GB", "https://streamtpmedia.com/global2.php?stream=tnt_3_gb"),
|
||||
new StreamChannel("TV Pública", "https://streamtpmedia.com/global2.php?stream=tv_publica"),
|
||||
new StreamChannel("Fox 1 USA", "https://streamtpmedia.com/global2.php?stream=fox_1_usa"),
|
||||
new StreamChannel("Liga 1 Max", "https://streamtpmedia.com/global2.php?stream=liga1max"),
|
||||
new StreamChannel("Gol TV", "https://streamtpmedia.com/global2.php?stream=goltv"),
|
||||
new StreamChannel("VTV Plus", "https://streamtpmedia.com/global2.php?stream=vtvplus"),
|
||||
new StreamChannel("ESPN Deportes", "https://streamtpmedia.com/global2.php?stream=espndeportes"),
|
||||
new StreamChannel("Gol Perú", "https://streamtpmedia.com/global2.php?stream=golperu"),
|
||||
new StreamChannel("TNT 4 GB", "https://streamtpmedia.com/global2.php?stream=tnt_4_gb"),
|
||||
new StreamChannel("SportTV BR 1", "https://streamtpmedia.com/global2.php?stream=sporttvbr1"),
|
||||
new StreamChannel("SportTV BR 2", "https://streamtpmedia.com/global2.php?stream=sporttvbr2"),
|
||||
new StreamChannel("SportTV BR 3", "https://streamtpmedia.com/global2.php?stream=sporttvbr3"),
|
||||
new StreamChannel("Premiere 1", "https://streamtpmedia.com/global2.php?stream=premiere1"),
|
||||
new StreamChannel("Premiere 2", "https://streamtpmedia.com/global2.php?stream=premiere2"),
|
||||
new StreamChannel("Premiere 3", "https://streamtpmedia.com/global2.php?stream=premiere3"),
|
||||
new StreamChannel("ESPN NL 1", "https://streamtpmedia.com/global2.php?stream=espn_nl1"),
|
||||
new StreamChannel("ESPN NL 2", "https://streamtpmedia.com/global2.php?stream=espn_nl2"),
|
||||
new StreamChannel("ESPN NL 3", "https://streamtpmedia.com/global2.php?stream=espn_nl3"),
|
||||
new StreamChannel("Caliente TV MX", "https://streamtpmedia.com/global2.php?stream=calientetvmx"),
|
||||
new StreamChannel("USA Network", "https://streamtpmedia.com/global2.php?stream=usa_network"),
|
||||
new StreamChannel("TyC Internacional", "https://streamtpmedia.com/global2.php?stream=tycinternacional"),
|
||||
new StreamChannel("Canal 5 MX", "https://streamtpmedia.com/global2.php?stream=canal5mx"),
|
||||
new StreamChannel("TUDN MX", "https://streamtpmedia.com/global2.php?stream=TUDNMX"),
|
||||
new StreamChannel("FUTV", "https://streamtpmedia.com/global2.php?stream=futv"),
|
||||
new StreamChannel("LaLiga Hypermotion", "https://streamtpmedia.com/global2.php?stream=laligahypermotion")
|
||||
new StreamChannel("ESPN", "https://streamtpcloud.com/global2.php?stream=espn"),
|
||||
new StreamChannel("ESPN 2", "https://streamtpcloud.com/global2.php?stream=espn2"),
|
||||
new StreamChannel("ESPN 3", "https://streamtpcloud.com/global2.php?stream=espn3"),
|
||||
new StreamChannel("ESPN 4", "https://streamtpcloud.com/global2.php?stream=espn4"),
|
||||
new StreamChannel("ESPN 3 MX", "https://streamtpcloud.com/global2.php?stream=espn3mx"),
|
||||
new StreamChannel("ESPN 5", "https://streamtpcloud.com/global2.php?stream=espn5"),
|
||||
new StreamChannel("Fox Sports 3 MX", "https://streamtpcloud.com/global2.php?stream=foxsports3mx"),
|
||||
new StreamChannel("ESPN 6", "https://streamtpcloud.com/global2.php?stream=espn6"),
|
||||
new StreamChannel("Fox Sports MX", "https://streamtpcloud.com/global2.php?stream=foxsportsmx"),
|
||||
new StreamChannel("ESPN 7", "https://streamtpcloud.com/global2.php?stream=espn7"),
|
||||
new StreamChannel("Azteca Deportes", "https://streamtpcloud.com/global2.php?stream=azteca_deportes"),
|
||||
new StreamChannel("Win Plus", "https://streamtpcloud.com/global2.php?stream=winplus"),
|
||||
new StreamChannel("DAZN 1", "https://streamtpcloud.com/global2.php?stream=dazn1"),
|
||||
new StreamChannel("Win Plus 2", "https://streamtpcloud.com/global2.php?stream=winplus2"),
|
||||
new StreamChannel("DAZN 2", "https://streamtpcloud.com/global2.php?stream=dazn2"),
|
||||
new StreamChannel("Win Sports", "https://streamtpcloud.com/global2.php?stream=winsports"),
|
||||
new StreamChannel("DAZN LaLiga", "https://streamtpcloud.com/global2.php?stream=dazn_laliga"),
|
||||
new StreamChannel("Win Plus Online 1", "https://streamtpcloud.com/global2.php?stream=winplusonline1"),
|
||||
new StreamChannel("Caracol TV", "https://streamtpcloud.com/global2.php?stream=caracoltv"),
|
||||
new StreamChannel("Fox 1 AR", "https://streamtpcloud.com/global2.php?stream=fox1ar"),
|
||||
new StreamChannel("Fox 2 USA", "https://streamtpcloud.com/global2.php?stream=fox_2_usa"),
|
||||
new StreamChannel("Fox 2 AR", "https://streamtpcloud.com/global2.php?stream=fox2ar"),
|
||||
new StreamChannel("TNT 1 GB", "https://streamtpcloud.com/global2.php?stream=tnt_1_gb"),
|
||||
new StreamChannel("TNT 2 GB", "https://streamtpcloud.com/global2.php?stream=tnt_2_gb"),
|
||||
new StreamChannel("Fox 3 AR", "https://streamtpcloud.com/global2.php?stream=fox3ar"),
|
||||
new StreamChannel("Universo USA", "https://streamtpcloud.com/global2.php?stream=universo_usa"),
|
||||
new StreamChannel("DSports", "https://streamtpcloud.com/global2.php?stream=dsports"),
|
||||
new StreamChannel("Univision USA", "https://streamtpcloud.com/global2.php?stream=univision_usa"),
|
||||
new StreamChannel("DSports 2", "https://streamtpcloud.com/global2.php?stream=dsports2"),
|
||||
new StreamChannel("Fox Deportes USA", "https://streamtpcloud.com/global2.php?stream=fox_deportes_usa"),
|
||||
new StreamChannel("DSports Plus", "https://streamtpcloud.com/global2.php?stream=dsportsplus"),
|
||||
new StreamChannel("Fox Sports 2 MX", "https://streamtpcloud.com/global2.php?stream=foxsports2mx"),
|
||||
new StreamChannel("TNT Sports Chile", "https://streamtpcloud.com/global2.php?stream=tntsportschile"),
|
||||
new StreamChannel("Fox Sports Premium", "https://streamtpcloud.com/global2.php?stream=foxsportspremium"),
|
||||
new StreamChannel("TNT Sports", "https://streamtpcloud.com/global2.php?stream=tntsports"),
|
||||
new StreamChannel("ESPN MX", "https://streamtpcloud.com/global2.php?stream=espnmx"),
|
||||
new StreamChannel("ESPN Premium", "https://streamtpcloud.com/global2.php?stream=espnpremium"),
|
||||
new StreamChannel("ESPN 2 MX", "https://streamtpcloud.com/global2.php?stream=espn2mx"),
|
||||
new StreamChannel("TyC Sports", "https://streamtpcloud.com/global2.php?stream=tycsports"),
|
||||
new StreamChannel("TUDN USA", "https://streamtpcloud.com/global2.php?stream=tudn_usa"),
|
||||
new StreamChannel("Telefe", "https://streamtpcloud.com/global2.php?stream=telefe"),
|
||||
new StreamChannel("TNT 3 GB", "https://streamtpcloud.com/global2.php?stream=tnt_3_gb"),
|
||||
new StreamChannel("TV Pública", "https://streamtpcloud.com/global2.php?stream=tv_publica"),
|
||||
new StreamChannel("Fox 1 USA", "https://streamtpcloud.com/global2.php?stream=fox_1_usa"),
|
||||
new StreamChannel("Liga 1 Max", "https://streamtpcloud.com/global2.php?stream=liga1max"),
|
||||
new StreamChannel("Gol TV", "https://streamtpcloud.com/global2.php?stream=goltv"),
|
||||
new StreamChannel("VTV Plus", "https://streamtpcloud.com/global2.php?stream=vtvplus"),
|
||||
new StreamChannel("ESPN Deportes", "https://streamtpcloud.com/global2.php?stream=espndeportes"),
|
||||
new StreamChannel("Gol Perú", "https://streamtpcloud.com/global2.php?stream=golperu"),
|
||||
new StreamChannel("TNT 4 GB", "https://streamtpcloud.com/global2.php?stream=tnt_4_gb"),
|
||||
new StreamChannel("SportTV BR 1", "https://streamtpcloud.com/global2.php?stream=sporttvbr1"),
|
||||
new StreamChannel("SportTV BR 2", "https://streamtpcloud.com/global2.php?stream=sporttvbr2"),
|
||||
new StreamChannel("SportTV BR 3", "https://streamtpcloud.com/global2.php?stream=sporttvbr3"),
|
||||
new StreamChannel("Premiere 1", "https://streamtpcloud.com/global2.php?stream=premiere1"),
|
||||
new StreamChannel("Premiere 2", "https://streamtpcloud.com/global2.php?stream=premiere2"),
|
||||
new StreamChannel("Premiere 3", "https://streamtpcloud.com/global2.php?stream=premiere3"),
|
||||
new StreamChannel("ESPN NL 1", "https://streamtpcloud.com/global2.php?stream=espn_nl1"),
|
||||
new StreamChannel("ESPN NL 2", "https://streamtpcloud.com/global2.php?stream=espn_nl2"),
|
||||
new StreamChannel("ESPN NL 3", "https://streamtpcloud.com/global2.php?stream=espn_nl3"),
|
||||
new StreamChannel("Caliente TV MX", "https://streamtpcloud.com/global2.php?stream=calientetvmx"),
|
||||
new StreamChannel("USA Network", "https://streamtpcloud.com/global2.php?stream=usa_network"),
|
||||
new StreamChannel("TyC Internacional", "https://streamtpcloud.com/global2.php?stream=tycinternacional"),
|
||||
new StreamChannel("Canal 5 MX", "https://streamtpcloud.com/global2.php?stream=canal5mx"),
|
||||
new StreamChannel("TUDN MX", "https://streamtpcloud.com/global2.php?stream=TUDNMX"),
|
||||
new StreamChannel("FUTV", "https://streamtpcloud.com/global2.php?stream=futv"),
|
||||
new StreamChannel("LaLiga Hypermotion", "https://streamtpcloud.com/global2.php?stream=laligahypermotion")
|
||||
));
|
||||
channels.sort(Comparator.comparing(StreamChannel::getName, String.CASE_INSENSITIVE_ORDER));
|
||||
return Collections.unmodifiableList(channels);
|
||||
|
||||
@@ -30,7 +30,7 @@ public class EventRepository {
|
||||
private static final String KEY_JSON = "json";
|
||||
private static final String KEY_TIMESTAMP = "timestamp";
|
||||
private static final long CACHE_DURATION = 24L * 60 * 60 * 1000; // 24 horas
|
||||
private static final String EVENTS_URL = "https://streamtpmedia.com/eventos.json";
|
||||
private static final String EVENTS_URL = "https://streamtpcloud.com/eventos.json";
|
||||
|
||||
public interface Callback {
|
||||
void onSuccess(List<EventItem> events);
|
||||
@@ -89,7 +89,8 @@ public class EventRepository {
|
||||
}
|
||||
|
||||
String contentType = connection.getContentType();
|
||||
if (contentType != null && !contentType.contains("json")) {
|
||||
// Permitir json o text/plain (Raw de Gitea a veces es text/plain)
|
||||
if (contentType != null && !contentType.contains("json") && !contentType.contains("text/plain")) {
|
||||
throw new IOException("El servidor devolvió " + contentType + " en lugar de JSON. Verifica que la URL sea correcta.");
|
||||
}
|
||||
|
||||
@@ -144,7 +145,8 @@ public class EventRepository {
|
||||
if (link == null) {
|
||||
return "";
|
||||
}
|
||||
return link.replace("global1.php", "global2.php");
|
||||
String updated = link.replace("streamtpmedia.com", "streamtpcloud.com");
|
||||
return updated.replace("global1.php", "global2.php");
|
||||
}
|
||||
|
||||
private String extractChannelName(String link) {
|
||||
|
||||
@@ -177,7 +177,7 @@ public class PlayerActivity extends AppCompatActivity {
|
||||
private MediaSource buildMediaSource(MediaItem mediaItem) {
|
||||
Map<String, String> headers = new HashMap<>();
|
||||
headers.put("Referer", channelUrl);
|
||||
headers.put("Origin", "https://streamtpmedia.com");
|
||||
headers.put("Origin", "https://streamtpcloud.com");
|
||||
headers.put("Accept", "*/*");
|
||||
headers.put("Connection", "keep-alive");
|
||||
|
||||
@@ -203,10 +203,10 @@ public class PlayerActivity extends AppCompatActivity {
|
||||
|
||||
DnsOverHttps dohDns = new DnsOverHttps.Builder()
|
||||
.client(bootstrap)
|
||||
.url(HttpUrl.get("https://dns.adguard-dns.com/dns-query"))
|
||||
.url(HttpUrl.get("https://dns.google/dns-query"))
|
||||
.bootstrapDnsHosts(
|
||||
InetAddress.getByName("94.140.14.14"),
|
||||
InetAddress.getByName("94.140.15.15"))
|
||||
InetAddress.getByName("8.8.8.8"),
|
||||
InetAddress.getByName("8.8.4.4"))
|
||||
.build();
|
||||
|
||||
okHttpClient = bootstrap.newBuilder()
|
||||
|
||||
@@ -1,22 +1,29 @@
|
||||
package com.streamplayer;
|
||||
|
||||
import android.util.Base64;
|
||||
import android.util.Log;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStreamReader;
|
||||
import java.net.HttpURLConnection;
|
||||
import java.net.URL;
|
||||
import java.net.InetAddress;
|
||||
import java.net.UnknownHostException;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.Comparator;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
import okhttp3.HttpUrl;
|
||||
import okhttp3.OkHttpClient;
|
||||
import okhttp3.Request;
|
||||
import okhttp3.Response;
|
||||
import okhttp3.dnsoverhttps.DnsOverHttps;
|
||||
|
||||
/**
|
||||
* Resuelve la URL real del stream analizando el JavaScript ofuscado de streamtpmedia.
|
||||
* Resuelve la URL real del stream analizando el JavaScript ofuscado de streamtpcloud.
|
||||
* Utiliza DNS de Google para evitar bloqueos.
|
||||
*/
|
||||
public final class StreamUrlResolver {
|
||||
|
||||
@@ -27,6 +34,32 @@ public final class StreamUrlResolver {
|
||||
private static final String FUNCTION_TEMPLATE = "function\\s+%s\\(\\)\\s*\\{\\s*return\\s+(\\d+);\\s*\\}";
|
||||
private static final String USER_AGENT = "Mozilla/5.0 (Linux; Android 13) ExoPlayerResolver/1.0";
|
||||
|
||||
private static final OkHttpClient CLIENT;
|
||||
|
||||
static {
|
||||
OkHttpClient.Builder builder = new OkHttpClient.Builder()
|
||||
.connectTimeout(15, TimeUnit.SECONDS)
|
||||
.readTimeout(15, TimeUnit.SECONDS)
|
||||
.followRedirects(true);
|
||||
|
||||
try {
|
||||
// DNS de Google (8.8.8.8)
|
||||
OkHttpClient bootstrap = new OkHttpClient.Builder().build();
|
||||
DnsOverHttps dns = new DnsOverHttps.Builder()
|
||||
.client(bootstrap)
|
||||
.url(HttpUrl.get("https://dns.google/dns-query"))
|
||||
.bootstrapDnsHosts(
|
||||
InetAddress.getByName("8.8.8.8"),
|
||||
InetAddress.getByName("8.8.4.4"))
|
||||
.build();
|
||||
builder.dns(dns);
|
||||
} catch (UnknownHostException e) {
|
||||
// Fallback a DNS del sistema si falla la inicialización (raro con IPs hardcoded)
|
||||
}
|
||||
|
||||
CLIENT = builder.build();
|
||||
}
|
||||
|
||||
private StreamUrlResolver() {
|
||||
}
|
||||
|
||||
@@ -56,46 +89,37 @@ public final class StreamUrlResolver {
|
||||
}
|
||||
|
||||
private static String downloadPage(String pageUrl) throws IOException {
|
||||
HttpURLConnection connection = (HttpURLConnection) new URL(pageUrl).openConnection();
|
||||
connection.setConnectTimeout(15000);
|
||||
connection.setReadTimeout(15000);
|
||||
connection.setRequestProperty("User-Agent", USER_AGENT);
|
||||
connection.setRequestProperty("Accept", "text/html,application/xhtml+xml");
|
||||
Request request = new Request.Builder()
|
||||
.url(pageUrl)
|
||||
.header("User-Agent", USER_AGENT)
|
||||
.header("Accept", "text/html,application/xhtml+xml")
|
||||
.build();
|
||||
|
||||
try {
|
||||
int responseCode = connection.getResponseCode();
|
||||
if (responseCode != HttpURLConnection.HTTP_OK) {
|
||||
throw new IOException("Error HTTP " + responseCode + " al cargar la página del stream");
|
||||
try (Response response = CLIENT.newCall(request).execute()) {
|
||||
if (!response.isSuccessful()) {
|
||||
throw new IOException("Error HTTP " + response.code() + " al cargar la página del stream");
|
||||
}
|
||||
if (response.body() == null) {
|
||||
throw new IOException("Respuesta vacía del servidor");
|
||||
}
|
||||
|
||||
String contentType = connection.getContentType();
|
||||
// Validar que sea contenido web (HTML)
|
||||
// Validar Content-Type
|
||||
String contentType = response.header("Content-Type");
|
||||
if (contentType != null && !contentType.contains("html") && !contentType.contains("text")) {
|
||||
// A veces puede venir sin content type o application/octet-stream,
|
||||
// pero si es explícitamente una imagen o algo así, abortamos.
|
||||
if (contentType.startsWith("image/") || contentType.startsWith("video/") || contentType.startsWith("audio/")) {
|
||||
throw new IOException("El servidor devolvió " + contentType + " en lugar de HTML");
|
||||
}
|
||||
}
|
||||
|
||||
try (BufferedReader reader = new BufferedReader(
|
||||
new InputStreamReader(connection.getInputStream(), StandardCharsets.UTF_8))) {
|
||||
StringBuilder builder = new StringBuilder();
|
||||
String line;
|
||||
while ((line = reader.readLine()) != null) {
|
||||
builder.append(line);
|
||||
}
|
||||
return builder.toString();
|
||||
}
|
||||
} finally {
|
||||
connection.disconnect();
|
||||
return response.body().string();
|
||||
}
|
||||
}
|
||||
|
||||
private static long extractKeyOffset(String html) throws IOException {
|
||||
Matcher matcher = KEY_FUNCTIONS_PATTERN.matcher(html);
|
||||
if (!matcher.find()) {
|
||||
throw new IOException("No se encontró la clave del stream");
|
||||
// Logging para debug si es necesario, pero lanzamos excepción limpia
|
||||
throw new IOException("No se encontró la clave del stream (posible bloqueo o cambio en la página)");
|
||||
}
|
||||
String first = matcher.group(1);
|
||||
String second = matcher.group(2);
|
||||
|
||||
16
eventos.json
Normal file
16
eventos.json
Normal file
@@ -0,0 +1,16 @@
|
||||
[
|
||||
{
|
||||
"title": "Partido de Prueba",
|
||||
"time": "22:00",
|
||||
"category": "Fútbol",
|
||||
"status": "EN VIVO",
|
||||
"link": "https://streamtpmedia.com/global2.php?stream=espn"
|
||||
},
|
||||
{
|
||||
"title": "Canal Deportivo",
|
||||
"time": "15:30",
|
||||
"category": "Deportes",
|
||||
"status": "PRÓXIMO",
|
||||
"link": "https://streamtpmedia.com/global2.php?stream=foxsports"
|
||||
}
|
||||
]
|
||||
@@ -1,10 +1,10 @@
|
||||
{
|
||||
"versionCode": 100100,
|
||||
"versionName": "10.0.1",
|
||||
"versionCode": 100300,
|
||||
"versionName": "10.0.3",
|
||||
"minSupportedVersionCode": 91000,
|
||||
"forceUpdate": false,
|
||||
"downloadUrl": "https://gitea.cbcren.online/attachments/83b72799-b731-4a48-ad04-67b75eaa78a7",
|
||||
"fileName": "StreamPlayer-v10.0.1.apk",
|
||||
"sizeBytes": 16674,
|
||||
"notes": "StreamPlayer v10.0.1\n\nCorrecciones de errores:\n- Fix: Crash on HTML response in EventRepository\n- Fix: HTML validation in UpdateManager/DeviceRegistry\n- Fix: HTTP error handling in StreamUrlResolver\n\nVersión anterior v10.0:\n- Nueva versión mayor\n- Sistema de actualizaciones automáticas activado"
|
||||
"downloadUrl": "https://gitea.cbcren.online/renato97/app/releases/download/v10.0.3/StreamPlayer-v10.0.3.apk",
|
||||
"fileName": "StreamPlayer-v10.0.3.apk",
|
||||
"sizeBytes": 0,
|
||||
"notes": "StreamPlayer v10.0.3\n\nNovedades:\n- Fix: Evasión de bloqueos regionales mediante DNS de Google (DoH)\n- Corrección de error 'No se encontró la clave del stream'"
|
||||
}
|
||||
Reference in New Issue
Block a user