Merge branch 'master' into patch-2
Browse files- README.rst +33 -16
- pytube/__init__.py +1 -1
- release +0 -90
- setup.cfg +20 -7
- setup.py +1 -3
- tests/requirements.txt +1 -0
README.rst
CHANGED
@@ -6,10 +6,6 @@ pytube
|
|
6 |
:alt: Pypi
|
7 |
:target: https://pypi.python.org/pypi/pytube/
|
8 |
|
9 |
-
.. image:: https://img.shields.io/pypi/pyversions/pytube.svg
|
10 |
-
:alt: Python Versions
|
11 |
-
:target: https://pypi.python.org/pypi/pytube/
|
12 |
-
|
13 |
.. image:: https://travis-ci.org/nficano/pytube.svg?branch=master
|
14 |
:alt: Build status
|
15 |
:target: https://travis-ci.org/nficano/pytube
|
@@ -60,7 +56,7 @@ Library usage
|
|
60 |
yt = YouTube("http://www.youtube.com/watch?v=Ik-RsDGPI5Y")
|
61 |
|
62 |
# Once set, you can see all the codec and quality options YouTube has made
|
63 |
-
# available for the
|
64 |
|
65 |
print(yt.get_videos())
|
66 |
|
@@ -152,28 +148,28 @@ Same thing for specifying a resolution:
|
|
152 |
.. code:: bash
|
153 |
|
154 |
$ pytube -r 720p http://www.youtube.com/watch?v=Ik-RsDGPI5Y
|
155 |
-
|
156 |
When run without a resolution or extension, it shows a list of available formats to download
|
157 |
|
158 |
.. code:: bash
|
159 |
|
160 |
$ pytube http://www.youtube.com/watch?v=Ik-RsDGPI5Y
|
161 |
-
|
162 |
-
|
163 |
-
|
164 |
-
|
165 |
-
|
166 |
-
|
167 |
-
|
168 |
-
|
169 |
-
|
170 |
|
171 |
You can see a list of available formats by passing the ``-s`` (or ``--show-available``) flag
|
172 |
|
173 |
.. code:: bash
|
174 |
|
175 |
$ pytube -s http://www.youtube.com/watch?v=Ik-RsDGPI5Y
|
176 |
-
|
177 |
|
178 |
|
179 |
You can also specify a download file path (``-p`` or ``--path=``):
|
@@ -188,3 +184,24 @@ and/or optionally choose the filename (``-f`` or ``--filename=``):
|
|
188 |
|
189 |
$ pytube -e mp4 -f "Dancing Scene from Pulp Fiction" http://www.youtube.com/watch?v=Ik-RsDGPI5Y
|
190 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
6 |
:alt: Pypi
|
7 |
:target: https://pypi.python.org/pypi/pytube/
|
8 |
|
|
|
|
|
|
|
|
|
9 |
.. image:: https://travis-ci.org/nficano/pytube.svg?branch=master
|
10 |
:alt: Build status
|
11 |
:target: https://travis-ci.org/nficano/pytube
|
|
|
56 |
yt = YouTube("http://www.youtube.com/watch?v=Ik-RsDGPI5Y")
|
57 |
|
58 |
# Once set, you can see all the codec and quality options YouTube has made
|
59 |
+
# available for the particular video by printing videos.
|
60 |
|
61 |
print(yt.get_videos())
|
62 |
|
|
|
148 |
.. code:: bash
|
149 |
|
150 |
$ pytube -r 720p http://www.youtube.com/watch?v=Ik-RsDGPI5Y
|
151 |
+
|
152 |
When run without a resolution or extension, it shows a list of available formats to download
|
153 |
|
154 |
.. code:: bash
|
155 |
|
156 |
$ pytube http://www.youtube.com/watch?v=Ik-RsDGPI5Y
|
157 |
+
Resolution Extension
|
158 |
+
----------------------------
|
159 |
+
0 3gp 144p
|
160 |
+
1 3gp 240p
|
161 |
+
2 mp4 360p
|
162 |
+
3 mp4 720p
|
163 |
+
4 webm 360p
|
164 |
+
Enter choice:
|
165 |
+
|
166 |
|
167 |
You can see a list of available formats by passing the ``-s`` (or ``--show-available``) flag
|
168 |
|
169 |
.. code:: bash
|
170 |
|
171 |
$ pytube -s http://www.youtube.com/watch?v=Ik-RsDGPI5Y
|
172 |
+
|
173 |
|
174 |
|
175 |
You can also specify a download file path (``-p`` or ``--path=``):
|
|
|
184 |
|
185 |
$ pytube -e mp4 -f "Dancing Scene from Pulp Fiction" http://www.youtube.com/watch?v=Ik-RsDGPI5Y
|
186 |
|
187 |
+
Development
|
188 |
+
===========
|
189 |
+
|
190 |
+
Development of this happens on GitHub, patches including tests, documentation are very welcome, as well as bug reports and feature contributions are welcome! Also please open an issue if this tool does not function as you'd expect.
|
191 |
+
|
192 |
+
How to release updates
|
193 |
+
----------------------
|
194 |
+
|
195 |
+
If this is the first time you're releasing to pypi, you'll need to run: ``pip install -r tests/dev_requirements.txt``.
|
196 |
+
|
197 |
+
Once complete, execute the following commands:
|
198 |
+
|
199 |
+
.. code:: bash
|
200 |
+
|
201 |
+
$ git checkout master
|
202 |
+
$ bumpversion [major|minor|patch]
|
203 |
+
$
|
204 |
+
$ python setup.py sdist bdist_wheel upload
|
205 |
+
$
|
206 |
+
$ bumpversion --no-tag patch
|
207 |
+
$ git push origin master --tags
|
pytube/__init__.py
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
# -*- coding: utf-8 -*-
|
3 |
# flake8: noqa
|
4 |
__title__ = 'pytube'
|
5 |
-
__version__ = '6.
|
6 |
__author__ = 'Nick Ficano'
|
7 |
__license__ = 'MIT License'
|
8 |
__copyright__ = 'Copyright 2017 Nick Ficano'
|
|
|
2 |
# -*- coding: utf-8 -*-
|
3 |
# flake8: noqa
|
4 |
__title__ = 'pytube'
|
5 |
+
__version__ = '6.3.1'
|
6 |
__author__ = 'Nick Ficano'
|
7 |
__license__ = 'MIT License'
|
8 |
__copyright__ = 'Copyright 2017 Nick Ficano'
|
release
DELETED
@@ -1,90 +0,0 @@
|
|
1 |
-
#!/usr/bin/env bash
|
2 |
-
|
3 |
-
# Colors
|
4 |
-
COLOR_OFF="\033[0m" # unsets color to term fg color
|
5 |
-
RED="\033[0;31m" # red
|
6 |
-
GREEN="\033[0;32m" # green
|
7 |
-
YELLOW="\033[0;33m" # yellow
|
8 |
-
MAGENTA="\033[0;35m" # magenta
|
9 |
-
CYAN="\033[0;36m" # cyan
|
10 |
-
|
11 |
-
if [[ "$@" != "major" ]] && [[ "$@" != "minor" ]] && [[ "$@" != "patch" ]]; then
|
12 |
-
echo -e "${RED}WARNING: Invalid release type, must specify 'major', 'minor', or 'patch'${COLOR_OFF}\n"
|
13 |
-
exit
|
14 |
-
fi
|
15 |
-
|
16 |
-
echo -e "\n${GREEN}STARTING RELEASE PROCESS${COLOR_OFF}\n"
|
17 |
-
|
18 |
-
git status | grep "working tree clean" &> /dev/null
|
19 |
-
if [ ! $? -eq 0 ]; then # working directory is NOT clean
|
20 |
-
echo -e "${RED}WARNING: You have uncomitted changes, you may have forgotten something${COLOR_OFF}\n"
|
21 |
-
exit
|
22 |
-
fi
|
23 |
-
|
24 |
-
echo -e "${YELLOW}--->${COLOR_OFF} Updating local copy"
|
25 |
-
git pull -q origin master
|
26 |
-
|
27 |
-
echo -e "${YELLOW}--->${COLOR_OFF} Retrieving release versions"
|
28 |
-
|
29 |
-
current_version=`cat pytube/__init__.py |grep '__version__ ='|sed 's/[^0-9.]//g'`
|
30 |
-
major=`echo $current_version | awk '{split($0,a,"."); print a[1]}'`
|
31 |
-
minor=`echo $current_version | awk '{split($0,a,"."); print a[2]}'`
|
32 |
-
patch=`echo $current_version | awk '{split($0,a,"."); print a[3]}'`
|
33 |
-
|
34 |
-
if [[ "$@" == "major" ]]; then
|
35 |
-
major=$(($major + 1));
|
36 |
-
minor="0"
|
37 |
-
patch="0"
|
38 |
-
elif [[ "$@" == "minor" ]]; then
|
39 |
-
minor=$(($minor + 1));
|
40 |
-
patch="0"
|
41 |
-
elif [[ "$@" == "patch" ]]; then
|
42 |
-
patch=$(($patch + 1));
|
43 |
-
fi
|
44 |
-
|
45 |
-
next_version="${major}.${minor}.${patch}"
|
46 |
-
|
47 |
-
echo -e "${YELLOW} >${COLOR_OFF} ${MAGENTA}${current_version}${COLOR_OFF} -> ${MAGENTA}${next_version}${COLOR_OFF}"
|
48 |
-
|
49 |
-
echo -e "${YELLOW}--->${COLOR_OFF} Creating necessary temp file"
|
50 |
-
tempfoo=`basename $0`
|
51 |
-
TMPFILE=`mktemp /tmp/${tempfoo}.XXXXXX` || {
|
52 |
-
echo -e "${RED}WARNING: Cannot create temp file using mktemp in /tmp dir ${COLOR_OFF}\n"
|
53 |
-
exit 1
|
54 |
-
}
|
55 |
-
|
56 |
-
find_this="__version__ = '$current_version'"
|
57 |
-
replace_with="__version__ = '$next_version'"
|
58 |
-
|
59 |
-
echo -e "${YELLOW}--->${COLOR_OFF} Updating pytube/__init__.py"
|
60 |
-
sed "s/$find_this/$replace_with/" pytube/__init__.py > $TMPFILE && mv $TMPFILE pytube/__init__.py
|
61 |
-
|
62 |
-
find_this="pytube.git@$current_version"
|
63 |
-
replace_with="pytube.git@$next_version"
|
64 |
-
|
65 |
-
echo -e "${YELLOW}--->${COLOR_OFF} Updating README.rst"
|
66 |
-
sed "s/$find_this/$replace_with/" README.rst > $TMPFILE && mv $TMPFILE README.rst
|
67 |
-
|
68 |
-
echo -e "${YELLOW}--->${COLOR_OFF} Updating CHANGES.rst for new release"
|
69 |
-
version_header="$next_version ($(date +%F))"
|
70 |
-
dashes=`yes '-'|head -n ${#version_header}|tr -d '\n'`
|
71 |
-
gitchangelog |sed "4s/.*/$version_header/"|sed "5s/.*/$dashes/" > $TMPFILE && mv $TMPFILE CHANGES.rst
|
72 |
-
|
73 |
-
echo -e "${YELLOW}--->${COLOR_OFF} Adding changed files to git"
|
74 |
-
git add CHANGES.rst README.rst pytube/__init__.py
|
75 |
-
|
76 |
-
echo -e "${YELLOW}--->${COLOR_OFF} Creating release"
|
77 |
-
git commit -q -m "Release version $next_version"
|
78 |
-
|
79 |
-
echo -e "${YELLOW}--->${COLOR_OFF} Tagging release"
|
80 |
-
git tag -a $next_version -m "Release version $next_version"
|
81 |
-
|
82 |
-
echo -e "${YELLOW}--->${COLOR_OFF} Pushing release and tags to github"
|
83 |
-
git push -q origin master && git push -q --tags
|
84 |
-
|
85 |
-
echo -e "${YELLOW}--->${COLOR_OFF} Creating python release"
|
86 |
-
cp README.rst README
|
87 |
-
python setup.py sdist upload > /dev/null
|
88 |
-
rm README
|
89 |
-
|
90 |
-
echo -e "\n${CYAN}RELEASED VERSION ${next_version}!${COLOR_OFF}\n"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
setup.cfg
CHANGED
@@ -1,11 +1,24 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
[metadata]
|
2 |
description-file = README.md
|
3 |
|
4 |
[nosetests]
|
5 |
-
verbosity=1
|
6 |
-
detailed-errors=1
|
7 |
-
with-coverage=1
|
8 |
-
cover-package=pytube
|
9 |
-
debug=nose.loader
|
10 |
-
pdb=0
|
11 |
-
pdb-failures=0
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
[bumpversion]
|
2 |
+
commit = True
|
3 |
+
tag = True
|
4 |
+
current_version = 6.3.1
|
5 |
+
parse = (?P<major>\d+)\.(?P<minor>\d+)\.(?P<patch>\d+)(\-(?P<release>[a-z]+))?
|
6 |
+
serialize =
|
7 |
+
{major}.{minor}.{patch}
|
8 |
+
|
9 |
[metadata]
|
10 |
description-file = README.md
|
11 |
|
12 |
[nosetests]
|
13 |
+
verbosity = 1
|
14 |
+
detailed-errors = 1
|
15 |
+
with-coverage = 1
|
16 |
+
cover-package = pytube
|
17 |
+
debug = nose.loader
|
18 |
+
pdb = 0
|
19 |
+
pdb-failures = 0
|
20 |
+
|
21 |
+
[bumpversion:file:setup.py]
|
22 |
+
|
23 |
+
[bumpversion:file:pytube/__init__.py]
|
24 |
+
|
setup.py
CHANGED
@@ -1,7 +1,5 @@
|
|
1 |
#!/usr/bin/env python
|
2 |
# -*- coding: utf-8 -*-
|
3 |
-
from pytube import __version__
|
4 |
-
|
5 |
try:
|
6 |
from setuptools import setup
|
7 |
except ImportError:
|
@@ -15,7 +13,7 @@ with open('LICENSE.txt') as readme_file:
|
|
15 |
|
16 |
setup(
|
17 |
name="pytube",
|
18 |
-
version=
|
19 |
author="Nick Ficano",
|
20 |
author_email="[email protected]",
|
21 |
packages=['pytube'],
|
|
|
1 |
#!/usr/bin/env python
|
2 |
# -*- coding: utf-8 -*-
|
|
|
|
|
3 |
try:
|
4 |
from setuptools import setup
|
5 |
except ImportError:
|
|
|
13 |
|
14 |
setup(
|
15 |
name="pytube",
|
16 |
+
version="6.3.1",
|
17 |
author="Nick Ficano",
|
18 |
author_email="[email protected]",
|
19 |
packages=['pytube'],
|
tests/requirements.txt
CHANGED
@@ -1,3 +1,4 @@
|
|
1 |
mock==1.3.0
|
2 |
nose==1.3.7
|
3 |
coveralls==1.0
|
|
|
|
1 |
mock==1.3.0
|
2 |
nose==1.3.7
|
3 |
coveralls==1.0
|
4 |
+
bumpversion==0.5.3
|