|
2 | 2 |
|
3 | 3 | import de.mediathekview.mlib.Config; |
4 | 4 | import de.mediathekview.mlib.daten.DatenFilm; |
| 5 | +import de.mediathekview.mlib.tool.Log; |
5 | 6 | import mServer.crawler.CrawlerTool; |
| 7 | +import mServer.crawler.FilmeSuchen; |
| 8 | +import mServer.crawler.RunSender; |
6 | 9 | import mServer.crawler.sender.MediathekReader; |
7 | 10 | import mServer.crawler.sender.arte.ArteRestVideoTypeMapper; |
8 | 11 | import mServer.crawler.sender.arte.ArteVideoType; |
@@ -90,23 +93,29 @@ protected void addFilm(ArteVideoInfoDto videoInfo, String titleSuffix, Map<Quali |
90 | 93 | String date = localDateTime.format(DATE_FORMAT); |
91 | 94 | String time = localDateTime.format(TIME_FORMAT); |
92 | 95 |
|
93 | | - DatenFilm film = new DatenFilm(sender, buildTopic(videoInfo), buildWebsite(videoInfo), buildTitle(videoInfo) + titleSuffix, |
94 | | - video.get(Qualities.NORMAL), "" /*urlRtmp*/, |
95 | | - date, time, buildDuration(videoInfo).getSeconds(), buildDescription(videoInfo)); |
96 | | - if (video.containsKey(Qualities.HD)) { |
97 | | - CrawlerTool.addUrlHd(film, video.get(Qualities.HD)); |
98 | | - } |
99 | | - if (video.containsKey(Qualities.SMALL)) { |
100 | | - CrawlerTool.addUrlKlein(film, video.get(Qualities.SMALL)); |
101 | | - } |
| 96 | + String url = video.containsKey(Qualities.NORMAL) ? video.get(Qualities.NORMAL) : video.get(Qualities.HD); |
| 97 | + try { |
| 98 | + DatenFilm film = new DatenFilm(sender, buildTopic(videoInfo), buildWebsite(videoInfo), buildTitle(videoInfo) + titleSuffix, |
| 99 | + url, "" /*urlRtmp*/, |
| 100 | + date, time, buildDuration(videoInfo).getSeconds(), buildDescription(videoInfo)); |
| 101 | + if (video.containsKey(Qualities.HD)) { |
| 102 | + CrawlerTool.addUrlHd(film, video.get(Qualities.HD)); |
| 103 | + } |
| 104 | + if (video.containsKey(Qualities.SMALL)) { |
| 105 | + CrawlerTool.addUrlKlein(film, video.get(Qualities.SMALL)); |
| 106 | + } |
102 | 107 |
|
103 | | - final GeoLocations geoLocations = buildGeoLocation(videoInfo); |
104 | | - if (geoLocations != GeoLocations.GEO_NONE) { |
105 | | - film.arr[DatenFilm.FILM_GEO] = geoLocations.getDescription(); |
106 | | - } |
| 108 | + final GeoLocations geoLocations = buildGeoLocation(videoInfo); |
| 109 | + if (geoLocations != GeoLocations.GEO_NONE) { |
| 110 | + film.arr[DatenFilm.FILM_GEO] = geoLocations.getDescription(); |
| 111 | + } |
107 | 112 |
|
108 | | - if (!taskResults.add(film)) { |
109 | | - log.info("Duplicate {}", film); |
| 113 | + if (!taskResults.add(film)) { |
| 114 | + log.info("Duplicate {}", film); |
| 115 | + } |
| 116 | + } catch(Exception e) { |
| 117 | + FilmeSuchen.listeSenderLaufen.inc(sender, RunSender.Count.FEHLER); |
| 118 | + Log.errorLog(637846873, e, "exception creating film " + videoInfo.getTitle() + " (" + titleSuffix + ")"); |
110 | 119 | } |
111 | 120 | } |
112 | 121 |
|
|
0 commit comments