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);