mcdamo / tab-image-saver

Firefox addon to save images from open tabs
https://addons.mozilla.org/firefox/addon/tab-image-saver/
Mozilla Public License 2.0
40 stars 13 forks source link

Path Rule broken for this URL #76

Closed doio closed 2 years ago

doio commented 2 years ago

Just updated to the latest version 4.0.5 after I found out some images were saved _name_(1)._ext_.

However in previous versions, path rule ${host}/${tabTitle}.${ext||xExt||xMimeExt||"jpg"} works for the URL below:

https://mmbiz.qpic.cn/mmbiz_jpg/ria4P4s2qaIK8LoQG8Gp8iaayiaqib857fDICdXkyRicFcXO9W5liaqs4zjTf5weUof5vdVbMpnsI1kMj2z2aRY5GECg/0

The extension will save to my subfolder, "Saves" and create a folder mmbiz.qpic.cn and rename the image to what's displayed in the title, namely 0 (JPEG Image, 1080 × 810 pixels).jpg

With recent updates the rule stopped working and when I tested the image, Tab Image Saver prompts "Failed to generate paths", "Global Options", and then"Invalid filename generated: Saves/0"

I wonder if there's any workaround for this kind of URL? Is there a way to save the file by using name "ria4P4s2qaIK8LoQG8Gp8iaayiaqib857fDICdXkyRicFcXO9W5liaqs4zjTf5weUof5vdVbMpnsI1kMj2z2aRY5GECg" that's before "/0"?

mcdamo commented 2 years ago

The given rule works as you expect for that url and will create mmbiz.qpic.cn/0 (JPEG Image, 1080 × 810 pixels).jpg.

There was also a bug affecting the default path rules that may have contributed to the invalid filename error. This is fixed in v4.0.7

doio commented 2 years ago

Thanks! It's fixed now.