doubleplusc / Line-sticker-downloader

89 stars 26 forks source link

Not all product info meta URL is the same #4

Open leledumbo opened 7 years ago

leledumbo commented 7 years ago

Currently the product info meta URL is hardcoded to:

http://dl.stickershop.line.naver.jp/products/0/0/1/{}/android/productInfo.meta

from which {} will be replaced by sticker ID. However, some stickers, such as the one with ID 884, has product info meta URL of:

http://dl.stickershop.line.naver.jp/products/0/0/12/{}/android/productInfo.meta

there are still other different ones besides 12. However, I haven't figured out how to get that number or even simply knowing what it means. As a silly workaround, you might want to retry up to some reasonable constant (25? 99?), except if you already know how to get that number of course.

doubleplusc commented 7 years ago

Yes, I've noticed this problem a while ago. I believe it's not just the second to last number that can be different for some stickers. Older sticker sets had slightly different product metadata, and the URL could be a able to "version" the different formats.

I'm thinking of eventually adding an offline database function to the script, and it'd be an interesting opporunity to get a detailed look at what causes the different URLs. I haven't really seen a pattern to the numbers either, so any failed downloads that result from this have to be looked at on a case-by-case basis as issues come up. Alternatively, one of these days I just start at sticker pack 1 and increment all the way up to the current number, but I don't think there are enough exceptions that it'll be necessary.