diff options
| -rw-r--r-- | .gitignore | 1 | ||||
| -rw-r--r-- | python-gdown.spec | 449 | ||||
| -rw-r--r-- | sources | 1 |
3 files changed, 451 insertions, 0 deletions
@@ -0,0 +1 @@ +/gdown-4.7.1.tar.gz diff --git a/python-gdown.spec b/python-gdown.spec new file mode 100644 index 0000000..6d8acde --- /dev/null +++ b/python-gdown.spec @@ -0,0 +1,449 @@ +%global _empty_manifest_terminate_build 0 +Name: python-gdown +Version: 4.7.1 +Release: 1 +Summary: Google Drive direct download of big files. +License: MIT +URL: http://github.com/wkentaro/gdown +Source0: https://mirrors.nju.edu.cn/pypi/web/packages/cc/36/3cc5d71e95cd65db5db8b06f9047257b417330873977626aa416076cca4f/gdown-4.7.1.tar.gz +BuildArch: noarch + +Requires: python3-filelock +Requires: python3-requests[socks] +Requires: python3-six +Requires: python3-tqdm +Requires: python3-beautifulsoup4 + +%description +<h1 align="center"> + gdown +</h1> + +<h4 align="center"> + Download a large file from Google Drive. +</h4> + +<div align="center"> + <a href="https://pypi.python.org/pypi/gdown"><img src="https://img.shields.io/pypi/v/gdown.svg"></a> + <a href="https://pypi.org/project/gdown"><img src="https://img.shields.io/pypi/pyversions/gdown.svg"></a> + <a href="https://github.com/wkentaro/gdown/actions"><img src="https://github.com/wkentaro/gdown/workflows/ci/badge.svg"></a> +</div> + +<div align="center"> + <img src=".readme/cli.png" width="90%"> + <img src=".readme/python.png" width="90%"> +</div> + +<br/> + + +## Description + +Download a large file from Google Drive. +If you use curl/wget, it fails with a large file because of +the security warning from Google Drive. +Supports downloading from Google Drive folders (max 50 files per folder). + + +## Installation + +```bash +pip install gdown + +# to upgrade +pip install --upgrade gdown +``` + + +## Usage + +### From Command Line + +```bash +$ gdown --help +usage: gdown [-h] [-V] [-O OUTPUT] [-q] [--fuzzy] [--id] [--proxy PROXY] + [--speed SPEED] [--no-cookies] [--no-check-certificate] + [--continue] [--folder] [--remaining-ok] + url_or_id +... + +$ # a large file (~500MB) +$ gdown https://drive.google.com/uc?id=1l_5RK28JRL19wpT22B-DY9We3TVXnnQQ +$ md5sum fcn8s_from_caffe.npz +256c2a8235c1c65e62e48d3284fbd384 + +$ # same as the above but with the file ID +$ gdown 1l_5RK28JRL19wpT22B-DY9We3TVXnnQQ + +$ # a small file +$ gdown https://drive.google.com/uc?id=0B9P1L--7Wd2vU3VUVlFnbTgtS2c +$ cat spam.txt +spam + +$ # download with fuzzy extraction of a file ID +$ gdown --fuzzy 'https://drive.google.com/file/d/0B9P1L--7Wd2vU3VUVlFnbTgtS2c/view?usp=sharing&resourcekey=0-WWs_XOSctfaY_0-sJBKRSQ' +$ cat spam.txt +spam + +$ # --fuzzy option also works with Microsoft Powerpoint files +$ gdown --fuzzy "https://docs.google.com/presentation/d/15umvZKlsJ3094HNg5S4vJsIhxcFlyTeK/edit?usp=sharing&ouid=117512221203072002113&rtpof=true&sd=true" + +$ # a folder +$ gdown https://drive.google.com/drive/folders/15uNXeRBIhVvZJIhL4yTw4IsStMhUaaxl -O /tmp/folder --folder + +$ # as an alternative to curl/wget +$ gdown https://httpbin.org/ip -O ip.json +$ cat ip.json +{ + "origin": "126.169.213.247" +} + +$ # write stdout and pipe to extract +$ gdown https://github.com/wkentaro/gdown/archive/refs/tags/v4.0.0.tar.gz -O - --quiet | tar zxvf - +$ ls gdown-4.0.0/ +gdown github2pypi LICENSE MANIFEST.in pyproject.toml README.md setup.cfg setup.py tests +``` + +### From Python + +```python +import gdown + +# a file +url = "https://drive.google.com/uc?id=1l_5RK28JRL19wpT22B-DY9We3TVXnnQQ" +output = "fcn8s_from_caffe.npz" +gdown.download(url, output, quiet=False) + +# same as the above, but with the file ID +id = "0B9P1L--7Wd2vNm9zMTJWOGxobkU" +gdown.download(id=id, output=output, quiet=False) + +# same as the above, and you can copy-and-paste a URL from Google Drive with fuzzy=True +url = "https://drive.google.com/file/d/0B9P1L--7Wd2vNm9zMTJWOGxobkU/view?usp=sharing" +gdown.download(url=url, output=output, quiet=False, fuzzy=True) + +# cached download with identity check via MD5 +md5 = "fa837a88f0c40c513d975104edf3da17" +gdown.cached_download(url, output, md5=md5, postprocess=gdown.extractall) + +# a folder +url = "https://drive.google.com/drive/folders/15uNXeRBIhVvZJIhL4yTw4IsStMhUaaxl" +gdown.download_folder(url, quiet=True, use_cookies=False) + +# same as the above, but with the folder ID +id = "15uNXeRBIhVvZJIhL4yTw4IsStMhUaaxl" +gdown.download_folder(id=id, quiet=True, use_cookies=False) +``` + + +## License + +See [LICENSE](LICENSE). + + +%package -n python3-gdown +Summary: Google Drive direct download of big files. +Provides: python-gdown +BuildRequires: python3-devel +BuildRequires: python3-setuptools +BuildRequires: python3-pip +%description -n python3-gdown +<h1 align="center"> + gdown +</h1> + +<h4 align="center"> + Download a large file from Google Drive. +</h4> + +<div align="center"> + <a href="https://pypi.python.org/pypi/gdown"><img src="https://img.shields.io/pypi/v/gdown.svg"></a> + <a href="https://pypi.org/project/gdown"><img src="https://img.shields.io/pypi/pyversions/gdown.svg"></a> + <a href="https://github.com/wkentaro/gdown/actions"><img src="https://github.com/wkentaro/gdown/workflows/ci/badge.svg"></a> +</div> + +<div align="center"> + <img src=".readme/cli.png" width="90%"> + <img src=".readme/python.png" width="90%"> +</div> + +<br/> + + +## Description + +Download a large file from Google Drive. +If you use curl/wget, it fails with a large file because of +the security warning from Google Drive. +Supports downloading from Google Drive folders (max 50 files per folder). + + +## Installation + +```bash +pip install gdown + +# to upgrade +pip install --upgrade gdown +``` + + +## Usage + +### From Command Line + +```bash +$ gdown --help +usage: gdown [-h] [-V] [-O OUTPUT] [-q] [--fuzzy] [--id] [--proxy PROXY] + [--speed SPEED] [--no-cookies] [--no-check-certificate] + [--continue] [--folder] [--remaining-ok] + url_or_id +... + +$ # a large file (~500MB) +$ gdown https://drive.google.com/uc?id=1l_5RK28JRL19wpT22B-DY9We3TVXnnQQ +$ md5sum fcn8s_from_caffe.npz +256c2a8235c1c65e62e48d3284fbd384 + +$ # same as the above but with the file ID +$ gdown 1l_5RK28JRL19wpT22B-DY9We3TVXnnQQ + +$ # a small file +$ gdown https://drive.google.com/uc?id=0B9P1L--7Wd2vU3VUVlFnbTgtS2c +$ cat spam.txt +spam + +$ # download with fuzzy extraction of a file ID +$ gdown --fuzzy 'https://drive.google.com/file/d/0B9P1L--7Wd2vU3VUVlFnbTgtS2c/view?usp=sharing&resourcekey=0-WWs_XOSctfaY_0-sJBKRSQ' +$ cat spam.txt +spam + +$ # --fuzzy option also works with Microsoft Powerpoint files +$ gdown --fuzzy "https://docs.google.com/presentation/d/15umvZKlsJ3094HNg5S4vJsIhxcFlyTeK/edit?usp=sharing&ouid=117512221203072002113&rtpof=true&sd=true" + +$ # a folder +$ gdown https://drive.google.com/drive/folders/15uNXeRBIhVvZJIhL4yTw4IsStMhUaaxl -O /tmp/folder --folder + +$ # as an alternative to curl/wget +$ gdown https://httpbin.org/ip -O ip.json +$ cat ip.json +{ + "origin": "126.169.213.247" +} + +$ # write stdout and pipe to extract +$ gdown https://github.com/wkentaro/gdown/archive/refs/tags/v4.0.0.tar.gz -O - --quiet | tar zxvf - +$ ls gdown-4.0.0/ +gdown github2pypi LICENSE MANIFEST.in pyproject.toml README.md setup.cfg setup.py tests +``` + +### From Python + +```python +import gdown + +# a file +url = "https://drive.google.com/uc?id=1l_5RK28JRL19wpT22B-DY9We3TVXnnQQ" +output = "fcn8s_from_caffe.npz" +gdown.download(url, output, quiet=False) + +# same as the above, but with the file ID +id = "0B9P1L--7Wd2vNm9zMTJWOGxobkU" +gdown.download(id=id, output=output, quiet=False) + +# same as the above, and you can copy-and-paste a URL from Google Drive with fuzzy=True +url = "https://drive.google.com/file/d/0B9P1L--7Wd2vNm9zMTJWOGxobkU/view?usp=sharing" +gdown.download(url=url, output=output, quiet=False, fuzzy=True) + +# cached download with identity check via MD5 +md5 = "fa837a88f0c40c513d975104edf3da17" +gdown.cached_download(url, output, md5=md5, postprocess=gdown.extractall) + +# a folder +url = "https://drive.google.com/drive/folders/15uNXeRBIhVvZJIhL4yTw4IsStMhUaaxl" +gdown.download_folder(url, quiet=True, use_cookies=False) + +# same as the above, but with the folder ID +id = "15uNXeRBIhVvZJIhL4yTw4IsStMhUaaxl" +gdown.download_folder(id=id, quiet=True, use_cookies=False) +``` + + +## License + +See [LICENSE](LICENSE). + + +%package help +Summary: Development documents and examples for gdown +Provides: python3-gdown-doc +%description help +<h1 align="center"> + gdown +</h1> + +<h4 align="center"> + Download a large file from Google Drive. +</h4> + +<div align="center"> + <a href="https://pypi.python.org/pypi/gdown"><img src="https://img.shields.io/pypi/v/gdown.svg"></a> + <a href="https://pypi.org/project/gdown"><img src="https://img.shields.io/pypi/pyversions/gdown.svg"></a> + <a href="https://github.com/wkentaro/gdown/actions"><img src="https://github.com/wkentaro/gdown/workflows/ci/badge.svg"></a> +</div> + +<div align="center"> + <img src=".readme/cli.png" width="90%"> + <img src=".readme/python.png" width="90%"> +</div> + +<br/> + + +## Description + +Download a large file from Google Drive. +If you use curl/wget, it fails with a large file because of +the security warning from Google Drive. +Supports downloading from Google Drive folders (max 50 files per folder). + + +## Installation + +```bash +pip install gdown + +# to upgrade +pip install --upgrade gdown +``` + + +## Usage + +### From Command Line + +```bash +$ gdown --help +usage: gdown [-h] [-V] [-O OUTPUT] [-q] [--fuzzy] [--id] [--proxy PROXY] + [--speed SPEED] [--no-cookies] [--no-check-certificate] + [--continue] [--folder] [--remaining-ok] + url_or_id +... + +$ # a large file (~500MB) +$ gdown https://drive.google.com/uc?id=1l_5RK28JRL19wpT22B-DY9We3TVXnnQQ +$ md5sum fcn8s_from_caffe.npz +256c2a8235c1c65e62e48d3284fbd384 + +$ # same as the above but with the file ID +$ gdown 1l_5RK28JRL19wpT22B-DY9We3TVXnnQQ + +$ # a small file +$ gdown https://drive.google.com/uc?id=0B9P1L--7Wd2vU3VUVlFnbTgtS2c +$ cat spam.txt +spam + +$ # download with fuzzy extraction of a file ID +$ gdown --fuzzy 'https://drive.google.com/file/d/0B9P1L--7Wd2vU3VUVlFnbTgtS2c/view?usp=sharing&resourcekey=0-WWs_XOSctfaY_0-sJBKRSQ' +$ cat spam.txt +spam + +$ # --fuzzy option also works with Microsoft Powerpoint files +$ gdown --fuzzy "https://docs.google.com/presentation/d/15umvZKlsJ3094HNg5S4vJsIhxcFlyTeK/edit?usp=sharing&ouid=117512221203072002113&rtpof=true&sd=true" + +$ # a folder +$ gdown https://drive.google.com/drive/folders/15uNXeRBIhVvZJIhL4yTw4IsStMhUaaxl -O /tmp/folder --folder + +$ # as an alternative to curl/wget +$ gdown https://httpbin.org/ip -O ip.json +$ cat ip.json +{ + "origin": "126.169.213.247" +} + +$ # write stdout and pipe to extract +$ gdown https://github.com/wkentaro/gdown/archive/refs/tags/v4.0.0.tar.gz -O - --quiet | tar zxvf - +$ ls gdown-4.0.0/ +gdown github2pypi LICENSE MANIFEST.in pyproject.toml README.md setup.cfg setup.py tests +``` + +### From Python + +```python +import gdown + +# a file +url = "https://drive.google.com/uc?id=1l_5RK28JRL19wpT22B-DY9We3TVXnnQQ" +output = "fcn8s_from_caffe.npz" +gdown.download(url, output, quiet=False) + +# same as the above, but with the file ID +id = "0B9P1L--7Wd2vNm9zMTJWOGxobkU" +gdown.download(id=id, output=output, quiet=False) + +# same as the above, and you can copy-and-paste a URL from Google Drive with fuzzy=True +url = "https://drive.google.com/file/d/0B9P1L--7Wd2vNm9zMTJWOGxobkU/view?usp=sharing" +gdown.download(url=url, output=output, quiet=False, fuzzy=True) + +# cached download with identity check via MD5 +md5 = "fa837a88f0c40c513d975104edf3da17" +gdown.cached_download(url, output, md5=md5, postprocess=gdown.extractall) + +# a folder +url = "https://drive.google.com/drive/folders/15uNXeRBIhVvZJIhL4yTw4IsStMhUaaxl" +gdown.download_folder(url, quiet=True, use_cookies=False) + +# same as the above, but with the folder ID +id = "15uNXeRBIhVvZJIhL4yTw4IsStMhUaaxl" +gdown.download_folder(id=id, quiet=True, use_cookies=False) +``` + + +## License + +See [LICENSE](LICENSE). + + +%prep +%autosetup -n gdown-4.7.1 + +%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-gdown -f filelist.lst +%dir %{python3_sitelib}/* + +%files help -f doclist.lst +%{_docdir}/* + +%changelog +* Mon Apr 10 2023 Python_Bot <Python_Bot@openeuler.org> - 4.7.1-1 +- Package Spec generated @@ -0,0 +1 @@ +4d4bb350f4778eb35d55605192190ab2 gdown-4.7.1.tar.gz |
