title: How to gracefully handle YouTube thumbnail broken images when videos are taken down?
body: <p>Our site contains some lists of YouTube videos with their thumbnails linked to the movies themselves. We fetch the thumbnail URLs from the YouTube API, and hotlink to them in situ on YouTube's servers. So our image tags look like:</p>
  
  <pre><code>&lt;img src="http://i.ytimg.com/vi/o6CHqSN7O-o/2.jpg" alt="" width="133" height="78" /&gt;
  </code></pre>
  
  <p>The problem is that sometimes a video gets removed -- and so does the thumbnail. We don't know when that might happen, and our thumbnails just turn into broken images. How can we handle this?</p>
  
  <p>There are a number of solutions:</p>
  
  <ul>
  <li><p>Download thumbnails and store them locally -- movie won't work if it gets removed, of course, but that's ok, it will explain it was removed, and we avoid the broken image.</p></li>
  <li><p>Check periodically with the API to see if the image thumbnail has changed -- if it no longer exists, substitute our own "movie removed" thumbnail. This is pretty heavy on the API calling! </p></li>
  <li><p>Use JavaScript to replace broken images (don't like this one much)</p></li>
  </ul>
  
  <p>Our ideal solution would be to point the img src to a location on YouTube that would display a friendly "move removed" image when a movie goes down. However, that doesn't seem to exist.</p>
  
  <p>Anyone else dealt with this? Thanks!</p>