git://git.nikiroo.be
/
fanfix.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
333f0e7
)
Fix e621 getAuthor() which could error out
author
Niki Roo
<niki@nikiroo.be>
Wed, 15 Feb 2017 22:08:26 +0000
(23:08 +0100)
committer
Niki Roo
<niki@nikiroo.be>
Wed, 15 Feb 2017 22:08:26 +0000
(23:08 +0100)
src/be/nikiroo/fanfix/supported/E621.java
patch
|
blob
|
blame
|
history
diff --git
a/src/be/nikiroo/fanfix/supported/E621.java
b/src/be/nikiroo/fanfix/supported/E621.java
index cb4ae4657a7807c104cb5c7dbefe7324f015e9de..45c110f283ebaf825d5f7c65361917333f69add9 100644
(file)
--- a/
src/be/nikiroo/fanfix/supported/E621.java
+++ b/
src/be/nikiroo/fanfix/supported/E621.java
@@
-96,24
+96,28
@@
class E621 extends BasicSupport {
author = author.substring(0, pos - 1);
String page = source.getProtocol() + "://"
+ source.getHost() + author;
author = author.substring(0, pos - 1);
String page = source.getProtocol() + "://"
+ source.getHost() + author;
- InputStream pageIn = Instance.getCache().open(
- new URL(page), this, false);
try {
try {
- key = "class=\"tag-type-artist\"";
-
author = getLine(pageIn, key, 0
);
-
if (author != null)
{
-
pos = author.indexOf("<a href=\"")
;
- if (pos >= 0) {
- author = author.substring(pos);
- pos = author.indexOf("<
/a>
");
+ InputStream pageIn = Instance.getCache().open(
+
new URL(page), this, false
);
+
try
{
+
key = "class=\"tag-type-artist\""
;
+ author = getLine(pageIn, key, 0);
+ if (author != null) {
+ pos = author.indexOf("<
a href=\"
");
if (pos >= 0) {
if (pos >= 0) {
- author = author.substring(0, pos);
- return StringUtils.unhtml(author);
+ author = author.substring(pos);
+ pos = author.indexOf("</a>");
+ if (pos >= 0) {
+ author = author.substring(0, pos);
+ return StringUtils.unhtml(author);
+ }
}
}
}
}
+ } finally {
+ pageIn.close();
}
}
- }
finally
{
- pageIn.close();
+ }
catch (Exception e)
{
+ // No author found
}
}
}
}
}
}