Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added Module Parser KETSU/SenManga/.DS_Store
Binary file not shown.
Binary file not shown.
87 changes: 87 additions & 0 deletions Module Parser KETSU/SenManga/Chapters/Chapters.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@

<script type="text/javascript">
function Chapters(request, extra, javascriptConfig, output) {
this.request = request;
this.extra = extra;
this.javascriptConfig = javascriptConfig;
this.output = output;
}

function ModuleRequest(url, method, headers, httpBody) {
this.url = url;
this.method = method;
this.headers = headers;
this.httpBody = httpBody;
}

function Extra(commands, extraInfo) {
this.commands = commands;
this.extraInfo = extraInfo;
}

function Commands(commandName, params) {
this.commandName = commandName;
this.params = params;
}

function JavascriptConfig(removeJavascript, loadInWebView, javaScript) {
this.removeJavascript = removeJavascript;
this.loadInWebView = loadInWebView;
this.javaScript = javaScript;
}

function KeyValue(key, value) {
this.key = key;
this.value = value;
}

function Output( videos, images, text) {
this.videos = videos;
this.images = images;
this.text = text;
}

function Videos(needsResolver, rawVideo) {
this.needsResolver = needsResolver;
this.rawVideo = rawVideo;
}

function NeedsResolver(resolverIdentifier, link) {
this.resolverIdentifier = resolverIdentifier;
this.link = link;
}

function RawVideo(video) {
this.video = video;
}

function Video(videoQuality, videoLink) {
this.videoQuality = videoQuality;
this.videoLink = videoLink;
}



function Text(text) {
this.text = text;
}

var output = [];
var savedData = document.getElementById('ketsu-final-data');
var parsedJson = JSON.parse(savedData.innerHTML);

var emptyKeyValue = [new KeyValue('', '')];

let images = [];
var imagesArray = document.querySelector('.reader').querySelectorAll('.picture');
for(image of imagesArray){
let imgSrc = image.src;
images.push(new ModuleRequest(imgSrc, 'get', emptyKeyValue, null));
}

let emptyExtra = new Extra([new Commands('', emptyKeyValue)], emptyKeyValue);
var chaptersObject = new Chapters(new ModuleRequest('', '', emptyKeyValue, null), emptyExtra, new JavascriptConfig(false, false, ''), new Output(null, images, null));
var finalJson = JSON.stringify(chaptersObject);
savedData.innerHTML = finalJson;

</script>
Binary file added Module Parser KETSU/SenManga/Info/.DS_Store
Binary file not shown.
114 changes: 114 additions & 0 deletions Module Parser KETSU/SenManga/Info/Info.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@

<script type="text/javascript">
function Info(request, extra, javascriptConfig, output) {
this.request = request;
this.extra = extra;
this.javascriptConfig = javascriptConfig;
this.output = output;
}

function ModuleRequest(url, method, headers, httpBody) {
this.url = url;
this.method = method;
this.headers = headers;
this.httpBody = httpBody;
}

function Extra(commands, extraInfo) {
this.commands = commands;
this.extraInfo = extraInfo;
}

function Commands(commandName, params) {
this.commandName = commandName;
this.params = params;
}

function JavascriptConfig(removeJavascript, loadInWebView, javaScript) {
this.removeJavascript = removeJavascript;
this.loadInWebView = loadInWebView;
this.javaScript = javaScript;
}

function KeyValue(key, value) {
this.key = key;
this.value = value;
}

function Chapter(chapName, link,openInWebView) {
this.chapName = chapName;
this.link = link;
this.openInWebView = openInWebView;
}

function Output(image, title, link, description, genres, field1, field2, field3, field4, chapters) {
this.image = image;
this.link = link;
this.title = title;
this.description = description;
this.genres = genres;
this.field1 = field1;
this.field2 = field2;
this.field3 = field3;
this.field4 = field4;
this.chapters = chapters;
}

function getStuff(array,match) {
for (var x = 0 ; x< array.length;x++) {
let data = array[x].innerText;
if (data.includes(match)) {
return data.replace(match,'').trim();
}
}
}
function getHtmlStuff(array,match) {
for (var x = 0 ; x< array.length;x++) {
let data = array[x].innerText;
if (data.includes(match)) {
return array[x];
}
}
}

var savedData = document.getElementById('ketsu-final-data');
var parsedJson = JSON.parse(savedData.innerHTML);
let emptyKeyValue = [new KeyValue('', '')];

var episodes = [];
if(document.querySelector('.chapter-list') != null) {
let episodesArray = document.querySelector('.chapter-list').querySelectorAll('li');
for(ep of episodesArray){
let name = ep.querySelector('.series').innerText;

var link = ep.querySelector('.series').href;
link = new ModuleRequest(link, 'get', emptyKeyValue, null);

episodes.push(new Chapter(name, link, false));
}
episodes.reverse();
}

var type = document.querySelector('.info').querySelectorAll('.item')[3].innerText.split(' ')[1];

var status = document.querySelector('.info').querySelectorAll('.item')[1].innerText.split(' ')[1];

var genres = [];
if(document.querySelector('.item.genre') != null){
let genreArray = document.querySelector('.item.genre').querySelectorAll('a');
for(genre of genreArray){
genres.push(genre.text);
}
}

var desc = document.querySelector('.summary').innerText;

var title = document.querySelector('.series').innerText;

var image = document.querySelector('.cover img').src;
image = new ModuleRequest(image,'get',emptyKeyValue,null);

let infoPageObject = new Info(new ModuleRequest('', '', emptyKeyValue, null), new Extra([new Commands('', emptyKeyValue)], emptyKeyValue), new JavascriptConfig(false, false, ''), new Output(image, title, parsedJson.request, desc, genres, status, '', type, 'Chapters: ' + episodes.length, episodes));
var finalJson = JSON.stringify(infoPageObject);
savedData.innerHTML = finalJson;
</script>
Loading