Socket
Socket
Sign inDemoInstall

pythumb

Package Overview
Dependencies
1
Maintainers
1
Alerts
File Explorer

Install Socket

Detect and block malicious and high-risk dependencies

Install

    pythumb

Command line utility & API for downloading YouTube thumbnails


Maintainers
1

Readme

PyThumb

version python version python wheel license

Simple command line utility and API for downloading YouTube thumbnails.

Supports JPEG and WebP formats in all sizes. Previews (animated thumbnails) are not supported due to the lack of direct URL or API access.

Requires Python 3.6+

Table of contents

  • Installation
  • Usage
  • License

Installation

Install via pip:

$ pip install pythumb

Or get binaries from the latest release.

From source

Use python instead of python3 on Windows

Download source code from the latest release, extract and cd into it.

(Optional) Create a virtual environment to manage packages easier.

Update pip and setuptools:

$ python3 -m pip install -U pip setuptools

Install this package:

$ python3 -m pip install .

Optionally you can build a standalone executable.

Prerequisites:

On Linux install python3-dev:

$ sudo apt install python3-dev

Install PyInstaller:

$ python3 -m pip install pyinstaller

Run the build script for your OS:

$ chmod +x ./scripts/build.sh
$ ./scripts/build.sh <win / linux>

You can find the executable in ./pyi-dist/.

Usage

CLI

$ pythumb [options] <input>

To save a thumbnail to the current directory, simply pass the video URL or 11-character ID (recommended quoted):

$ pythumb "https://youtu.be/aqz-KE-bpKQ"
# or
$ pythumb "aqz-KE-bpKQ"

Use --help for more details.

API

Example
from pythumb import Thumbnail
t = Thumbnail('https://youtu.be/aqz-KE-bpKQ')
t.fetch()
t.save('.')
# ./aqz-KE-bpKQ.jpg

Thumbnail sizes

NameSize
maxresdefault1280x720
sddefault640x480
hqdefault480x360
mqdefault320x180
default120x90
Auto-generated previews (start, middle and end of the video)
NameSize
maxres11280x720
maxres21280x720
maxres31280x720
sd1640x480
sd2640x480
sd3640x480
hq1480x360
hq2480x360
hq3480x360
mq1320x180
mq2320x180
mq3320x180
1120x90
2120x90
3120x90

License

MIT license. See LICENSE for more information.

FAQs


Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc