Skip to content
This repository has been archived by the owner on Jul 23, 2020. It is now read-only.

Commit

Permalink
various servers fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
raulhaag committed Oct 9, 2019
1 parent 1662fb6 commit d10a715
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 4 deletions.
3 changes: 2 additions & 1 deletion app/src/main/java/ar/rulosoft/mimanganu/servers/DesuMe.java
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,8 @@ public void loadMangaInformation(Manga manga, boolean forceReload) throws Except
@Override
public String getImageFrom(Chapter chapter, int page) throws Exception {
assert chapter.getExtra() != null;
return chapter.getExtra().split("\\|")[page - 1];
String img = chapter.getExtra().split("\\|")[page - 1];
return (img.startsWith("//") ? "http:" + img : img);
}

@Override
Expand Down
5 changes: 5 additions & 0 deletions app/src/main/java/ar/rulosoft/mimanganu/servers/JapScan.java
Original file line number Diff line number Diff line change
Expand Up @@ -157,4 +157,9 @@ public ServerFilter[] getServerFilters() {
public boolean needRefererForImages() {
return false;
}

@Override
public boolean hasSearch() {
return false;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

public class MangaShiroNet extends ServerBase {

private static final String HOST = "https://mangashiro.org/";
private static final String HOST = "https://mangashiro.co/";
private static final int[] fltOrder = {
R.string.flt_order_alpha,
R.string.flt_order_last_update,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,9 +115,13 @@ public String getImageFrom(Chapter chapter, int page) throws Exception {
@Override
public void chapterInit(Chapter chapter) throws Exception {
Navigator nav = getNavigatorAndFlushParameters();
nav.addHeader("Cookie", "age_confirmed=1");
String data = nav.get(HOST + chapter.getPath());
chapter.setPages(Integer.parseInt(getFirstMatch(PATTERN_CHAPTER_PAGES, data, "can't init pages")));
String np = getFirstMatchDefault(PATTERN_CHAPTER_PAGES, data, null);
if (np == null) {
nav.get(HOST + chapter.getPath() + "?to=001&cid=#/yes_i_am");//request cookie
np = getFirstMatch(PATTERN_CHAPTER_PAGES, data, "can't init pages");
}
chapter.setPages(Integer.parseInt(np));
}

@Override
Expand Down
4 changes: 4 additions & 0 deletions app/src/main/java/ar/rulosoft/navegadores/CookieFilter.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@ public CookieFilter(CookieCache cache, CookiePersistor persistor) {
public synchronized List<Cookie> loadForRequest(HttpUrl url) {
if (url.toString().matches(".+?senmanga.com/viewer.+")) {
return new ArrayList<>();
} else if (url.toString().contains("neumanga.tv")) {
List<Cookie> oc = super.loadForRequest(url);
oc.add(Cookie.parse(url, "age_confirmed=1"));
return oc;
} else {
return super.loadForRequest(url);
}
Expand Down

0 comments on commit d10a715

Please sign in to comment.