开发者

Download image and mime type

开发者 https://www.devze.com 2023-02-12 05:24 出处:网络
I have a scraper that downloads favicons I now download the icon, then do a check for the filetype of the file.

I have a scraper that downloads favicons

I now download the icon, then do a check for the filetype of the file.

However.............. someone else indicated it might be smarter to check the mimetype while downloading.

I just don't feel comfortable with it: IS the mimetype ALWAYS correct when downloading the favicon from the web OR does an extra check ALWAYS need to take place on the physical file?

  • obviously for the google s2 favicons it is always png so these can be discarded
  • even for /favicon.ico in the root there are people who clearly do not understand and rename a favicon.png to .开发者_StackOverflowico and place it in the root....
  • yes... I should run a large scraping action and find out if mime type is always correct and will do so but unfortunately i am not google and did not have time to scrape millions of sites to find out the answer so I hope someone out there with the expertise has this knowledge. So Im in the coding phase not the testing phase. So i could do this afterwards but maybe it is nice to check before testing. But maybe you are right and i should not post this queston now but only after testing this.


Humans make mistakes. Websites are built by humans. Therefore mistakes will be made with the mime type for favicons.

0

精彩评论

暂无评论...
验证码 换一张
取 消