downthemall / anticontainer

DownThemAll! AntiContainer (Extension to a Firefox, Seamonkey extension)
Mozilla Public License 2.0
93 stars 41 forks source link

Anticontainer for imgur albums broken. #129

Closed pxssy closed 6 years ago

pxssy commented 7 years ago

Your DownThemAll! and Browser Version and Language and Operating System

DTA 3.0.8, Waterfox 48.0, English, Mac OSX 10.7.5 Expected Behavior

Anticontainer takes in an album link, and seperately downloads individual pictures of the album. Actual Behavior

If album contains >10 pictures, Anticontainer only extracts out the 1st 10 pictures of the album. Steps To Reproduce

I have yet to understand why this happens, and it seems to only occur when using the selection window, does not occur when adding the link in directly. Although, this may persist even when adding links directly to the download queue. I believe the problem lies with imgur, only loading the first 10 images of the album and having a seperate javascript request for more.

I would fix the anti-container, only i knew how to code Additional info such as log extracts

http://pastebin.com/q7KMrwDF

Tried to download https://www.reddit.com/r/SNSD/comments/59b2n2/sunny_compilation_album/, via r-clicking the link and saving the link. Not sure what the log can illuminate, but i deleted the irrelevant parts, but at the last few lines are some process saying it has extracted 10 links. Now you may go to the album itself and find that it's actually 4000 pictures large, not 10.

As a followup, I relogged it extracting all 4000 images of the same album, now adding it in as a direct download.

http://pastebin.com/dhszKvWU

I must note, i did not change anything, just the method of adding the download, This way however, extracts the proper 4053 images instead of just 10.

poke commented 7 years ago

Thank you for the detailed report! That is certainly a very odd thing you are seeing there. According to the log, in both cases, the imgur album plugin is correctly called, and in both cases the album URL is the same.

You are right that the normal Imgur web site will only load the first 10 images, requiring you to make another request to load the rest, but the plugin actually uses a different approach: It uses a separate URL that is supposed to give out links to all images at once. And usually that should work fine, and there certainly shouldn’t be a difference depending on how you added the album link to DTA…

I’ve tried reproducing this but I couldn’t find a way to only get those 10 images. Can you reliably reproduce the problem?

pxssy commented 7 years ago

Not sure whether i should reply this email, or not.

I think i have isolated it how and why it happens. Not sure how to explain, but it seems that when you grab imgur links from reddit, it tags reddit as the referer, and it summons up the page where u have only 10 previews + script to load more, and dta is just loading those 10.

Whereas if you had directly entered the link, the referer would be blank and all images of the album will load correctly on 1st try.

This is probably where it gets complicated because from trial and error i've done, cookies can still mess this up, ie. Even if you entered the link, without the referer, but somehow you've opened the link before as the reddit refered one, you will still get 10 images only. Clearing cookies every time imgur opens is very tedious and i'm not particularly clear what's happening there either.

album accessed from reddit/with reddit referer: http://i.imgur.com/ePmpFnS.png

album accessed with blank referer: http://i.imgur.com/DbrEqrq.png

There's some difference, despite the same link, noticeably the fact that the style on the right hand side, it knows whether you've been sent from reddit or not, and gives u the reddit refered site or not. And the difference is of course having 10 or all images loaded. just check the scrollbar.

The images are missing because i've got a plugin that stops images from loading automatically.

On Sat, Oct 29, 2016 at 3:40 AM, Patrick Westerhoff < notifications@github.com> wrote:

Thank you for the detailed report! That is certainly a very odd thing you are seeing there. According to the log, in both cases, the imgur album plugin is correctly called, and in both cases the album URL is the same.

You are right that the normal Imgur web site will only load the first 10 images, requiring you to make another request to load the rest, but the plugin actually uses a different approach: It uses a separate URL that is supposed to give out links to all images at once. And usually that should work fine, and there certainly shouldn’t be a difference depending on how you added the album link to DTA…

I’ve tried reproducing this but I couldn’t find a way to only get those 10 images. Can you reliably reproduce the problem?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/downthemall/anticontainer/issues/129#issuecomment-257010236, or mute the thread https://github.com/notifications/unsubscribe-auth/AV_4Ss9eVH6PQlnyDKb52XTYHHSCCJ5uks5q4k-8gaJpZM4Kgrox .

pxssy commented 7 years ago

i've tried to work around this, by removing the referer on all album links before they go thru the anti-container, but like i've said, this isn't failproof because of cookies.

pxssy commented 7 years ago

Any success recreating it?

poke commented 7 years ago

Unfortunately no. What you explain makes sense for the website version, since there, the web application might only show 10 items at a time, offering to load the rest of them.

However, for the anticontainer plugin, we are using a separate web service that should always return all items in the gallery, regardless of cookies or something else. And it indeed works properly for all my test cases :/

I’ll try to reproduce this later, but currently, I don’t have a lot of hope for it. Did that problem reappear for any other gallery than the one you linked?

pxssy commented 7 years ago

Sorry it was harder that i thought to find an album that has this problem, that isn't nsfw.

https://puu.sh/sCy7I/c25785d95f.mp4

Currently downloading stuff using dTA and it gets triggered badly if i try do so anything with it now. Here's a demo of what i mean on chrome. If instead of right-click opening new tab, you used the link-save option, You'd get 10 images. However, if you copied the link and pasted it on the download manager page, you get all 44.

pxssy commented 7 years ago

I tried it on a dummy subreddit i made, and i manage to reproduce it, it seems to depend on whether imgur has page for that subreddit, which for my dummy subreddit, imgur doesn't.