Commit 0eb8d6308988c8e1a96eaaf612d6eff87cdfb9c6

Authored by Imanol-Mikel Barba Sabariego
1 parent 9411cd3e

--no commit message

src/com/upc/pbe/upcnews/HTMLParser.java
@@ -26,14 +26,14 @@ public class HTMLParser { @@ -26,14 +26,14 @@ public class HTMLParser {
26 } 26 }
27 27
28 public String findvideo(String name, String code, String direccio){ 28 public String findvideo(String name, String code, String direccio){
29 - name = name+".m3u8";  
30 String[] split = code.split("\n"); 29 String[] split = code.split("\n");
31 for(int i = 0; i< split.length; i++){ 30 for(int i = 0; i< split.length; i++){
32 - if(split[i].contains(name)){  
33 - return direccio+name+"/"; 31 + if(split[i].contains(".m3u8")){
  32 + String nomarxiu = split[i].substring((split[i].indexOf("href="))+6, (split[i].indexOf("/\"")));
  33 + return direccio+nomarxiu+"/";
34 } 34 }
35 } 35 }
36 - return null; 36 + return "No s'ha trobat";
37 } 37 }
38 38
39 } 39 }
src/com/upc/pbe/upcnews/MainActivity.java
@@ -47,7 +47,6 @@ public class MainActivity extends Activity implements OnClickListener { @@ -47,7 +47,6 @@ public class MainActivity extends Activity implements OnClickListener {
47 } 47 }
48 48
49 public void onClick(View v) { 49 public void onClick(View v) {
50 -  
51 Log.d(TAG, "onClicked"); 50 Log.d(TAG, "onClicked");
52 this.descarregar(); 51 this.descarregar();
53 ((UpcApp) getApplication()).setDesc(html); 52 ((UpcApp) getApplication()).setDesc(html);