reddit will try to pull the thumbnail from any source, not just the image URL. This is done, firstly, by setting rules for certain sites, and secondly, using one generic process to retrieve thumbnails for unknown URLs and this is an automatic periodic task .
One of the (advantages) of reddit is that the source code is open , and if you understand Python, you should check /r2/lib/scraper.py for a more detailed look at how this process works.
Also, while StackOverflow is a great place to answer programming questions, you can also check reddit's own / r / redditdev for information on developing reddit.

gpmcadam
source share