X-Git-Url: http://git.euphorik.ch/?p=pompage.git;a=blobdiff_plain;f=src%2Fmodules%2Fallocine.rb;h=c26c214d0e85ef5e65eb9510965cef5d53a1d916;hp=b4b65f0a5cdebbc6417bf16ae0722194f5c7f48b;hb=171308744ae16e63958d4b83dc135aa7bbdeab8f;hpb=db78cf34c49a1f99f96371c5ae290ceedee4e3bb diff --git a/src/modules/allocine.rb b/src/modules/allocine.rb index b4b65f0..c26c214 100644 --- a/src/modules/allocine.rb +++ b/src/modules/allocine.rb @@ -20,7 +20,7 @@ module Net end end -# un module d'importation pour le site "www.allocine.fr" +# Un module d'importation pour le site "www.allocine.fr". class Allocine < Basemodule def createConnexion @@ -37,7 +37,7 @@ class Allocine < Basemodule @connexion = nil end - # voir le parent. + # Voir le parent. def rechercherFilm(titre) createConnexion @@ -82,11 +82,11 @@ class Allocine < Basemodule loadPath("/film/fichefilm_gen_cfilm=#{id}.html", film) end + # Voir le parent. def loadURL(url, film) loadPath(URI.parse(url).path, film) end - # Voir le parent. def loadPath(path, film) createConnexion @@ -103,9 +103,10 @@ class Allocine < Basemodule puts "Pompage de #{film.titre} (#{film.fichiers[0]}) ..." - #convertit le code latin-1 en UTF8 + # convertit le code latin-1 en UTF8 html = Iconv.iconv("UTF-8", "ISO-8859-1", html)[0] + # pompage de l'image dans un thread séparé if take?("image") && ($force || !film.possedeImage?) // =~ html unless $1.nil? @@ -212,9 +213,10 @@ class Allocine < Basemodule end fermerConnexion - end + end def finish + # on attend que tous les threads de pompage d'image aient terminé @threadImage.join if defined? @threadImage end end \ No newline at end of file