ccloli / E-Hentai-Downloader

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

Any change this week? also wrong mime #159

Closed Hyoros closed 4 years ago

Hyoros commented 4 years ago

I’ve been using you script for a over 3 years to download galleries in 980/780p and sometimes modify things inside it. I usually encounter more image downloading error in when going for 980p and 1280p than 720p but nothing major. This month I start getting wrong MIME error for 2-4 pictures, still nothing big. Yesterday night I still can download a gallery without hitch in 780p. I wanted to download in full resolution by unchecking the Force box, then 2 things happened (I don’t remember which one happen first)

  1. the check mark on Force Download Original option won’t disappear even after save and refresh. I don’t know why so I try change sup>(2) in line 14158 into sup>(1) because that is the only difference I could find. It didn’t work and the check box change sill revert to normal after unchecking, save and refresh. But I don’t believe this is the culprit.
  2. I get MIME error for everything. In any resolution. For this MIME error I found https://github.com/ccloli/E-Hentai-Downloader/issues/104 You suspected that “user cookie is not sync”. I don’t believe this is not a problem since I don’t change my cookie setting for a while and this only happen yesterday. And I don't want to risk clearing up e-h cookies (but console check do return my UID).

So now I check back the script main page, which states this need GreaseMonkey 3.2*. I’m using 3. 1 all the time. Before attempting that, I backup the modified script , install the most recent version of E-Hentai-Downloader then everything works. Force Download box behave normally, no more MIME error in any resolution or native image resolution. Then just to make sure, I uninstall your new script again, reinstall my backup and the problem is back. So I conclude it is easier if I just apply my edit to your recent one. Which bring us back to my first question: do you make any change this week that might cause this? I can provide Console log if you are curious

:* in the script you mention "GreaseMonkey 3.2 beta 1 and older version can't load content of GM_xhr.response". When did GM 3.2 was released?

I don't know which version of your script that I used as base, I think I deleted the version number. Additional question: Will this script if I can't access E-H? I only use computer to browse EX/EH. My government block EH but not EX. I use proxy to visit E-H but this proxy doesn't work if I use my phone internet as modem (which I use yesterday when Image Resize problem started).

ccloli commented 4 years ago

Which version are you using? I pinned some issues that related to Wrong MIME (#153, #154, #155), which related to 2 reasons.

153 and #154 are due to E-Hentai's server update that returns incorrect Content-Type header (maybe on 1 Mar, you can check it on E-Hentai News page). Though it's not a bug of script properly, a specific "bugfix" (v1.31.6) is released on 2 Mar.

155 is related to suspended account, if your account is banned, it may shows Wrong MIME. To make it clear, v1.31.7 adds a new status Suspended which released on 11 Mar.

Which version are you using? Is your account blocked? A log file would helps me to find the problem. If you've modified the script, you may need some diff tools to compare changes.

------------------ Original ------------------ From: "Hyoros"notifications@github.com Date: Sun, Apr 26, 2020 12:21 PM To: "ccloli/E-Hentai-Downloader"E-Hentai-Downloader@noreply.github.com; Cc: "Subscribed"subscribed@noreply.github.com; Subject: [ccloli/E-Hentai-Downloader] Any change this week? also wrong mime(#159)

I’ve been using you script for a over 3 years to download galleries in 980/780p and sometimes modify things inside it. I usually encounter more image downloading error in when going for 980p and 1280p than 720p but nothing major. This month I start getting wrong MIME error for 2-4 pictures, still nothing big. Yesterday night I still can download a gallery without hitch in 780p. I wanted to download in full resolution by unchecking the Force box, then 2 things happened (I don’t remember which one happen first)

the check mark on Force Download Original option won’t disappear even after save and refresh. I don’t know why so I try change sup>(2) in line 14158 into sup>(1) because that is the only difference I could find. It didn’t work and the check box change sill revert to normal after unchecking, save and refresh. But I don’t believe this is the culprit. 2 I get MIME error for everything. In any resolution. For this MIME error I found #104 You suspected that “user cookie is not sync”. I don’t believe this is not a problem since I don’t change my cookie setting for a while and this only happen yesterday. And I don't want to risk clearing up e-h cookies (but console check do return my UID).

So now I check back the script main page, which states this need GreaseMonkey 3.2. I’m using 3. 1 all the time. So I now make backup your modified script , installing the most recent version of E-Hentai-Downloader and everything works. Force Download box behave normally, no more MIME error in any resolution or native image resolution. Then just to make sure, I uninstall your new script again, reinstall my backup and the problem is back. So I conclude it is easier if I just apply my edit to your recent one. Which bring us back to my first question: do you make any change this week that might cause this? I can provide log if you are curious

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or unsubscribe.

ccloli commented 4 years ago

the check mark on Force Download Original option won’t disappear even after save and refresh.

Did you mean "Force download resized images"? If yes it should be a bug, will check it later this day.

Will this script if I can't access E-H?

Nope, the script needs a mostly stable connection to E-Hentai and most of H@H nodes.

Hyoros commented 4 years ago

Thank you for quick response. I read your remark in https://github.com/ccloli/E-Hentai-Downloader/issues/153 that this error is fixed in v1.31.6. I will still make a log just in case I will use https://e-hentai.org/g/1489090/03607b2909/ for this log

https://pastebin.com/ZE7qCmnk I didn't check log yesterday. Look like this is about that incorrect Content-Type. So maybe same as #153 and #154

Hyoros commented 4 years ago

e-hentai-downloader.user.txt

Hyoros commented 4 years ago

And that "Force download resized" persistent checked box only apply to my modified version. No problem with the latest.

ccloli commented 4 years ago
[EHD] Index > 1  | RealIndex > 1  | Name > 75067257_p0_.jpg  | RetryCount > 1  | DownloadedCount > 0  | FetchCount > 4  | FailedCount > 0 e-hentai-downloader.user.js:12711:2
[EHD] #1: Wrong Content-Type e-hentai-downloader.user.js:13224:6
[EHD] #1: RealIndex > 1  | ReadyState > 4  | Status > 200  | StatusText > OK

Well, your modified script doesn't print response header, which should be print and that helps debug. Here is the latest source code around that log outputs (formatted):

console.log('[EHD] #' + (index + 1) + ': Wrong Content-Type');
console.log(
    '[EHD] #' + (index + 1) + ': RealIndex >', imageList[index]['realIndex'],
    ' | ReadyState >', res.readyState,
    ' | Status >', res.status,
    ' | StatusText >', res.statusText +
    '\nRequest URL >', requestURL,
    '\nFinal URL >', res.finalUrl,
    '\nResposeHeaders >' + res.responseHeaders
);

And I use git blame to track when I added this line and determine which version you're using, finally stopped at v1.18.6 and cannot track anymore. So looks like you're using a very old version, which must be older than v1.18.4 which released on 21 Oct 2015.

Well... Looks like your GreaseMonkey doesn't print the next line, maybe needs some time to check which version you're using.

How many changes did you make? It may be a big tough to migrate the changes.

ccloli commented 4 years ago

Well... Looks like your GreaseMonkey doesn't print the next line, maybe needs some time to check which version you're using.

Anyway, if you modified your script before Mar 2020 and doesn't update it, it may related to #153. If you've made some changes, you need to find a most-like version, and use git or something else to migrate your changes.

Hyoros commented 4 years ago

How many changes did you make? It may be a big tough to migrate the changes.

Just some text placeholder, colors and position of "Download Archive" box and "number images". Nothing big, I will just modify the latest version.

Hyoros commented 4 years ago

I just apply response header now

[EHD] E-Hentai   Downloader is running. e-hentai-downloader.user.js:40:1
[EHD] Bugs Report >   "https://github.com/ccloli/E-Hentai-Downloader/issues \|   https://greasyfork.org/scripts/10379-e-hentai-downloader/feedback"   e-hentai-downloader.user.js:41:1
[EHD] To report a bug, it's recommended   to provide the logs started with "[EHD]", thanks. =w=   e-hentai-downloader.user.js:42:1
[EHD] UserAgent > Mozilla/5.0 (Windows   NT 10.0; Win64; x64; rv:42.0) Gecko/20100101 Firefox/42.0   e-hentai-downloader.user.js:12308:1
[EHD] Script Handler > GreaseMonkey   e-hentai-downloader.user.js:12309:1
[EHD] Script Handler Version > 3.11   e-hentai-downloader.user.js:12310:1
[EHD] E-Hentai Downloader Version > 1   e-hentai-downloader.user.js:12311:1
[EHD] Current URL >   "https://e-hentai.org/g/1489090/03607b2909/"   e-hentai-downloader.user.js:12312:1
[EHD] Is Logged In > true   e-hentai-downloader.user.js:12313:1
[EHD] E-Hentai Downloader Setting >   {"thread-count":4,"timeout":26,"speed-detect":false,"speed-min":30,"speed-expired":30,"retry-count":2,"number-images":true,"number-real-index":true,"number-auto-retry":false,"auto-download-cancel":true,"dir-name":"/","file-name":"{gid}","recheck-file-name":false,"ignore-torrent":true,"status-in-title":"always","hide-image-limits":false,"hide-estimated-cost":false,"file-descriptor":false,"force-resized":false,"never-new-url":false,"store-in-fs":false,"play-silent-music":false,"save-info":"none","save-info-list":["title","metas","uploader-comment","page-links"],"save-info-list[]":false,"replace-with-full-width":false,"force-pause":false}   e-hentai-downloader.user.js:12275:1
[EHD] Request Image Limits From   e-hentai.org e-hentai-downloader.user.js:14254:2
[EHD] #4: Wrong Content-Type   e-hentai-downloader.user.js:13224:6
[EHD] #4: RealIndex > 4  \| ReadyState > 4  \| Status > 200  \| StatusText > OK
[EHD] Index > 4  \| RealIndex > 4  \| Name > 75067257_p3_.jpg  \| RetryCount > 0  \| DownloadedCount > 0  \| FetchCount > 4  \| FailedCount > 0   e-hentai-downloader.user.js:12711:2
[EHD] #4: Wrong Content-Type   e-hentai-downloader.user.js:13224:6
[EHD] #4: RealIndex > 4  \| ReadyState > 4  \| Status > 200  \| StatusText > OK
[EHD] Index > 4  \| RealIndex > 4  \| Name > 75067257_p3_.jpg  \| RetryCount > 1  \| DownloadedCount > 0  \| FetchCount > 4  \| FailedCount > 0   e-hentai-downloader.user.js:12711:2

The console looks like this, then this Wrong Content-Type paragraphs repeat again for each picture. Did I do this right?

ccloli commented 4 years ago

Well, if you just modified your old version, then no, maybe you should copy your changes to the latest version (you can use git to determine what has been changed). For example, you can git clone the repo and open the folder with Visual Studio Code, then open e-hentai-dowloader.user.js and select all, paste your modified version, save. Then you can see a helpful diff map that helps you to migrate.

If you still prefer to modified based on your modified version, make sure you've add this change.

Hyoros commented 4 years ago

I will do the first suggestion. This might take few hours. I open that git link and I feel dejavu. I install it, keep clicking yes many times and something that look like cmd console appear. This is intimidating. I find tutorial in youtube that I this git is suppose to help VS Code. Is this more thing I have to install? Okay I:m getting into VSC now. Not sure if git is required for this since this already highlight the change for me.

ccloli commented 4 years ago

Yeah, it may take some time to do it manually, here are some tips, HTH:

  1. You need to download and install Git from https://git-scm.com , and VSCode from https://code.visualstudio.com/;

  2. Run git clone https://github.com/ccloli/E-Hentai-Downloader.git, once it's done, you can see an E-Hentai-Downloader folder;

  3. Open VSCode, and drag E-Hentai-Downloader folder on to the window;

  4. Select e-hentai-downloader.user.js from the file list panel on the left;

  5. Select all, paste your modified script, then save;

  6. Switch to Git tab, if everything fines, you can see a modified file e-hentai-downloader.user.js, click the file name;

  7. You'll see a diff map side-by-side, so that you can check what's change (left panel is the lastest version code, right panel is your modified code, red line means deleted, green line means added). You can copy the source code from left panel to right panel to update your version.

    BTW you can safely copy the first ~12,000 lines from left to right (determine var zip; is on which line), those are just libraries.

    Note: VSCode may format your source code, if you see A LOT changes before first ~12,000 lines are about coding style, the code might be formatted. You should click right panel, select all source code, paste your modified script again, and press Ctrl + Z to revert the prettify, then save, so that the first ~12,000 should be no changes or much lesser than before. If it's not working, open e-hentai-downloader.user.js with Notepad (notepad.exe), then select all, paste and save.

    image

  8. Once everything is done, press the plus icon (+) next to file name to stage, type some commit message on the left top and click the mark (√) icon to commit your changes. Next time when a new version release, you can run git pull on that folder, git will automatic merge the changes (if you see CONFLICT message, open it with VSCode and solve them, save, stage, and commit for the next update).

ccloli commented 4 years ago

Well, VSCode has integrated Git, and it helps you to use Git easily, however you still needs to clone the repo with Git.

Hyoros commented 4 years ago
<div class="g2"><label><input type="checkbox" checked data-ehd-setting="force-resized"> Force download resized image (never download original image) </label><sup>(2)</sup></div>\

See that checked ? I believe I found our culprit. I hard put these checks into the script so I don't have to readjust if I need to move to another computer. Gonna have dinner now.

ccloli commented 4 years ago

Hmm, if you hard-encoded checked in template, then it's always be checked, since the script only set checked attribute if the option is enabled, but won't remove it if it's disabled. Also hard-encoded checked in template doesn't means the script will "read" it, so the value should still be false by default until once you save the setting (sorry the script doesn't have a default setting).

Hyoros commented 4 years ago

so the value should still be false by default until once you save the setting (sorry the script doesn't have a default setting).

Oh. Okay, I just need to remove these checked s. And finished. I finished migrating my old cosmetic changes to new script and I see your new cost calculation is more accurate now. In the old version I had to convert the size into MB then multiply it by 5 lol.

You have accompany me for 7 hours now. Today was challenging but I left with new skill. I really thank you for taking your time to help me even though the problem turned out to be simple. Again thank you.