Commit 0f0e8c2c3a036adcaa00392d3a90226ada93ef17
1 parent
87b49fef
--no commit message
Showing
3 changed files
with
5 additions
and
3 deletions
src/com/upc/pbe/upcnews/Descarrega.java
@@ -27,7 +27,7 @@ public class Descarrega extends AsyncTask<Object, Object, Object> { | @@ -27,7 +27,7 @@ public class Descarrega extends AsyncTask<Object, Object, Object> { | ||
27 | carpeta = "Environment.getExternalStorageDirectory.getPath()"; | 27 | carpeta = "Environment.getExternalStorageDirectory.getPath()"; |
28 | 28 | ||
29 | this.carpeta = null; | 29 | this.carpeta = null; |
30 | - this.html = null; | 30 | + this.html = ""; |
31 | this.arxiu = null; | 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,7 +116,9 @@ public class Directoris extends Activity implements OnClickListener { | ||
116 | } else { | 116 | } else { |
117 | d = new Descarrega(); | 117 | d = new Descarrega(); |
118 | String m3u8 = d.doInBackground(urlvideo); | 118 | String m3u8 = d.doInBackground(urlvideo); |
119 | + Log.d(TAG, m3u8); | ||
119 | Parser p = new Parser(); | 120 | Parser p = new Parser(); |
121 | + | ||
120 | try { | 122 | try { |
121 | ArrayList<ParentList> m3u8parsed = p.parseFile(m3u8); | 123 | ArrayList<ParentList> m3u8parsed = p.parseFile(m3u8); |
122 | 124 |
src/com/upc/pbe/upcnews/HTMLParser.java
@@ -18,8 +18,8 @@ public class HTMLParser { | @@ -18,8 +18,8 @@ public class HTMLParser { | ||
18 | //Mirem a cada linia si conté un href, i hi haurà un directori si conté el conjunt /" | 18 | //Mirem a cada linia si conté un href, i hi haurà un directori si conté el conjunt /" |
19 | //Si hi ha un directori, tallem l'string per obtenir-ne el nom. | 19 | //Si hi ha un directori, tallem l'string per obtenir-ne el nom. |
20 | for(int i = 0; i < split.length; i++){ | 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 | return directoris; | 25 | return directoris; |