+ Element img = result.getElementsByTag("img").first();
+ if (img != null) {
+ try {
+ String[] tab = img.attr("src").split("/");
+ String str = tab[tab.length - 1];
+ tab = str.split("\\.");
+ str = tab[0];
+ projectId = Integer.parseInt(str);
+
+ String coverUrl = img.absUrl("src");
+ try {
+ InputStream in = Instance.getCache().open(
+ new URL(coverUrl), getSupport(), true);
+ try {
+ meta.setCover(new Image(in));
+ } finally {
+ in.close();
+ }
+ } catch (Exception e) {
+ // Happen often on MangaLEL...
+ Instance.getTraceHandler().trace(
+ "Cannot download cover for MangaLEL story in search mode: "
+ + meta.getTitle());
+ }
+ } catch (Exception e) {
+ // no project id... cannot use the story :(
+ Instance.getTraceHandler().error(
+ "Cannot find ProjectId for MangaLEL story in search mode: "
+ + meta.getTitle());
+ }
+ }
+
+ if (projectId >= 0) {
+ meta.setUrl("http://mangas-lecture-en-ligne.fr/index_lel.php?page=presentationProjet&idProjet="
+ + projectId);
+ meta.setUuid(meta.getUrl());
+ metas.add(meta);
+ }