Skip to content

Commit

Permalink
Merge pull request dteviot#1341 from ImLJS/Delta
Browse files Browse the repository at this point in the history
Update WetriedParser
  • Loading branch information
dteviot authored Jun 8, 2024
2 parents 55668f2 + 0ea1ea4 commit 0b856a3
Showing 1 changed file with 4 additions and 12 deletions.
16 changes: 4 additions & 12 deletions plugin/js/parsers/WetriedParser.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"use strict";

parserFactory.register("wetriedtls.site", function () {return new WetriedParser();});
parserFactory.register("wetriedtls.com", function () {return new WetriedParser();});

class WetriedParser extends Parser {
constructor() {
Expand All @@ -23,16 +23,8 @@ class WetriedParser extends Parser {
}

async fetchTocPage(seriesId, page, perPage) {
let options = {
method: "POST",
headers: {
"Accept": "application/json",
"Content-Type": "application/json"
},
credentials: "include",
body: `{"series_id":${seriesId},"page":${page},"perPage":${perPage}}`
};
let json = (await HttpClient.fetchJson("https://api.wetriedtls.site/chapter/query", options)).json;
const query = `page=${page}&perPage=${perPage}&series_id=${seriesId}`
let json = (await HttpClient.fetchJson(`https://api.wetriedtls.com/chapter/query?${query}`)).json;
return json.data.map(c => this.jsonToChapter(c))
.reverse();
}
Expand All @@ -41,7 +33,7 @@ class WetriedParser extends Parser {
let seriesSlug = json.series.series_slug;;
let chapterLeaf = json.chapter_slug;
return ({
sourceUrl: `https://wetriedtls.site/series/${seriesSlug}/${chapterLeaf}`,
sourceUrl: `https://wetriedtls.com/series/${seriesSlug}/${chapterLeaf}`,
title: json.chapter_name + ": " + json.chapter_title,
});;
}
Expand Down

0 comments on commit 0b856a3

Please sign in to comment.