Skip to content

Commit

Permalink
fix QiManWu, closed #112
Browse files Browse the repository at this point in the history
  • Loading branch information
Haleydu committed Oct 22, 2020
1 parent 6d0cb30 commit 3da8275
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions app/src/main/java/com/hiroshi/cimoc/source/QiManWu.java
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,10 @@ public List<Chapter> parseChapter(String html, Comic comic, Long sourceComic) {
@Override
public Request getImagesRequest(String cid, String path) {
String url = StringUtils.format("http://qiman6.com%s%s.html", cid, path);
return new Request.Builder().url(url).build();
return new Request.Builder()
.addHeader("Referer", baseUrl)
.addHeader("Host", "qiman6.com")
.url(url).build();
}

@Override
Expand All @@ -159,7 +162,7 @@ public List<ImageUrl> parseImages(String html, Chapter chapter) {
for (int i = 0; i != array.length; ++i) {
Long comicChapter = chapter.getId();
Long id = Long.parseLong(comicChapter + "000" + i);
list.add(new ImageUrl(id,comicChapter,i + 1, array[i], false));
list.add(new ImageUrl(id, comicChapter, i + 1, array[i], false));
}
} catch (Exception e) {
e.printStackTrace();
Expand All @@ -184,6 +187,6 @@ public String parseCheck(String html) {

@Override
public Headers getHeader() {
return Headers.of("Referer", baseUrl);
return Headers.of("User-Agent","Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.106 Safari/537.36");
}
}

0 comments on commit 3da8275

Please sign in to comment.