Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // E-Hentai JSON API v1 ---------------------
- /*
- URL: http://g.e-hentai.org/api.php
- CORS: Enabled ( http://enable-cors.org/ )
- Request: JSON data encoded in UTF-8
- Response: JSON data encoded in UTF-8, gzipped
- Current features:
- * Gallery token lookup with page URL & gallery ID
- * Gallery metadata lookup with gallery IDs & tokens
- */
- // Example API JSON request & code (token list) ----------------------
- var token_request, token_response;
- token_request = {
- "method": "gtoken",
- "pagelist": [
- [519366,"9ea977f01f",7],
- [519316,"c470d6f268",6],
- [519313,"867b2e6664",8]
- ]
- };
- var xhr_token = new XMLHttpRequest();
- xhr_token.open('POST', 'http://g.e-hentai.org/api.php');
- xhr_token.setRequestHeader('Content-Type', 'application/json');
- xhr_token.onreadystatechange = function () {
- if(xhr_token.readyState === 4 && xhr_token.status === 200) {
- token_response = JSON.parse(xhr_token.responseText);
- }
- }
- xhr_token.send(JSON.stringify(token_request));
- // (Formatted) JSON response from the API (token list) ---------------
- {
- "tokenlist":[
- {
- "gid":519366,
- "error":"File not found"
- },
- {
- "gid":519316,
- "token":"1c4564cf7c"
- },
- {
- "gid":519313,
- "token":"41610cd7ff"
- }
- ]
- }
- // Example API JSON request & code (gallery metadata) ------------------------
- var gid_request, gid_response;
- gid_request = {
- "method": "gdata",
- "gidlist": [
- [519325,"20f88fa1cd"],
- [519316,"1c4564cf7c"],
- [519313,"41610cd7ff"]
- ]
- };
- var xhr_gid = new XMLHttpRequest();
- xhr_gid.open('POST', 'http://g.e-hentai.org/api.php');
- xhr_gid.setRequestHeader('Content-Type', 'application/json');
- xhr_gid.onreadystatechange = function () {
- if (xhr_gid.readyState === 4 && xhr_gid.status === 200) {
- gid_response = JSON.parse(xhr_gid.responseText));
- }
- }
- xhr_gid.send(JSON.stringify(gid_request));
- // (Formatted) JSON response from the API (gallery metadata) -----------------
- {
- "gmetadata":[
- {
- "gid":519325,
- "error":"Key missing, or incorrect key provided."
- },
- {
- "gid":519316,
- "token":"1c4564cf7c",
- "archiver_key":"373790--0ebe43b7e0195329d358c0c1e2091393b65875bb",
- "title":"(C82) [Itou Life] Courteous Utsuho (Touhou Project) (ENG)",
- "title_jpn":"(C82) [伊東ライフ] ねんごろうつほ (東方Project)",
- "category":"Doujinshi",
- "thumb":"http://gt0.ehgt.org/84/ac/84ac5aea499217c366fc7a68fd4092d23c3eb0e2-800167-1407-2000-jpg_l.jpg",
- "uploader":"bobby tod",
- "posted":"1345454172",
- "filecount":"23",
- "filesize":22650578,
- "expunged":false,
- "rating":"4.75",
- "torrentcount":"1",
- "tags":[
- "itou life",
- "english",
- "touhou project",
- "translated",
- "big breasts",
- "utsuho reiuji",
- "c82",
- "x-ray"
- ]
- },
- {
- "gid":519313,
- "token":"41610cd7ff",
- "archiver_key":"373790--6240c1d5e730e8f38364021c9ad0d6397a63683f",
- "title":"(C82) [Shadow Sorceress Communication Protocol (Hiten Onee-Ryuu)] Sugoku Amai Onegai (Sword Art Online) [English]",
- "title_jpn":"(C82) [影法師通訊協定 (飛天御姉流)] スゴクアマイオネガイ (ソードアート・オンライン)",
- "category":"Doujinshi",
- "thumb":"http://gt2.ehgt.org/a4/0d/a40d00dba45663fbc752162d8060c3225da59f71-532312-1045-1500-jpg_l.jpg",
- "uploader":"woootskie",
- "posted":"1345453165",
- "filecount":"23",
- "filesize":13841204,
- "expunged":false,
- "rating":"4.74",
- "torrentcount":"1",
- "tags":[
- "sword art online",
- "english",
- "shadow sorceress communication protocol",
- "translated",
- "hiten onee-ryuu",
- "asuna yuuki",
- "c82"
- ]
- }
- ]
- }
- // --------------------------------------------------------------
Advertisement
Add Comment
Please, Sign In to add comment