404 from download_url

I’m a rank beginner at Kaggle (but an experienced C# web programmer.) I am modifying the Is It A Bird notebook for practice.

As you can see in the screenshot, I can successfully download motorcycle pictures. I’m connected to the internet. Whenever I try to download a tricycle picture, however, I get a 404. I turned on debugging and, if I understand what I’m seeing, the URL in blue is the URL that generated the 404. However, when I paste that URL into my browser it returns an image. Very puzzling.

If I search for other kinds of pictures (unicycles, boats, forests…) the code cell runs fine. No error.

I did try searching the forums (everything about 404s while downloading is about data sets) and the download_url documentation (which doesn’t mention 404s.)

My working assumptions:

  • The container Kaggle is running for me can’t reach the tricycle URL even though my browser can. I don’t know why.
  • Download_url has no 404 error handling built in
  • I can fix the problem by writing my own wrapper for the download_url function that includes an exception handler for 404 errors

So that’s the direction I’m headed. I’d welcome further enlightenment.