Skip to main content

Command line utility & API for downloading YouTube thumbnails

Project description

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

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 Debian/Ubuntu 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:

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

Use --help or go to the wiki 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

Full details about the API in the wiki.

License

MIT license. See LICENSE for more information.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pythumb-0.1.0.tar.gz (11.2 kB view hashes)

Uploaded Source

Built Distribution

pythumb-0.1.0-py3-none-any.whl (11.3 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page