From 0f0e8c2c3a036adcaa00392d3a90226ada93ef17 Mon Sep 17 00:00:00 2001 From: Equip de Desenvolupadors de PBE Date: Wed, 5 Dec 2012 14:04:53 +0000 Subject: [PATCH] --- src/com/upc/pbe/upcnews/Descarrega.java | 2 +- src/com/upc/pbe/upcnews/Directoris.java | 2 ++ src/com/upc/pbe/upcnews/HTMLParser.java | 4 ++-- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/com/upc/pbe/upcnews/Descarrega.java b/src/com/upc/pbe/upcnews/Descarrega.java index ce48016..196caae 100644 --- a/src/com/upc/pbe/upcnews/Descarrega.java +++ b/src/com/upc/pbe/upcnews/Descarrega.java @@ -27,7 +27,7 @@ public class Descarrega extends AsyncTask { carpeta = "Environment.getExternalStorageDirectory.getPath()"; this.carpeta = null; - this.html = null; + this.html = ""; this.arxiu = null; } diff --git a/src/com/upc/pbe/upcnews/Directoris.java b/src/com/upc/pbe/upcnews/Directoris.java index 3b003b8..be612e4 100644 --- a/src/com/upc/pbe/upcnews/Directoris.java +++ b/src/com/upc/pbe/upcnews/Directoris.java @@ -116,7 +116,9 @@ public class Directoris extends Activity implements OnClickListener { } else { d = new Descarrega(); String m3u8 = d.doInBackground(urlvideo); + Log.d(TAG, m3u8); Parser p = new Parser(); + try { ArrayList m3u8parsed = p.parseFile(m3u8); diff --git a/src/com/upc/pbe/upcnews/HTMLParser.java b/src/com/upc/pbe/upcnews/HTMLParser.java index 8924e69..bfa4fde 100644 --- a/src/com/upc/pbe/upcnews/HTMLParser.java +++ b/src/com/upc/pbe/upcnews/HTMLParser.java @@ -18,8 +18,8 @@ public class HTMLParser { //Mirem a cada linia si conté un href, i hi haurà un directori si conté el conjunt /" //Si hi ha un directori, tallem l'string per obtenir-ne el nom. for(int i = 0; i < split.length; i++){ - if(split[i].contains("href") && split[i].contains("/index.html\"")){ - directoris.add((split[i].substring((split[i].indexOf("href="))+6, (split[i].indexOf("/index.html\""))))); + if(split[i].contains("href") && split[i].contains("/\"")){ + directoris.add((split[i].substring((split[i].indexOf("href="))+6, (split[i].indexOf("/\""))))); } } return directoris; -- libgit2 0.22.2