Skip to main content

yt-dlp wrapper for downloading YouTube videos/audio with embedded thumbnails

Project description

yt_dlp_expand

yt-dlp を使って動画・音声をダウンロードし、サムネイルを自動埋め込みするラッパーパッケージです。
iPhoneのショートカットApp + a-Shell からの呼び出しを想定して作成されました。

iPhoneでショートカットappを使って、safariからYouTubeをダウンロードする

Getting Started

Prerequisites

以下が自動的にインストールされます。 / The following are installed automatically:

また、システムに ffmpeg がインストールされている必要があります。
ffmpeg must also be installed on your system.

Installing

PyPI(a-Shell 推奨):

pip install yt_dlp_expand

git から(mac/linux 等の通常環境):

pip install git+https://github.com/souno1218/yt_dlp_expand.git

Download Modes

Mode 説明
0 bestaudio → MP3(サムネイル埋め込み)
1 bestaudio → Opus(サムネイル埋め込み)
2 720p MP4 (h264 + mp4a)(サムネイル埋め込み)
3 best MP4 (h264 + mp4a)(サムネイル埋め込み)
4 best MP4 (vp9 + opus)(サムネイル埋め込み)

Usage

Terminal / CLI

yt_dlp_expand [-h] [-p PATH] [-l DOWNLOAD_PLAYLIST] download_mode url

positional arguments:

引数 説明
download_mode ダウンロードモード (0〜4)
url 動画またはプレイリストの URL

options:

オプション 説明
-p PATH, --path PATH 保存先ディレクトリパス(省略時: PC → ~/Downloads, iOS → ~/Documents
-l, --download_playlist プレイリスト全体をダウンロードするか(default: False)

Examples:

# MP3 でダウンロード
yt_dlp_expand 0 "https://www.youtube.com/watch?v=xxxx"

# 720p MP4 で指定ディレクトリに保存
yt_dlp_expand 2 "https://www.youtube.com/watch?v=xxxx" -p ~/Movies

# プレイリストをまとめてダウンロード
yt_dlp_expand 1 "https://www.youtube.com/playlist?list=xxxx" -l true

Python ライブラリとして使う

from yt_dlp_expand import DownloadMode, ExpandYt_dlp

obj = ExpandYt_dlp(DownloadMode.AUDIO_MP3, "https://www.youtube.com/watch?v=xxxx")
obj.run()

Built With

  • yt-dlp — 動画ダウンロード
  • mutagen — MP3/Opus へのサムネイル埋め込み
  • ffmpeg-python — MP4 へのサムネイル埋め込み・クロップ

Authors

  • 河野 颯之介 (Sonosuke Kono)

License

This project is licensed under the MIT License - see the LICENSE file for details.

Project details


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

yt_dlp_expand-0.4.12.dev5-py3-none-any.whl (10.5 kB view details)

Uploaded Python 3

File details

Details for the file yt_dlp_expand-0.4.12.dev5-py3-none-any.whl.

File metadata

File hashes

Hashes for yt_dlp_expand-0.4.12.dev5-py3-none-any.whl
Algorithm Hash digest
SHA256 a91445b9bd85fb0f24b85ade0604af2e81942991579b020ea48b0b91f1e14a4f
MD5 89df9de6127f032f981ae602b280d4c8
BLAKE2b-256 40521e677c89ab72d6ab3e85f18389e15e4541aa6f00e4f6909be6b22cfbb828

See more details on using hashes here.

Supported by

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