downthemall / anticontainer

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

ImgChill plugin broken #58

Closed poke closed 11 years ago

poke commented 12 years ago

avidone:

"Failed to extract URL" error message on ImgChilli galleries now Previously Downthemall with AntiContainer was successful at downloading galleries from ImgChilli. Now the "failed to extract..." error message is displayed. Can it be made to work again?

Migrated from https://bugs.downthemall.net/ticket/2204

mronq commented 11 years ago

I looked at the source code for the current imgchili plugin (had to download it from github - if I view the plugin details from DownloadThemAll preferences and click "Show Source Code", nothing happens). It is a resolver plugin that searches the source of the page and tries to find src="" tag right after id="show_image". The URL returned is what is inside the quotes for src="". For example, if the following is anywhere in the source page...

id="show_image" onload="scale(this);" onclick="scale(this);" src="http://image.jpg"

...http://image.jpg should be returned

It appears the "finder" regular expression in the plugin source code....

id=\"show_image\".*?src=\"(.+?)\"

.....is not accounting for newlines. For example, if this is in the source page....

id="show_image" onload="scale(this);" onclick="scale(this);" src="http://image.jpg"

....no URL will be returned. I tested it out in a regex evaluator and confirmed it doesn't return anything. If you update it to....

id=\"showimage\".?\n._?src=\"(.+?)\"

....it works.