0% found this document useful (0 votes)
939 views3 pages

4 Anime

This 3 sentence summary provides the key details about the document: The document contains configuration information for a 4Anime module, including the module name and description, developer, base URL, and JavaScript code to retrieve data from the 4Anime website like last episodes, last anime titles, search results, and individual anime information. It defines objects and functions for making requests to 4Anime and parsing the response, then outputs the data in JSON format.

Uploaded by

Xaro Xentoake
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
939 views3 pages

4 Anime

This 3 sentence summary provides the key details about the document: The document contains configuration information for a 4Anime module, including the module name and description, developer, base URL, and JavaScript code to retrieve data from the 4Anime website like last episodes, last anime titles, search results, and individual anime information. It defines objects and functions for making requests to 4Anime and parsing the response, then outputs the data in JSON format.

Uploaded by

Xaro Xentoake
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
  • Module Code Details

{ "moduleName": "4Anime", "moduleInitials": "4AN", "moduleDesc": "This is a

module to get data from 4anime", "developer": "uknown", "moduleID": "123",


"moduleImage":
"https://pbs.twimg.com/profile_images/825927310314385409/mWPy7F7u.jpg",
"moduleVersion": "2.0", "moduleLenguage": "ENG", "moduleHasVideos": "true",
"randomizeUserAgent": "false", "baseURL": "https://4anime.to/",
"mainPageLeftTitle": "Last Episodes", "mainPageRightTitle": "Last Animes",
"blackListed": [ "" ], "mainPage": [ { "request":
"https://4anime.to/", "method": "get", "headers": [ {
"key": "", "value": "" } ], "extraInfo": [ {
"value": "" } ], "loadJavascript": "false", "javaScript":
" function Header(key, value) { this.key = key; this.value = value;}function
ExtraInfo(value) { this.value = value;}function Output(lastEpisodes, lastAnimes)
{ this.lastEpisodes = lastEpisodes; this.lastAnimes = lastAnimes;}function
LastAnimes(moduleID, image, link, title) { this.moduleID = moduleID; this.image =
image; this.link = link; this.title = title;}function LastEpisodes(moduleID, image,
link, title, episode) { this.moduleID = moduleID; this.image = image; this.link =
link; this.title = title; this.episode = episode;}function MainPageObject(request,
headers, method, extraInfo, loadJavascript, javaScript, output) { this.request =
request; this.headers = headers; this.method = method; this.extraInfo = extraInfo;
this.loadJavascript = loadJavascript; this.javaScript = javaScript; this.output =
output;}var moduleID = '123';var mainPageObject;var output;var headers = [];var
lastAnimes = [];var lastEpisodes = [];var extraInfo = [];var savedData =
document.getElementById('katsu-final-data');var animes =
document.getElementById('populartodaycontent').querySelectorAll('div');for (var x =
0; x < animes.length; x++) { var id = animes[x].getAttribute('id'); if (id ==
'headerDIV_3') { try { var link = animes[x].querySelector('a').href; var image =
'https://4anime.to' + animes[x].querySelector('img').src; var title =
animes[x].querySelector('#headerA_7').innerText; var newAnime = new
LastAnimes(moduleID, image, link, title); if (newAnime != null)
{ lastAnimes.push(newAnime); } } catch (err) { console.log('error found');
console.log(err); } }}var eps =
document.getElementById('urcontent').querySelectorAll('div');for (var x = 0; x <
eps.length; x++) { var id = eps[x].getAttribute('id'); if (id == 'headerDIV_3')
{ try { var link = eps[x].querySelector('a').href; var image = 'https://4anime.to'
+ eps[x].querySelector('img').src; var title =
eps[x].querySelector('#headerA_7').innerText; var epi =
eps[x].querySelector('#headerA_8').innerText; var newEp = new
LastEpisodes(moduleID, image, link, title, epi); if (newEp != null)
{ lastEpisodes.push(newEp); } } catch (err) { console.log('error found');
console.log(err); } }}while (lastEpisodes.length % 2 != 0)
{ lastEpisodes.push(lastEpisodes[0]);}while (lastAnimes.length % 3 != 0)
{ lastAnimes.push(lastAnimes[0]);}output = new Output(lastEpisodes,
lastAnimes);headers.push(new Header('', ''));extraInfo.push(new
ExtraInfo(''));mainPageObject = new MainPageObject('', headers, '', extraInfo, '',
'', output);var finalJson = JSON.stringify(mainPageObject);savedData.innerHTML =
finalJson;", "output": { "lastEpisodes":
[ { "moduleID": "0", "image": "",
"link": "", "title": "", "episode":
"" } ], "lastAnimes":
[ { "moduleID": "0", "image": "",
"link": "", "title": "" } ] } } ],
"search": [ { "request": "https://4anime.to/?s=<searched>",
"method": "get", "headers": [ { "key": "",
"value": "" } ], "separator": "+", "extraInfo": [
{ "value": "" } ], "loadJavascript": "false",
"javaScript": " function Header(key,value) { this.key = key; this.value = value; }
function ExtraInfo(value) { this.value = value; } function
Output(moduleID,image,link,title,type,voice,stars) { this.moduleID = moduleID;
this.image = image; this.link = link; this.title = title; this.type = type;
this.voice = voice; this.stars = stars; } function
SearchObject(request,method,headers,separator,extraInfo,loadJavascript,javaScript,o
utput) { this.request = request; this.method = method; this.headers = headers;
this.separator = separator; this.extraInfo = extraInfo; this.loadJavascript =
loadJavascript; this.javaScript = javaScript; this.output = output; } function
getType(title) { if (title.includes('Dub')) { return 'Dub'; } return 'Sub'; } var
moduleID = '123'; var searchPageObject; var output = []; var headers = []; var
extraInfo = []; var savedData = document.getElementById('katsu-final-data'); var
animes = document.querySelector('.container').querySelectorAll('a'); for (var i =
0; i < animes.length; ++i) { try { var link = animes[i].href; var image =
animes[i].querySelector('img').src; var title =
animes[i].querySelector('div').innerText; var anime = new
Output(moduleID,image,link,title,'Anime',getType(title),'★★★★★'); var searchCheck =
animes[i].innerText; if (searchCheck != 'Search') { output.push(anime); } }
catch(err) { console.log(err); } } headers.push(new Header('',''));
extraInfo.push(new ExtraInfo('')); searchPageObject = new
SearchObject('','',headers,'+',extraInfo,'','',output); var finalJson =
JSON.stringify(searchPageObject); savedData.innerHTML = finalJson;",
"output": [ { "moduleID": "0", "image": "",
"link": "", "title": "", "type": "", "voice": "",
"stars": "" } ] } ], "info": [ { "request": "get",
"method": "get", "headers": [ { "key": "Referer",
"value": "https://4anime.to/" } ], "extraInfo": [ {
"value": "" } ], "loadJavascript": "false", "javaScript":
"function Header(key, value) { this.key = key; this.value = value;}function
ExtraInfo(value) { this.value = value;}function Output(moduleID, image, link,
title, description, genres, type, status, episodes) { this.moduleID = moduleID;
this.image = image; this.link = link; this.title = title; this.description =
description; this.genres = genres; this.type = type; this.status = status;
this.episodes = episodes;}function Episodes(link, moduleID, isDecodable)
{ this.link = link; this.moduleID = moduleID; this.isDecodable =
isDecodable;}function InfoObject(request, method, headers, extraInfo,
loadJavascript, javaScript, output) { this.request = request; this.method = method;
this.headers = headers; this.extraInfo = extraInfo; this.loadJavascript =
loadJavascript; this.javaScript = javaScript; this.output = output;}var savedData =
document.getElementById('katsu-final-data');var moduleID = '123';var infoObject;var
output;var headers = [];var extraInfo = [];var episodes = [];var type = ' ';var
status = '';var genres = [];var desc = '';var parsedJson =
JSON.parse(savedData.innerHTML);var title =
document.querySelector('#recenttext').innerText;var image = 'https://4anime.to' +
document.querySelector('.cover').querySelector('img').src;var genresArray =
document.querySelectorAll('.item');desc =
document.querySelector('.synopsis').innerText;for (var x = 0; x <
genresArray.length; x++) { genres.push(genresArray[x].innerText);}var chapters =
document.querySelector('.single-anime-category').querySelectorAll('a');for (var x =
0; x < chapters.length; x++) { var fixedLink = chapters[x].href; episodes.push(new
Episodes(fixedLink, moduleID, 'false'));}output = new Output(moduleID, image,
parsedJson.request, title, desc, genres, type, status, episodes);extraInfo.push(new
ExtraInfo(''));headers.push(new Header('', ''));infoObject = new InfoObject('',
'get', headers, extraInfo, '', '', output);var finalJson =
JSON.stringify(infoObject);savedData.innerHTML = finalJson;var req = new
XMLHttpRequest();req.open('GET', 'https://www.google.com/',
false);req.send(null);var req = new XMLHttpRequest();req.open('GET',
'https://www.google.com/', false);req.send(null);window.stop();", "output": {
"moduleID": "0", "image": "", "link": "", "title": "",
"description": "", "genres": [ "" ], "type": "",
"status": "", "episodes": [ { "link": "",
"moduleID": "", "isDecodable": "false" } ] }
} ], "episodes": [ { "request": "empty", "method": "get",
"headers": [ { "key": "key", "value": "value" }
], "extraInfo": [ { "value": "" } ],
"loadJavascript": "true", "javaScript": "function Header(key, value)
{ this.key = key; this.value = value;}function ExtraInfo(value) { this.value =
value;}function Output(link, linkIdentifier, moduleID, isDecodable, headers)
{ this.link = link; this.linkIdentifier = linkIdentifier; this.moduleID = moduleID;
this.isDecodable = isDecodable; this.headers = headers;}function
EpisodeObject(request, method, headers, extraInfo, loadJavascript, javaScript,
output) { this.request = request; this.method = method; this.headers = headers;
this.extraInfo = extraInfo; this.loadJavascript = loadJavascript; this.javaScript =
javaScript; this.output = output;}function prepend(value, array) { var newArray =
array.slice(); newArray.unshift(value); return newArray;}var moduleID = '123';var
episodeObject;var output = [];var headers = [];var extraInfo = [];var savedData =
document.getElementById('katsu-final-data');var
parsedJson = JSON.parse(savedData.innerHTML);var videoHeaders = [new
Header('Referer', parsedJson.request)];var finalLinks = [];var names = [];try
{ finalLinks.push(document.querySelector('video').src); names.push('Video');} catch
(err) { console.log(err);}try
{ finalLinks.push(document.querySelector('source').src); names.push('Source');}
catch (err) { console.log(err);}try
{ finalLinks.push(document.querySelector('.mirror_dl').href);
names.push('Mirror');} catch (err) { console.log(err);}let scripts =
document.querySelectorAll('script');for (var x = 0; x < scripts.length; x++) { let
script = scripts[x].innerHTML; if (script.includes('|controls|')) { eval(script);
try { var data = document.querySelectorAll('source'); data = data[data.length -
1].src; finalLinks.push(data); names.push('New Decoded'); } catch
{console.log('there was an error');} break; }}for (var x = 0; x <
finalLinks.length; x++) { var outputLink = finalLinks[x]; if (finalLinks[x] != '')
{ var found = false; for (var y = 0; y < output.length; y++) { let checkedLink =
output[y].link; if (checkedLink.includes(outputLink)) { found = true; } } if (!
found) { output.push(new Output(finalLinks[x], names[x], moduleID, 'true',
videoHeaders)); } }}headers.push(new Header('', ''));extraInfo.push(new
ExtraInfo(''));episodeObject = new EpisodeObject('', '', headers, extraInfo, '',
'', output);var finalJson = JSON.stringify(episodeObject);savedData.innerHTML =
finalJson;", "output": [ { "link": "",
"linkIdentifier": "", "moduleID": "", "isDecodable": "false",
"headers": [ { "key": "key", "value":
"value" } ] } ] } ] }

You might also like