Commit 0eb8d6308988c8e1a96eaaf612d6eff87cdfb9c6
1 parent
9411cd3e
--no commit message
Showing
2 changed files
with
4 additions
and
5 deletions
src/com/upc/pbe/upcnews/HTMLParser.java
... | ... | @@ -26,14 +26,14 @@ public class HTMLParser { |
26 | 26 | } |
27 | 27 | |
28 | 28 | public String findvideo(String name, String code, String direccio){ |
29 | - name = name+".m3u8"; | |
30 | 29 | String[] split = code.split("\n"); |
31 | 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