GithubHelp home page GithubHelp logo

earthstarviewer's Introduction

Overview

Introduction

Comic Earth Star is a Japanese manga magazine. On their website they offer a glimpse into a lot of series by providing the first and the newest chapter for free. The chapters are available through a special manga reader, where they can be read as long as you have the ID to a chapter. And since chapters don't get deleted, but just aren't linked anymore, as long as you know where to look, you can still read them. In short, this project reverse engineered said manga reader to allow downloading of the images used to display the different pages.

Basics

The reader is available via this URL but won't work without an ID. Provided with an ID, the reader will load the pages, like this. The IDs themselves are just MD5 hash values of numbers, starting from 0. The lower numbers are made up of a lot of unused numbers but in higher numbers thise holes will shrink. At the point of publishing this README (Feb. 2023) the numbers are just below 3000.

Page load trace

When the viewer is first laoded it will make a call to the API, checking if it can find a series with the given ID. This can in reverse also be used to look for all existing series in the database. The API call looks like this, where the ID is the same MD5 hash value that is also used to identify the chapter. The API returns a URL which can then be used to load the configuration file for the manga chapter. This provides an overview over the contents of the chapter and details on every page. The base URL in combination with the details of the page can then be used to load the actual image of the page. However, as should be obvious, the image is totally scrambled and in no way readable.

Image reconstruction

While the image file itself is totally scrambled, the result in the viewer isn't, so obviously the viewer is able to reverse the image scrambling processs that was applied before the image was uploaded. And since the viewer is completely written in JavaScript it is pretty easy to search through the source code and find the relevant parts. This project uses said parts to reverse the scrambling and directly save the image to the hard drive in its original resolution.

Usage

To use this project to download one or multiple chapters simply include the file, set up an instance with a hash value and download the chapter:

require_once("EarthStarViewer/earthstarviewer.php");

$viewer = new EarthStarViewer("fc221309746013ac554571fbd180e1c8");
try {
	$viewer->download();
} catch(Exception $e) {
	var_dump(json_decode($e->getMessage()));
}

Be aware that an error will be thrown if the chapter can't be downloaded. See errors below for an explanation.

Errors

400

If the ID is not valid and no chapter can be found in the database, an error with the ID 400 will be returned.

404

This error will be returned if either the configuration file could not be loaded even though the API returns a URL for the given ID or if the URL in itself is not valid and doesn't point to a directory that could contain a configuration file. In both cases the chapter can not be downloaded.

earthstarviewer's People

Contributors

robbirobb avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.