9 |
|
|
10 |
public String fechTitle(String sid, int season, int episode) throws Exception { |
public String fechTitle(String sid, int season, int episode) throws Exception { |
11 |
|
|
12 |
final String epMatch = "Ep" + episode; |
final String epMatch = "ep" + episode; |
13 |
final String noTitle = "Episode #" + season + "." + episode; |
final String noTitle = "Episode #" + season + "." + episode; |
14 |
|
|
15 |
String url = "http://www.imdb.com/title/" + sid + "/episodes?season=" + season; |
String url = "http://www.imdb.com/title/" + sid + "/episodes?season=" + season; |
29 |
Element anchor = image.child(0); |
Element anchor = image.child(0); |
30 |
|
|
31 |
String title = anchor.attr("title"); |
String title = anchor.attr("title"); |
32 |
String content = anchor.text().trim(); |
//String content = anchor.text().trim(); |
33 |
|
String href = anchor.attr("href"); |
34 |
|
|
35 |
if ( content.endsWith(epMatch)) { |
if ( href.endsWith(epMatch)) { |
36 |
if (title.equalsIgnoreCase(noTitle)) { |
if (title.equalsIgnoreCase(noTitle)) { |
37 |
return "!Title not found!"; |
return "!Title not found!"; |
38 |
} |
} |