pmd:UseIndexOfChar - Use Index Of Char (#300)
This commit is contained in:
parent
4d65038ad3
commit
48a1e8f74c
@ -106,21 +106,21 @@ public class Batoto extends LoginSource {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected Request mangaDetailsRequest(String mangaUrl) {
|
protected Request mangaDetailsRequest(String mangaUrl) {
|
||||||
String mangaId = mangaUrl.substring(mangaUrl.lastIndexOf("r") + 1);
|
String mangaId = mangaUrl.substring(mangaUrl.lastIndexOf('r') + 1);
|
||||||
return ReqKt.get(String.format(MANGA_URL, mangaId), getRequestHeaders());
|
return ReqKt.get(String.format(MANGA_URL, mangaId), getRequestHeaders());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected Request pageListRequest(String pageUrl) {
|
protected Request pageListRequest(String pageUrl) {
|
||||||
String id = pageUrl.substring(pageUrl.indexOf("#") + 1);
|
String id = pageUrl.substring(pageUrl.indexOf('#') + 1);
|
||||||
return ReqKt.get(String.format(CHAPTER_URL, id), getRequestHeaders());
|
return ReqKt.get(String.format(CHAPTER_URL, id), getRequestHeaders());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected Request imageUrlRequest(Page page) {
|
protected Request imageUrlRequest(Page page) {
|
||||||
String pageUrl = page.getUrl();
|
String pageUrl = page.getUrl();
|
||||||
int start = pageUrl.indexOf("#") + 1;
|
int start = pageUrl.indexOf('#') + 1;
|
||||||
int end = pageUrl.indexOf("_", start);
|
int end = pageUrl.indexOf('_', start);
|
||||||
String id = pageUrl.substring(start, end);
|
String id = pageUrl.substring(start, end);
|
||||||
return ReqKt.get(String.format(PAGE_URL, id, pageUrl.substring(end+1)), getRequestHeaders());
|
return ReqKt.get(String.format(PAGE_URL, id, pageUrl.substring(end+1)), getRequestHeaders());
|
||||||
}
|
}
|
||||||
|
@ -204,7 +204,7 @@ public class Mangachan extends Source {
|
|||||||
ArrayList<String> pages = new ArrayList<>();
|
ArrayList<String> pages = new ArrayList<>();
|
||||||
|
|
||||||
int beginIndex = unparsedHtml.indexOf("fullimg\":[");
|
int beginIndex = unparsedHtml.indexOf("fullimg\":[");
|
||||||
int endIndex = unparsedHtml.indexOf("]", beginIndex);
|
int endIndex = unparsedHtml.indexOf(']', beginIndex);
|
||||||
|
|
||||||
String trimmedHtml = unparsedHtml.substring(beginIndex + 10, endIndex);
|
String trimmedHtml = unparsedHtml.substring(beginIndex + 10, endIndex);
|
||||||
trimmedHtml = trimmedHtml.replaceAll("\"", "");
|
trimmedHtml = trimmedHtml.replaceAll("\"", "");
|
||||||
@ -220,7 +220,7 @@ public class Mangachan extends Source {
|
|||||||
@Override
|
@Override
|
||||||
protected List<Page> parseFirstPage(List<? extends Page> pages, String unparsedHtml) {
|
protected List<Page> parseFirstPage(List<? extends Page> pages, String unparsedHtml) {
|
||||||
int beginIndex = unparsedHtml.indexOf("fullimg\":[");
|
int beginIndex = unparsedHtml.indexOf("fullimg\":[");
|
||||||
int endIndex = unparsedHtml.indexOf("]", beginIndex);
|
int endIndex = unparsedHtml.indexOf(']', beginIndex);
|
||||||
|
|
||||||
String trimmedHtml = unparsedHtml.substring(beginIndex + 10, endIndex);
|
String trimmedHtml = unparsedHtml.substring(beginIndex + 10, endIndex);
|
||||||
trimmedHtml = trimmedHtml.replaceAll("\"", "");
|
trimmedHtml = trimmedHtml.replaceAll("\"", "");
|
||||||
|
Loading…
Reference in New Issue
Block a user