View Single Post
Old 03-16-2013, 04:19 AM   #3
tuxor
Addict
tuxor is kind to children and small, furry animalstuxor is kind to children and small, furry animalstuxor is kind to children and small, furry animalstuxor is kind to children and small, furry animalstuxor is kind to children and small, furry animalstuxor is kind to children and small, furry animalstuxor is kind to children and small, furry animalstuxor is kind to children and small, furry animalstuxor is kind to children and small, furry animalstuxor is kind to children and small, furry animalstuxor is kind to children and small, furry animals
 
Posts: 319
Karma: 6809
Join Date: Oct 2011
Location: Germany
Device: Onyx Boox M92, Icarus Illumina E653
Quote:
Originally Posted by kovidgoyal View Post
Merged.
Thanks.

Quote:
Originally Posted by kovidgoyal View Post
I'm not comfortable with the replace('..', '.') there may be other palces in the url where .. is needed and since the .. does not cause any actual problems, its safer to leave it in.
I understand your concerns, but yes, it does cause actual problems. Look at this:

Code:
http://g-ecx.images-amazon.com/images/G/03/ciu/80/50/1b46f96642a0b333ce906110.L._AA300_.jpg
becomes
http://g-ecx.images-amazon.com/images/G/03/ciu/80/50/1b46f96642a0b333ce906110.L..jpg
But the link with the double points doesn't work!

Please do at least something like this:

Code:
                    sparts = bn.split('_')
                    if len(sparts) > 2:
                        bn = (sparts[0] + sparts[-1]).replace("..jpg",".jpg")
                        return ('/'.join(parts[:-1]))+'/'+bn
EDIT: By the way, this is that book's amazon details page: http://www.amazon.de/Bertelsmann-Jug...3422572&sr=8-1

Last edited by tuxor; 03-16-2013 at 04:29 AM.
tuxor is offline   Reply With Quote