From 0eb8d6308988c8e1a96eaaf612d6eff87cdfb9c6 Mon Sep 17 00:00:00 2001 From: Equip de Desenvolupadors de PBE Date: Wed, 28 Nov 2012 14:41:09 +0000 Subject: [PATCH] --- src/com/upc/pbe/upcnews/HTMLParser.java | 8 ++++---- src/com/upc/pbe/upcnews/MainActivity.java | 1 - 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/com/upc/pbe/upcnews/HTMLParser.java b/src/com/upc/pbe/upcnews/HTMLParser.java index 1c3f3b4..c410f5f 100644 --- a/src/com/upc/pbe/upcnews/HTMLParser.java +++ b/src/com/upc/pbe/upcnews/HTMLParser.java @@ -26,14 +26,14 @@ public class HTMLParser { } public String findvideo(String name, String code, String direccio){ - name = name+".m3u8"; String[] split = code.split("\n"); for(int i = 0; i< split.length; i++){ - if(split[i].contains(name)){ - return direccio+name+"/"; + if(split[i].contains(".m3u8")){ + String nomarxiu = split[i].substring((split[i].indexOf("href="))+6, (split[i].indexOf("/\""))); + return direccio+nomarxiu+"/"; } } - return null; + return "No s'ha trobat"; } } diff --git a/src/com/upc/pbe/upcnews/MainActivity.java b/src/com/upc/pbe/upcnews/MainActivity.java index 83b6e1b..0216c3e 100644 --- a/src/com/upc/pbe/upcnews/MainActivity.java +++ b/src/com/upc/pbe/upcnews/MainActivity.java @@ -47,7 +47,6 @@ public class MainActivity extends Activity implements OnClickListener { } public void onClick(View v) { - Log.d(TAG, "onClicked"); this.descarregar(); ((UpcApp) getApplication()).setDesc(html); -- libgit2 0.22.2