diff --git a/source/net/sourceforge/filebot/web/IMDbClient.java b/source/net/sourceforge/filebot/web/IMDbClient.java index 9607991f..40d23def 100644 --- a/source/net/sourceforge/filebot/web/IMDbClient.java +++ b/source/net/sourceforge/filebot/web/IMDbClient.java @@ -115,7 +115,7 @@ public class IMDbClient implements MovieIdentificationService { return null; String name = selectString("//H1/text()", dom).replaceAll("\\s+", " ").trim(); - String year = new Scanner(selectNode("//H1/SPAN", dom).getTextContent()).useDelimiter("\\D+").next(); + String year = new Scanner(selectNode("//H1/SPAN[@class='nobr']", dom).getTextContent()).useDelimiter("\\D+").next(); int imdbid = getImdbId(selectString("//LINK[@rel='canonical']/@href", dom)); return new Movie(name, Pattern.matches("\\d{4}", year) ? Integer.parseInt(year) : -1, imdbid, -1); diff --git a/test/net/sourceforge/filebot/web/IMDbClientTest.java b/test/net/sourceforge/filebot/web/IMDbClientTest.java index 91845309..1388abda 100644 --- a/test/net/sourceforge/filebot/web/IMDbClientTest.java +++ b/test/net/sourceforge/filebot/web/IMDbClientTest.java @@ -123,6 +123,16 @@ public class IMDbClientTest { } + @Test + public void getMovieDescriptor4() throws Exception { + Movie movie = imdb.getMovieDescriptor(369702, null); + + assertEquals("The Sea Inside", movie.getName()); + assertEquals(2004, movie.getYear()); + assertEquals(369702, movie.getImdbId(), 0); + } + + @Test public void getAkaMovieDescriptor() throws Exception { Movie movie = imdb.getMovieDescriptor(106559, Locale.ENGLISH);