Отображение постеров к фильмам
This commit is contained in:
@@ -62,13 +62,13 @@ public class OnlinelifeScanner implements ScannerCinema {
|
||||
Document document = Jsoup.parse(browser.get(url));
|
||||
Element element = document.getElementsByClass("full-poster").get(0);
|
||||
|
||||
File saveTo = new File(this.saveToDir, url.substring(url.lastIndexOf("/")+1, url.lastIndexOf("."))+".jpg");
|
||||
this.fileDownloader.addFile(element.attr("src"), saveTo);
|
||||
String pathFile = "onlinelife/"+url.substring(url.lastIndexOf("/")+1, url.lastIndexOf("."))+".jpg";
|
||||
this.fileDownloader.addFile(element.attr("src"), new File(this.saveToDir, pathFile));
|
||||
|
||||
CinemaDocument cinemaDocument = new CinemaDocument();
|
||||
cinemaDocument.setTitle(document.getElementsByClass("film_info").get(0).child(0).child(0).text().trim());
|
||||
cinemaDocument.setDescription(document.getElementsByClass("film-description").get(0).text());
|
||||
cinemaDocument.setFileName(saveTo.getAbsolutePath());
|
||||
cinemaDocument.setFileName(pathFile);
|
||||
cinemaDocument.setTypeWarez(this.getName());
|
||||
cinemaDocument.setUrl(url);
|
||||
repository.save(cinemaDocument);
|
||||
|
||||
@@ -58,14 +58,14 @@ public class SeasonvarScanner implements ScannerCinema {
|
||||
Document document = Jsoup.parse(browser.get(url));
|
||||
Element element = document.getElementsByAttributeValue("itemprop", "thumbnailUrl").get(0);
|
||||
|
||||
File saveTo = new File(this.saveTo, url.substring(url.lastIndexOf("/")+1, url.lastIndexOf("."))+".jpg");
|
||||
this.fileDownloader.addFile(element.attr("src"), saveTo);
|
||||
String pathFile = "seasonvar/"+url.substring(url.lastIndexOf("/")+1, url.lastIndexOf("."))+".jpg";
|
||||
this.fileDownloader.addFile(element.attr("src"), new File(this.saveTo, pathFile));
|
||||
|
||||
CinemaDocument cinemaDocument = new CinemaDocument();
|
||||
String title = document.getElementsByClass("pgs-sinfo-title").get(0).text();
|
||||
cinemaDocument.setTitle(title.replaceAll("^Сериал ", "").replaceAll(" онлайн$", ""));
|
||||
cinemaDocument.setDescription(document.getElementsByAttributeValue("itemprop", "description").get(0).text());
|
||||
cinemaDocument.setFileName(saveTo.getAbsolutePath());
|
||||
cinemaDocument.setFileName(pathFile);
|
||||
cinemaDocument.setTypeWarez(this.getName());
|
||||
cinemaDocument.setUrl(url);
|
||||
this.repository.save(cinemaDocument);
|
||||
|
||||
Reference in New Issue
Block a user