Skip to content

Commit

Permalink
Manga OnlineViewer CE 2014.8.27
Browse files Browse the repository at this point in the history
- 修正 nHentai 图片无法正确加载的问题
- 尝试解决 imanhua 的图片盗链问题,未成功
  • Loading branch information
ywzhaiqi committed Aug 27, 2014
1 parent 77530eb commit a3d48f2
Showing 1 changed file with 31 additions and 21 deletions.
52 changes: 31 additions & 21 deletions .修改版/Manga_OnlineViewer_CE.user.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// @description Shows all pages at once in online view. MangaFox, MangaReader/MangaPanda, MangaStream, MangaInn, AnyManga, AnimeA, MangaHere, MangaShare, Batoto, MangaDevil, MangaCow, MangaChapter, 7manga, MangaPirate.net and MangaBee/OneManga.me manga sites. Fakku, HBrowse, Hentai2Read and Doujin-moe Hentai sites.
// version 9.02
// date 2014-08-04
// @version 2014.8.21.1
// @version 2014.8.27.1
// @author Tago
// @modified ywzhaiqi
// @namespace https://greasyfork.org/users/1849-tago
Expand Down Expand Up @@ -714,6 +714,7 @@ mConsole("Starting Manga OnlineViewer");
quant: $('#pageSelect option:last').attr('value'),
prev: "#",
next: "#",

before: function() { // 加上下一章和上一章的链接
function run() {
function getChapterUrl(callback) {
Expand Down Expand Up @@ -741,28 +742,37 @@ mConsole("Starting Manga OnlineViewer");
},
page: function (i) {
var pVars = unsafeWindow.pVars,
cInfo = unsafeWindow.cInfo,
arr = [],
curServNum = pVars.curServ,
serverUrl = getServerUrl(),
midUrl = cInfo.cid > 7910 ? "/Files/Images/" + cInfo.bid + "/" + cInfo.cid + "/" : "",
name,
image_source;
cInfo = unsafeWindow.cInfo
arr = [];

// 获取下 html 页面,防止盗链?结果无效
// var nextPage = cInfo.burl + '?p=' + (i + 1)
// getHtml(nextPage, function(html){
// console.log('获取', nextPage)
// });

getAndAdd(i);

name = encodeURI(cInfo.files[i - 1]);
image_source = "http://" + serverUrl + midUrl + name;
addImg(i, image_source);
function getAndAdd(i) {
var curServNum = pVars.curServ,
serverUrl = getServerUrl(),
midUrl = cInfo.cid > 7910 ? "/Files/Images/" + cInfo.bid + "/" + cInfo.cid + "/" : "";

function getServerUrl(n) {
if (n = n || !1, n === !1) arr.push(curServNum);
else {
var t = Math.floor(Math.random() * pVars.priServ);
if ((',' + arr.toString() + ',') .indexOf(',' + t + ',') == - 1) arr.push(t),
curServNum = t;
else if (arr.length >= pVars.priServ) curServNum = pVars.priServ;
else return getServerUrl(!0)
var name = encodeURI(cInfo.files[i - 1]);
var image_source = "http://" + serverUrl + midUrl + name;
addImg(i, image_source);

function getServerUrl(n) {
if (n = n || !1, n === !1) arr.push(curServNum);
else {
var t = Math.floor(Math.random() * pVars.priServ);
if ((',' + arr.toString() + ',') .indexOf(',' + t + ',') == - 1) arr.push(t),
curServNum = t;
else if (arr.length >= pVars.priServ) curServNum = pVars.priServ;
else return getServerUrl(!0)
}
return pVars.servs[curServNum].host
}
return pVars.servs[curServNum].host
}
},
};
Expand Down Expand Up @@ -1403,7 +1413,7 @@ mConsole("Starting Manga OnlineViewer");
url: function(i) {
return "../" + i + "/";
},
img: '#page-container p a img'
img: '#image-container img'
};
}
// == FoOlSlide ========================================================================================================================
Expand Down

0 comments on commit a3d48f2

Please sign in to comment.