Commit 0f0e8c2c3a036adcaa00392d3a90226ada93ef17

Authored by Imanol-Mikel Barba Sabariego
1 parent 87b49fef

--no commit message

src/com/upc/pbe/upcnews/Descarrega.java
... ... @@ -27,7 +27,7 @@ public class Descarrega extends AsyncTask<Object, Object, Object> {
27 27 carpeta = "Environment.getExternalStorageDirectory.getPath()";
28 28  
29 29 this.carpeta = null;
30   - this.html = null;
  30 + this.html = "";
31 31 this.arxiu = null;
32 32 }
33 33  
... ...
src/com/upc/pbe/upcnews/Directoris.java
... ... @@ -116,7 +116,9 @@ public class Directoris extends Activity implements OnClickListener {
116 116 } else {
117 117 d = new Descarrega();
118 118 String m3u8 = d.doInBackground(urlvideo);
  119 + Log.d(TAG, m3u8);
119 120 Parser p = new Parser();
  121 +
120 122 try {
121 123 ArrayList<ParentList> m3u8parsed = p.parseFile(m3u8);
122 124  
... ...
src/com/upc/pbe/upcnews/HTMLParser.java
... ... @@ -18,8 +18,8 @@ public class HTMLParser {
18 18 //Mirem a cada linia si conté un href, i hi haurà un directori si conté el conjunt /"
19 19 //Si hi ha un directori, tallem l'string per obtenir-ne el nom.
20 20 for(int i = 0; i < split.length; i++){
21   - if(split[i].contains("href") && split[i].contains("/index.html\"")){
22   - directoris.add((split[i].substring((split[i].indexOf("href="))+6, (split[i].indexOf("/index.html\"")))));
  21 + if(split[i].contains("href") && split[i].contains("/\"")){
  22 + directoris.add((split[i].substring((split[i].indexOf("href="))+6, (split[i].indexOf("/\"")))));
23 23 }
24 24 }
25 25 return directoris;
... ...