Commit ad1210f13f2d21bfd34a1ca2fb39070aed33a5de
1 parent
100b8505
--no commit message
Showing
3 changed files
with
8 additions
and
8 deletions
src/com/upc/pbe/upcnews/Descarrega.java
@@ -23,16 +23,16 @@ public class Descarrega extends AsyncTask<Object, Object, Object>{ | @@ -23,16 +23,16 @@ public class Descarrega extends AsyncTask<Object, Object, Object>{ | ||
23 | private String html; | 23 | private String html; |
24 | private File arxiu; | 24 | private File arxiu; |
25 | 25 | ||
26 | - public Descarrega(String nomarxiu, String carpeta) { | 26 | + public Descarrega() { |
27 | 27 | ||
28 | - this.nomarxiu = nomarxiu; | ||
29 | - this.carpeta = carpeta; | 28 | + |
30 | this.html = null; | 29 | this.html = null; |
31 | this.arxiu = null; | 30 | this.arxiu = null; |
32 | } | 31 | } |
33 | 32 | ||
34 | - public void descarregarguardar(String u) { | ||
35 | - | 33 | + public void descarregarguardar(String u, String nomarxiu, String carpeta) { |
34 | + this.nomarxiu = nomarxiu; | ||
35 | + this.carpeta = carpeta; | ||
36 | this.url = u; | 36 | this.url = u; |
37 | // Creem el directori | 37 | // Creem el directori |
38 | File dir = new File(carpeta); | 38 | File dir = new File(carpeta); |
src/com/upc/pbe/upcnews/Directoris.java
@@ -106,7 +106,7 @@ public class Directoris extends Activity implements OnClickListener { | @@ -106,7 +106,7 @@ public class Directoris extends Activity implements OnClickListener { | ||
106 | 106 | ||
107 | //Descarrega de la pàgina HTML del directori i busqueda d'un .m3u8 en ella | 107 | //Descarrega de la pàgina HTML del directori i busqueda d'un .m3u8 en ella |
108 | Log.d(TAG, "Click on " + b.getText()); | 108 | Log.d(TAG, "Click on " + b.getText()); |
109 | - d = new Descarrega(file, folder); | 109 | + d = new Descarrega(); |
110 | String str = d.doInBackground(url + "/" + b.getText() + "/"); | 110 | String str = d.doInBackground(url + "/" + b.getText() + "/"); |
111 | HTMLParser pars = new HTMLParser(); | 111 | HTMLParser pars = new HTMLParser(); |
112 | String urlvideo = pars.findvideo(str, url + "/" + b.getText() + "/"); | 112 | String urlvideo = pars.findvideo(str, url + "/" + b.getText() + "/"); |
@@ -116,7 +116,7 @@ public class Directoris extends Activity implements OnClickListener { | @@ -116,7 +116,7 @@ public class Directoris extends Activity implements OnClickListener { | ||
116 | if (urlvideo.equalsIgnoreCase("No s'ha trobat")) { | 116 | if (urlvideo.equalsIgnoreCase("No s'ha trobat")) { |
117 | Toast.makeText(this, "The directory " + b.getText() + " does not contain any '.m3u8' file", Toast.LENGTH_LONG).show(); | 117 | Toast.makeText(this, "The directory " + b.getText() + " does not contain any '.m3u8' file", Toast.LENGTH_LONG).show(); |
118 | } else { | 118 | } else { |
119 | - d = new Descarrega(file, folder); | 119 | + d = new Descarrega(); |
120 | String m3u8 = d.doInBackground(urlvideo); | 120 | String m3u8 = d.doInBackground(urlvideo); |
121 | Parser p = new Parser(); | 121 | Parser p = new Parser(); |
122 | try { | 122 | try { |
src/com/upc/pbe/upcnews/MainActivity.java
@@ -81,7 +81,7 @@ public class MainActivity extends Activity implements OnClickListener { | @@ -81,7 +81,7 @@ public class MainActivity extends Activity implements OnClickListener { | ||
81 | } | 81 | } |
82 | 82 | ||
83 | public void descarregar() { | 83 | public void descarregar() { |
84 | - Descarrega d = new Descarrega(file, folder); | 84 | + Descarrega d = new Descarrega(); |
85 | Toast.makeText(this, "Download succesfull", Toast.LENGTH_LONG).show(); | 85 | Toast.makeText(this, "Download succesfull", Toast.LENGTH_LONG).show(); |
86 | html = (String) d.doInBackground(this.getUrl()); | 86 | html = (String) d.doInBackground(this.getUrl()); |
87 | } | 87 | } |