How can I download just thumbnails using youtube-dl?

TheOlDirtyBastard picture TheOlDirtyBastard · Sep 21, 2016 · Viewed 23.5k times · Source

I've been trying to download the thumbnails of a list of URL's (youtube videos) I have.

I've been using youtube-dl and I've worked it out to this so far:

     import os

     with open('results.txt') as f:
          for line in f:
              os.system("youtube-dl " + "--write-thumbnail " + line)

Like this I'm able to download the thumbnails but I'm forced to downloading the youtube videos as well.

How can I just download the thumbnail?

Answer

Nicholas A. Randall picture Nicholas A. Randall · Sep 4, 2017

You can simply add --skip-download to your code and it will work fine. Like so:

with open('urls.txt') as f:
for line in f:
    os.system("youtube-dl "+"--write-thumbnail "+"--skip-download "+line)