Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
s94285 opened this issue Jun 11, 2024 · 2 comments
Closed

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

s94285 opened this issue Jun 11, 2024 · 2 comments
Labels

Comments

@s94285
Copy link

s94285 commented Jun 11, 2024

開啟 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
Copy link
Owner

ccloli commented Jun 13, 2024

有關 Source Nexus 的討論,已經在 #244 中提到過了,如果需要的話,可以在 issue 中檢索 Source Nexus。

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

  • 按照你目前的配置,每次載入圖片均會有 1 點的 image limits 消耗
  • 開啟 Source Nexus 時,若加載的是原始圖片(也就是小於 10MB,一年以上小於 4MB),將會按每 0.1MB 扣除 1 點(即便文件比較小,小到不開 Source Nexus 時也能加載原圖,也會再累加文件大小的點數扣除)
  • 開啟 Source Nexus 時,若加載的是壓縮圖片(也就是大於 10MB,一年以上大於 4MB),則不會再有基於文件大小的扣除
  • 無論是否開啟 Source Nexus,只要頁面展示的是壓縮圖片,則必然會有下載原始圖片的鏈接,訪問該連接將會按常規的 peak hours 與 90 天規則計算,視情況扣除 image limits 或 GPs

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

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

@s94285
Copy link
Author

s94285 commented Jun 13, 2024

感謝回覆,說明得很詳細

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

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

@s94285 s94285 closed this as completed Jun 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants