ccloli / E-Hentai-Downloader

Download E-Hentai archive as zip file
GNU General Public License v3.0
1.87k stars 138 forks source link

希望添加 Hath Perks Source Nexus 支援 #289

Closed s94285 closed 3 months ago

s94285 commented 3 months ago

開啟 Hath Perks 的 Source Nexus 後瀏覽任何 4MB 以內原始圖片都不會消耗GP image 然而目前的腳本下載會直接找 fullimg 下載,即便開啟Prefer Original Image下載也會消耗GP

方便的話希望可以優先搜尋 hath.network 下的圖片路徑 下面是我所修改的部分,包含imageURLorignalImagePattern 以2019年的圖檔測試,在尖峰時間下載709張4MB以內原圖只消耗6500左右Image Limit,並沒有消耗GP 謝謝您的腳本

var ehDownloadRegex = {
    imageURL: [
        ///<a href="(\S+?\/fullimg(?:\.php\?|\/)\S+?)"/,
        /<img id="img" src="(\S+?)"/,
        /<\/(?:script|iframe)><a[\s\S]+?><img src="(\S+?)"/ // Sometimes preview image may not have id="img"
    ],
    nextFetchURL: [
        /<a id="next"[\s\S]+?href="(\S+?\/s\/\S+?)"/,
        /<a href="(\S+?\/s\/\S+?)"><img src="https?:\/\/ehgt.org\/g\/n.png"/
    ],
    preFetchURL: /<div class="sn"><a[\s\S]+?href="(\S+?\/s\/\S+?)"/,
    nl: /return nl\('([\d\w-]+)'\)/,
    fileName: /g\/l.png"\s?\/><\/a><\/div><div>([\s\S]+?) :: /,
    resFileName: /filename=['"]?([\s\S]+?)['"]?$/m,
    dangerChars: /[:"*?|<>\/\\\n]/g,
    pagesRange: /^(!?\d*(-\d*(\/\d+)?)?\s*,\s*)*!?\d*(-\d*(\/\d+)?)?$/,
    pagesURL: /(?:<a href=").+?(?=")/gi,
    mpvKey: /var imagelist\s*=\s*(\[.+?\]);/,
    imageLimits: /You are currently at <strong>(\d+)<\/strong> towards a limit of <strong>(\d+)<\/strong>/,
    pagesLength: /<table class="ptt".+>(\d+)<\/a>.+?<\/table>/,
    IPBanExpires: /The ban expires in \d+ hours?( and \d+ minutes?)?/,
    donatorPower: /<td>Donations<\/td><td.*>([+-]?[\d\.]+)<\/td>/,
    postedTime: /<td.*?>Posted:<\/td><td.*?>(.*?)<\/td>/,
    categoryTag: /g\/c\/(\w+)\./,
    slashOnly: /^[\\/]*$/,
    originalImagePattern: /\/hath\.network(?:\.php\?|\/)/
    //originalImagePattern: /\/fullimg(?:\.php\?|\/)/
};
ccloli commented 3 months ago

有關 Source Nexus 的討論,已經在 https://github.com/ccloli/E-Hentai-Downloader/issues/244 中提到過了,如果需要的話,可以在 issue 中檢索 Source Nexus。

如果你不想看的話,直接說結論吧(雖然結論已經記錄在 wiki 了):

所以,你的修改只是相當於永遠取頁面顯示的圖片而已,而不考慮其是否真的是原始圖片。對於你的這個場景,只需在 Advanced 開啟 Force download resized image (never download original image) 即可。

如果頁面展示了原始圖片的鏈接,同時展示的也是原始圖片,則多半是 bug,可以考慮回報給 Tenboro。

s94285 commented 3 months ago

感謝回覆,說明得很詳細

所以,你的修改只是相當於永遠取頁面顯示的圖片而已,而不考慮其是否真的是原始圖片。對於你的這個場景,只需在 Advanced 開啟 Force download resized image (never download original image) 即可。

目前這個功能就可以滿足我的使用場景了 謝謝您