From df296d71728e3105cd831d4ba6117636e04ad1e0 Mon Sep 17 00:00:00 2001 From: renato97 Date: Mon, 26 Jan 2026 21:53:56 +0100 Subject: [PATCH] Update: Use new domain streamtpcloud.com for events and streams - Updated EventRepository to point to streamtpcloud.com/eventos.json - Updated ChannelRepository URLs to streamtpcloud.com - Updated PlayerActivity Origin header - Bumped version to 10.0.2 --- app/build.gradle | 4 +- .../com/streamplayer/ChannelRepository.java | 132 +++++++++--------- .../com/streamplayer/EventRepository.java | 8 +- .../java/com/streamplayer/PlayerActivity.java | 2 +- eventos.json | 16 +++ update-manifest.json | 12 +- 6 files changed, 96 insertions(+), 78 deletions(-) create mode 100644 eventos.json diff --git a/app/build.gradle b/app/build.gradle index 033894b..b9a8695 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -8,8 +8,8 @@ android { applicationId "com.streamplayer" minSdk 21 targetSdk 33 - versionCode 100100 - versionName "10.0.1" + versionCode 100200 + versionName "10.0.2" buildConfigField "String", "DEVICE_REGISTRY_URL", '"http://194.163.191.200:4000"' } diff --git a/app/src/main/java/com/streamplayer/ChannelRepository.java b/app/src/main/java/com/streamplayer/ChannelRepository.java index 1a1cdf8..2387c71 100644 --- a/app/src/main/java/com/streamplayer/ChannelRepository.java +++ b/app/src/main/java/com/streamplayer/ChannelRepository.java @@ -12,72 +12,72 @@ public final class ChannelRepository { private static List createChannels() { List 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); diff --git a/app/src/main/java/com/streamplayer/EventRepository.java b/app/src/main/java/com/streamplayer/EventRepository.java index 45cdc7b..82d6fed 100644 --- a/app/src/main/java/com/streamplayer/EventRepository.java +++ b/app/src/main/java/com/streamplayer/EventRepository.java @@ -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 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) { diff --git a/app/src/main/java/com/streamplayer/PlayerActivity.java b/app/src/main/java/com/streamplayer/PlayerActivity.java index 88da3e0..e5743a8 100644 --- a/app/src/main/java/com/streamplayer/PlayerActivity.java +++ b/app/src/main/java/com/streamplayer/PlayerActivity.java @@ -177,7 +177,7 @@ public class PlayerActivity extends AppCompatActivity { private MediaSource buildMediaSource(MediaItem mediaItem) { Map 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"); diff --git a/eventos.json b/eventos.json new file mode 100644 index 0000000..ea9293a --- /dev/null +++ b/eventos.json @@ -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" + } +] \ No newline at end of file diff --git a/update-manifest.json b/update-manifest.json index caf868a..211588f 100644 --- a/update-manifest.json +++ b/update-manifest.json @@ -1,10 +1,10 @@ { - "versionCode": 100100, - "versionName": "10.0.1", + "versionCode": 100200, + "versionName": "10.0.2", "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.2/StreamPlayer-v10.0.2.apk", + "fileName": "StreamPlayer-v10.0.2.apk", + "sizeBytes": 0, + "notes": "StreamPlayer v10.0.2\n\nNovedades:\n- Eventos centralizados en servidor propio\n- Corrección de carga de eventos" } \ No newline at end of file