diff options
author | CoprDistGit <infra@openeuler.org> | 2023-05-15 03:26:23 +0000 |
---|---|---|
committer | CoprDistGit <infra@openeuler.org> | 2023-05-15 03:26:23 +0000 |
commit | 058e5c3ec51f3f0ec32ab0bdf5f8c884fc71ea90 (patch) | |
tree | c4ccacbbcd3a1cd6bb7cb46b66ef2378e9666977 /python-ytthumb.spec | |
parent | 54676c11b5e24c08f87309cbe9cddb2f8f12936f (diff) |
automatic import of python-ytthumb
Diffstat (limited to 'python-ytthumb.spec')
-rw-r--r-- | python-ytthumb.spec | 244 |
1 files changed, 244 insertions, 0 deletions
diff --git a/python-ytthumb.spec b/python-ytthumb.spec new file mode 100644 index 0000000..bed152a --- /dev/null +++ b/python-ytthumb.spec @@ -0,0 +1,244 @@ +%global _empty_manifest_terminate_build 0 +Name: python-YTThumb +Version: 1.4.5 +Release: 1 +Summary: YouTube video thumbnail downloader +License: MIT +URL: https://pypi.org/project/YTThumb/ +Source0: https://mirrors.nju.edu.cn/pypi/web/packages/28/b6/b87cebc045cb7dd56270cca2db9e0c121e1750d07d0a95fffbe8c0e5f53c/YTThumb-1.4.5.tar.gz +BuildArch: noarch + +Requires: python3-requests + +%description +# YouTube Video Thumbnail +A simple youtube video thumbnail downloader with more qualities via youtube video link or id. + +## Installation + +``` +pip install YTThumb +``` + +## Usage + +### Get Thumbnail + +```py +import ytthumb + +video = 'https://youtu.be/rokGy0huYEA' # link/id + +# Basic Usage +print(ytthumb.thumbnail(video)) +# => returns thumbnail link + +# Advanced Usage +thumbnail = ytthumb.thumbnail( + video=video, + quality="sd" # Not required +) +print(thumbnail) +# returns thumbnail link +``` + +### Get Qualities + +```py +import ytthumb + +print(ytthumb.qualities()) # json=True (default) +# returns list of qualities with full form as json + +print(ytthumb.qualities(json=False)) +# returns list of qualities as list +``` + +### Download Thumbnail + +```py +import ytthumb + +ytthumb.download_thumbnail( + video='https://youtu.be/rokGy0huYEA', + name='thumbnail.jpg', # Not required + quality='sd' # Not required +) +# Download thumbnail in 'thumbnail.jpg' +``` + + + + +%package -n python3-YTThumb +Summary: YouTube video thumbnail downloader +Provides: python-YTThumb +BuildRequires: python3-devel +BuildRequires: python3-setuptools +BuildRequires: python3-pip +%description -n python3-YTThumb +# YouTube Video Thumbnail +A simple youtube video thumbnail downloader with more qualities via youtube video link or id. + +## Installation + +``` +pip install YTThumb +``` + +## Usage + +### Get Thumbnail + +```py +import ytthumb + +video = 'https://youtu.be/rokGy0huYEA' # link/id + +# Basic Usage +print(ytthumb.thumbnail(video)) +# => returns thumbnail link + +# Advanced Usage +thumbnail = ytthumb.thumbnail( + video=video, + quality="sd" # Not required +) +print(thumbnail) +# returns thumbnail link +``` + +### Get Qualities + +```py +import ytthumb + +print(ytthumb.qualities()) # json=True (default) +# returns list of qualities with full form as json + +print(ytthumb.qualities(json=False)) +# returns list of qualities as list +``` + +### Download Thumbnail + +```py +import ytthumb + +ytthumb.download_thumbnail( + video='https://youtu.be/rokGy0huYEA', + name='thumbnail.jpg', # Not required + quality='sd' # Not required +) +# Download thumbnail in 'thumbnail.jpg' +``` + + + + +%package help +Summary: Development documents and examples for YTThumb +Provides: python3-YTThumb-doc +%description help +# YouTube Video Thumbnail +A simple youtube video thumbnail downloader with more qualities via youtube video link or id. + +## Installation + +``` +pip install YTThumb +``` + +## Usage + +### Get Thumbnail + +```py +import ytthumb + +video = 'https://youtu.be/rokGy0huYEA' # link/id + +# Basic Usage +print(ytthumb.thumbnail(video)) +# => returns thumbnail link + +# Advanced Usage +thumbnail = ytthumb.thumbnail( + video=video, + quality="sd" # Not required +) +print(thumbnail) +# returns thumbnail link +``` + +### Get Qualities + +```py +import ytthumb + +print(ytthumb.qualities()) # json=True (default) +# returns list of qualities with full form as json + +print(ytthumb.qualities(json=False)) +# returns list of qualities as list +``` + +### Download Thumbnail + +```py +import ytthumb + +ytthumb.download_thumbnail( + video='https://youtu.be/rokGy0huYEA', + name='thumbnail.jpg', # Not required + quality='sd' # Not required +) +# Download thumbnail in 'thumbnail.jpg' +``` + + + + +%prep +%autosetup -n YTThumb-1.4.5 + +%build +%py3_build + +%install +%py3_install +install -d -m755 %{buildroot}/%{_pkgdocdir} +if [ -d doc ]; then cp -arf doc %{buildroot}/%{_pkgdocdir}; fi +if [ -d docs ]; then cp -arf docs %{buildroot}/%{_pkgdocdir}; fi +if [ -d example ]; then cp -arf example %{buildroot}/%{_pkgdocdir}; fi +if [ -d examples ]; then cp -arf examples %{buildroot}/%{_pkgdocdir}; fi +pushd %{buildroot} +if [ -d usr/lib ]; then + find usr/lib -type f -printf "/%h/%f\n" >> filelist.lst +fi +if [ -d usr/lib64 ]; then + find usr/lib64 -type f -printf "/%h/%f\n" >> filelist.lst +fi +if [ -d usr/bin ]; then + find usr/bin -type f -printf "/%h/%f\n" >> filelist.lst +fi +if [ -d usr/sbin ]; then + find usr/sbin -type f -printf "/%h/%f\n" >> filelist.lst +fi +touch doclist.lst +if [ -d usr/share/man ]; then + find usr/share/man -type f -printf "/%h/%f.gz\n" >> doclist.lst +fi +popd +mv %{buildroot}/filelist.lst . +mv %{buildroot}/doclist.lst . + +%files -n python3-YTThumb -f filelist.lst +%dir %{python3_sitelib}/* + +%files help -f doclist.lst +%{_docdir}/* + +%changelog +* Mon May 15 2023 Python_Bot <Python_Bot@openeuler.org> - 1.4.5-1 +- Package Spec generated |