/<img src="(.*?)" border="0" alt="" class="affichette" \/>/ =~ html\r
unless $1.nil?\r
@threadImage = Thread::start($1){|imageUrl|\r
+ nbRetry = 0\r
begin\r
imageUrl = URI.parse(imageUrl) \r
connexionImage = Net::HTTP::new(imageUrl.host).start\r
rescue Exception => e\r
puts e.message\r
puts e.backtrace \r
- puts "[!] Erreur lors du chargement de l'image #{imageUrl}, retry.." \r
- retry\r
+ puts "[!] Erreur lors du chargement de l'image '#{imageUrl}', retry.." \r
+ retry if (nbRetry += 1) < 5 \r
end\r
}\r
end\r
+# coding: utf-8\r
+html = '<table cellpadding="0" cellspacing="0" border="0" width="750" style="margin: 0 0 10 0;"><tr><td valign="top" width="120"><img src="http://a69.g.akamai.net/n/69/10688/v1/img5.allocine.fr/acmedia/medias/nmedia/18/35/06/77/afte.jpg" border="0" alt="" class="affichette" />'\r
+/<img src="(.*?)" border="0" alt="" class="affichette" \/>/ =~ html\r
+url = URI.parse($1) \r
+p url.host\r
\r
-def pomper(r)\r
- Dir::foreach(r){|f|\r
- next if f[0,1] == '.'\r
- fichier = (r == '.' ? '' : r + "/") + f\r
- if File::directory?(fichier)\r
- pomper(fichier) \r
- else\r
- p fichier \r
- end\r
- }\r
-end\r
-\r
-pomper("F:\\films")
\ No newline at end of file
+nbRetry = 0\r
+p "youpla" if (nbRetry += 1) < 5
\ No newline at end of file