Nick Ficano commited on
Commit
7c4d9fc
·
2 Parent(s): eb9f6ea 77091c6

Merge branch 'master' of github.com:NFicano/pytube

Browse files
Files changed (4) hide show
  1. CHANGES.rst +183 -58
  2. README.rst +2 -5
  3. pytube/__init__.py +1 -1
  4. pytube/models.py +5 -3
CHANGES.rst CHANGED
@@ -1,6 +1,75 @@
1
  Changelog
2
  =========
3
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4
  0.2.0 (2014-09-28)
5
  ------------------
6
 
@@ -8,9 +77,27 @@ Changelog
8
 
9
  - Fix codeblock formatting. [Jose Diaz-Gonzalez]
10
 
11
- - Merge pull request #33 from NFicano/pypi-release. [Jose Diaz-Gonzalez]
 
 
 
 
 
 
 
12
 
13
- Pypi release
 
 
 
 
 
 
 
 
 
 
 
14
 
15
  - PEP8. [Jose Diaz-Gonzalez]
16
 
@@ -22,60 +109,78 @@ Changelog
22
 
23
  - Explicit exception imports, removed unused method. [Nick Ficano]
24
 
25
- - Updated readme. [Nick Ficano]
26
-
27
  - Commented, flake8, TODOs. [Nick Ficano]
28
 
29
- - Merge pull request #30 from josegonzalez/master. [Nick Ficano]
 
 
 
30
 
31
- Add decryption support for vevo and dashmpd. Closes #25
32
 
33
- - Merge pull request #29 from josegonzalez/master. [Nick Ficano]
34
 
35
- PEP8
36
 
37
- - Merge pull request #28 from jaimecosme/master. [Nick Ficano]
38
 
39
- Fix for two videos with same extension and resolution.
40
 
41
- - Merge pull request #27 from sanfx/print_status_flush. [Nick Ficano]
42
 
43
- added a progress bar and percentage of download completed along with
44
- human readable file size
45
 
46
- - Merge pull request #26 from sanfx/print_status_flush. [Nick Ficano]
47
 
48
- fixed printing status, flushes previous status in terminal
49
 
50
- - Merge pull request #20 from chid/patch-1. [Nick Ficano]
51
 
52
- Update README.md
53
 
54
- - Merge pull request #21 from mursts/patch-py3. [Nick Ficano]
 
 
 
55
 
56
- python 3 compatibility and convert tab to space
57
 
58
- - Merge pull request #23 from masipcat/master. [Nick Ficano]
 
 
 
 
59
 
60
- Now Pytube supports videos with signatures!
61
 
62
- - Merge pull request #24 from masipcat/cipher_parser. [Nick Ficano]
63
 
64
- Bug fixes related with signatures and optimizations
 
65
 
66
- - Merge pull request #19 from insideou7/master. [Nick Ficano]
67
 
68
- download uri now contains the signature by default.
69
 
70
- - Merge pull request #16 from philipzae/patch-1. [Nick Ficano]
71
 
72
- fixed spelling mistake
 
 
 
 
 
 
 
 
 
 
73
 
74
  - Added README.rst, updated copy. [NFicano]
75
 
76
- - Merge pull request #15 from b-mcg/master. [Nick Ficano]
 
 
 
77
 
78
- Possible merge.
79
 
80
  - Rearranged imports in cli. [NFicano]
81
 
@@ -92,27 +197,41 @@ Changelog
92
 
93
  - Reverted back to setuptools. cleaned up setup.py. [NFicano]
94
 
95
- - Updated version. [NFicano]
96
-
97
  - Changed setuptools to distutils. [NFicano]
98
 
99
  - Renamed LICENSE.txt to LICENSE. [NFicano]
100
 
101
  - Fixed for PyPI! [NFicano]
102
 
103
- * added setup.cfg * updated setup.py * renamed COPYING to LICENCE.txt.
 
 
 
104
 
105
- - Merge pull request #10 from randomchars/cli. [Nick Ficano]
106
 
107
- Add a comman line interface
108
 
109
- - Updated README addressing how to get the highest resolution. [NFicano]
110
 
111
- - Merge pull request #7 from randomchars/master. [Nick Ficano]
112
 
113
- Video info parsing and Python 3 fixes
114
 
115
- - Updated for Python 3.x. [NFicano]
 
 
 
 
 
 
 
 
 
 
 
 
 
116
 
117
  - Added print statement back in, changed to rev 0.0.5, (1.0 will include
118
  unit tests, and CLI), update README. [NFicano]
@@ -120,20 +239,21 @@ Changelog
120
  - Python 3.x! Reorganized file structure, removed print statements.
121
  [NFicano]
122
 
123
- - Merge pull request #4 from randomchars/master. [Nick Ficano]
 
 
 
124
 
125
- Python 3 fixes
126
 
127
- - Merge pull request #2 from ablanco/master. [Nick Ficano]
 
128
 
129
- Fix download urls
130
 
131
  - Pep8, pyflakes, fixed typos, better comments. [NFicano]
132
 
133
  - Rearranged/cleaned up instructions. [NFicano]
134
 
135
- - Updated README, added .psd to gitignore. [NFicano]
136
-
137
  - AND a typo.. [NFicano]
138
 
139
  - Modified installation instructions to use pip. [NFicano]
@@ -144,28 +264,30 @@ Changelog
144
 
145
  - Copy changes to README. [NFicano]
146
 
147
- - Updated README copy. [NFicano]
148
-
149
  - Added better exception handling, fixed a ton of bugs, added setup.py.
150
  [NFicano]
151
 
152
  - Fixed typos and added bugs to README. [NFicano]
153
 
154
- - Updated README and AUTHORS. [NFicano]
 
155
 
156
- - Merge pull request #1 from lorenzogil/master. [Nick Ficano]
157
-
158
- Evaluate the status code and do nothing upon failure
159
 
160
  - Bug fixes, added ability to specify output directory. [Nick Ficano]
161
 
162
- * added ability to specify an output directory. * added missing
163
- quality profiles. * handled exception when unexcepted quality profile
164
- returned. * videos now get sorted by quality profile.
 
 
165
 
166
  - General housekeeping, no code modified. [Nick Ficano]
167
 
168
- * Added TODO * Added AUTHORS * Moved Licence agreement into COPYING.
 
 
 
169
 
170
  - Removed my hardcoded path I had lazily set. [Nick Ficano]
171
 
@@ -176,17 +298,20 @@ Changelog
176
  filename sanitizing function was causing the last word in the filename
177
  to get truncated.
178
 
 
179
  - Minor project reorganizing. [Nick Ficano]
180
 
181
  * Moved project into subdirectory, preparing to write setup script.
182
 
183
- - Updated readme to show off more features. [Nick Ficano]
184
 
185
  - Cleanup, Pep8, finished docstring, 100% std lib. [Nick Ficano]
186
 
187
- * A bit of tidying some odds and ends. * Pep8 * Finished docstrings *
188
- Removed ``requests`` dependency making it compatible out of the box *
189
- Rewrote filename sanitization method, also fixing unicode error.
 
 
 
190
 
191
  - AH! forgot a trailing quote. [Nick Ficano]
192
 
 
1
  Changelog
2
  =========
3
 
4
+ 0.3.1 (2015-09-05)
5
+ ------------------
6
+
7
+ - Fix rst violations in readme. [Jose Diaz-Gonzalez]
8
+
9
+ 0.3.0 (2015-09-06)
10
+ ------------------
11
+
12
+ - Changed print statement to logging. [João Ricardo]
13
+
14
+ This fixes this issue: https://github.com/nficano/pytube/issues/61
15
+
16
+ - Bumped verison to 0.2.1. [Nick Ficano]
17
+
18
+ - Cleanup. [Nick Ficano]
19
+
20
+ * pep8
21
+ * removed \n from exceptions
22
+ * normalized docstring parameters
23
+ * fix bug causing exception to be raised if no download path is
24
+ provided.
25
+ * changed FileExistsError to OSError for 2.7.x compat.
26
+
27
+
28
+ - Clean up docstrings. [Nick Ficano]
29
+
30
+ - Cleanup!! [Nick Ficano]
31
+
32
+ * added `from_url` method.
33
+ * added `set_filename` method.
34
+ * added deprecation warnings to setters.
35
+ * fixed typos.
36
+ * pep8.
37
+ * removed old comments.
38
+ * removed unnecessary TODOs.
39
+ * removed unused `_fetch`. method.
40
+
41
+
42
+ - Vevovideonotworking : 1. Getting rid of default static function 2.
43
+ downloading from assets js always 3. Using jsinterp instead of tinyjs
44
+ since it was not working 4. vevo and everyother video with encrypted
45
+ signature downloads in similar way. [vidyuthd]
46
+
47
+ - Vevo video download not working due to changed algo. [vidyuthd]
48
+
49
+ - Default to cwd for path arg. [Enrique Fernandez]
50
+
51
+ - Fix division by zero. [Enrique Fernandez]
52
+
53
+ - Refs #2: - added posibility to provide full path to file. [Eloar]
54
+
55
+ - Refs #1: - added argument to force file overwrite - changed exit to
56
+ rise exception on file name conflict. [Eloar]
57
+
58
+ - Refs #4: - changed all exit usages to raise exceptions. [Eloar]
59
+
60
+ - - added info about 3.4 support to README and setup.py. [Eloar]
61
+
62
+ - - added __future__ import to example in README. [Eloar]
63
+
64
+ - - added import print_function from __future__ for backward
65
+ compatibility to 2.6. [Janusz Paszyński]
66
+
67
+ - - ported example in README to 3.4.1. [Janusz Paszyński]
68
+
69
+ - - ported to 3.4.1 with backward compatibility. [Janusz Paszyński]
70
+
71
+ - - added requirements information to README file. [Janusz Paszyński]
72
+
73
  0.2.0 (2014-09-28)
74
  ------------------
75
 
 
77
 
78
  - Fix codeblock formatting. [Jose Diaz-Gonzalez]
79
 
80
+ - Cleanup setup.py. [Jose Diaz-Gonzalez]
81
+
82
+ - Add empty requirements.txt. [Jose Diaz-Gonzalez]
83
+
84
+ Many build/ci tools will see this and assume a python repository
85
+
86
+
87
+ - Combine README.nd and README.rst. [Jose Diaz-Gonzalez]
88
 
89
+ - Add missing MANIFEST.in. [Jose Diaz-Gonzalez]
90
+
91
+ - Move LICENSE to LICENSE.txt. [Jose Diaz-Gonzalez]
92
+
93
+ - Remove AUTHORS file. [Jose Diaz-Gonzalez]
94
+
95
+ - Add necessary gitignore entries. [Jose Diaz-Gonzalez]
96
+
97
+ This will allow us to build packages without worrying about build artifacts
98
+
99
+
100
+ - Add release script. [Jose Diaz-Gonzalez]
101
 
102
  - PEP8. [Jose Diaz-Gonzalez]
103
 
 
109
 
110
  - Explicit exception imports, removed unused method. [Nick Ficano]
111
 
 
 
112
  - Commented, flake8, TODOs. [Nick Ficano]
113
 
114
+ - Add decryption support for vevo and dashmpd. Closes #25. [Jose Diaz-
115
+ Gonzalez]
116
+
117
+ - Use proper indentation. [Jose Diaz-Gonzalez]
118
 
119
+ - Clean up logic behind indexing. [Jose Diaz-Gonzalez]
120
 
121
+ - Remove unnecessary imports. [Jose Diaz-Gonzalez]
122
 
123
+ Also list out top-level imports separately
124
 
 
125
 
126
+ - Add missing whitespace between operators. [Jose Diaz-Gonzalez]
127
 
128
+ - Whitespace cleanup. [Jose Diaz-Gonzalez]
129
 
130
+ As per PEP8, global functions need two newlines, class methods need 1, and all indentation should use spaces, not tabs
 
131
 
 
132
 
133
+ - Remove redundant backslashes. [Jose Diaz-Gonzalez]
134
 
135
+ They are not necessary between parenthesis
136
 
 
137
 
138
+ - Fix for two videos with same extension and resolution. Two videos can
139
+ have tha same extension and resolution but a different profile. api.py
140
+ and models.py have been modified to set also the profile to be
141
+ downloaded and avoid this problem. [jaimecosme]
142
 
143
+ - Added exit call when either resolution or extension is missed. [san]
144
 
145
+ - Covert relative path to absolute path at the time being passed from
146
+ commad line, updated Downlaoding message to print where the file is
147
+ saved to, check to make sure user passes both extension and resolution
148
+ and print to shell if not sure what resolution to choose, and fix for
149
+ progress bar dispay on windows. [san]
150
 
151
+ - Working progress bar on OSx. [san]
152
 
153
+ - Removed white spaces and call to _main in wrapper. [san]
154
 
155
+ - Added progress bar, and function to read size in human readable
156
+ format, updated call to print_status function. [san]
157
 
158
+ - Fixed printing status, flushes prvious status. [san]
159
 
160
+ - Fixed python 3 compatibility. [mursts]
161
 
162
+ - Convert tab to space. [mursts]
163
 
164
+ - Bug fixed and faster. [JMasip]
165
+
166
+ - Some optimizations. [JMasip]
167
+
168
+ - Now Pytube supports videos with signatures! [JMasip]
169
+
170
+ - _get_video_info(self) [insideou7]
171
+
172
+ I removed the video signatures. They are already included in the URL string, and apparently the old way of grabbing stream_map["sig"] returns an empty list, which returns an error in line 242
173
+
174
+ - Fixed spelling mistake. [Jay Philips]
175
 
176
  - Added README.rst, updated copy. [NFicano]
177
 
178
+ - Changed formatting. [b-mcg]
179
+
180
+ - Changed formatting, added error checking during download, and added
181
+ downloading message. [b-mcg]
182
 
183
+ - Changed formatting. [b-mcg]
184
 
185
  - Rearranged imports in cli. [NFicano]
186
 
 
197
 
198
  - Reverted back to setuptools. cleaned up setup.py. [NFicano]
199
 
 
 
200
  - Changed setuptools to distutils. [NFicano]
201
 
202
  - Renamed LICENSE.txt to LICENSE. [NFicano]
203
 
204
  - Fixed for PyPI! [NFicano]
205
 
206
+ * added setup.cfg
207
+ * updated setup.py
208
+ * renamed COPYING to LICENCE.txt.
209
+
210
 
211
+ - Bump version number. [Richard Borcsik]
212
 
213
+ - Added error handling. [Richard Borcsik]
214
 
215
+ - Add a command line tool. [Richard Borcsik]
216
 
217
+ - Added myself to the AUTHORS file. [Richard Borcsik]
218
 
219
+ - PEP8 cleanup. [Richard Borcsik]
220
 
221
+ - Corrected variable. [Richard Borcsik]
222
+
223
+ - Correct indentation. [Richard Borcsik]
224
+
225
+ - Add callbacks to Video.download. Refactored console printing into
226
+ utils.py. [Richard Borcsik]
227
+
228
+ - Use the correct variable for filename. [Richard Borcsik]
229
+
230
+ - Fixed handling of filename changes. Fix for #8. [Richard Borcsik]
231
+
232
+ - Fixed video info parsing. [Richard Borcsik]
233
+
234
+ - Fixed python 3 compatibility. [Richard Borcsik]
235
 
236
  - Added print statement back in, changed to rev 0.0.5, (1.0 will include
237
  unit tests, and CLI), update README. [NFicano]
 
239
  - Python 3.x! Reorganized file structure, removed print statements.
240
  [NFicano]
241
 
242
+ - Python 3 compatibility fixes. [Richard Borcsik]
243
+
244
+ Signed-off-by: Richard Borcsik <richard@borcsik.com>
245
+
246
 
247
+ - Add video signature to download url. [Alejandro Blanco]
248
 
249
+ YouTube has changed the API a bit, now it requires the video signature
250
+ in the download url.
251
 
 
252
 
253
  - Pep8, pyflakes, fixed typos, better comments. [NFicano]
254
 
255
  - Rearranged/cleaned up instructions. [NFicano]
256
 
 
 
257
  - AND a typo.. [NFicano]
258
 
259
  - Modified installation instructions to use pip. [NFicano]
 
264
 
265
  - Copy changes to README. [NFicano]
266
 
 
 
267
  - Added better exception handling, fixed a ton of bugs, added setup.py.
268
  [NFicano]
269
 
270
  - Fixed typos and added bugs to README. [NFicano]
271
 
272
+ - Evaluate the status code and do nothing upon failure. [Lorenzo Gil
273
+ Sanchez]
274
 
275
+ - Remove trailing whitespace. [Lorenzo Gil Sanchez]
 
 
276
 
277
  - Bug fixes, added ability to specify output directory. [Nick Ficano]
278
 
279
+ * added ability to specify an output directory.
280
+ * added missing quality profiles.
281
+ * handled exception when unexcepted quality profile returned.
282
+ * videos now get sorted by quality profile.
283
+
284
 
285
  - General housekeeping, no code modified. [Nick Ficano]
286
 
287
+ * Added TODO
288
+ * Added AUTHORS
289
+ * Moved Licence agreement into COPYING.
290
+
291
 
292
  - Removed my hardcoded path I had lazily set. [Nick Ficano]
293
 
 
298
  filename sanitizing function was causing the last word in the filename
299
  to get truncated.
300
 
301
+
302
  - Minor project reorganizing. [Nick Ficano]
303
 
304
  * Moved project into subdirectory, preparing to write setup script.
305
 
 
306
 
307
  - Cleanup, Pep8, finished docstring, 100% std lib. [Nick Ficano]
308
 
309
+ * A bit of tidying some odds and ends.
310
+ * Pep8
311
+ * Finished docstrings
312
+ * Removed ``requests`` dependency making it compatible out of the box
313
+ * Rewrote filename sanitization method, also fixing unicode error.
314
+
315
 
316
  - AH! forgot a trailing quote. [Nick Ficano]
317
 
README.rst CHANGED
@@ -23,9 +23,6 @@ Installation
23
 
24
  If you are on Mac OS X or Linux, chances are that one of the following two commands will work for you:
25
 
26
- Installation
27
- ============
28
-
29
  Using PIP via PyPI
30
 
31
  .. code:: bash
@@ -36,13 +33,13 @@ Using PIP via Github
36
 
37
  .. code:: bash
38
 
39
- pip install git+git://github.com/NFicano/pytube.git@0.2.1#egg=pytube
40
 
41
  Adding to your ``requirements.txt`` file (run ``pip install -r requirements.txt`` afterwards)
42
 
43
  .. code:: bash
44
 
45
- git+ssh://git@github.com/NFicano/pytube.git@0.2.1#egg=pytube
46
 
47
  Manually via GIT
48
 
 
23
 
24
  If you are on Mac OS X or Linux, chances are that one of the following two commands will work for you:
25
 
 
 
 
26
  Using PIP via PyPI
27
 
28
  .. code:: bash
 
33
 
34
  .. code:: bash
35
 
36
+ pip install git+git://github.com/NFicano/pytube.git@0.3.1#egg=pytube
37
 
38
  Adding to your ``requirements.txt`` file (run ``pip install -r requirements.txt`` afterwards)
39
 
40
  .. code:: bash
41
 
42
+ git+ssh://git@github.com/NFicano/pytube.git@0.3.1#egg=pytube
43
 
44
  Manually via GIT
45
 
pytube/__init__.py CHANGED
@@ -1,5 +1,5 @@
1
  __title__ = 'pytube'
2
- __version__ = '0.2.1'
3
  __author__ = 'Nick Ficano'
4
  __license__ = 'MIT License'
5
  __copyright__ = 'Copyright 2015 Nick Ficano'
 
1
  __title__ = 'pytube'
2
+ __version__ = '0.3.1'
3
  __author__ = 'Nick Ficano'
4
  __license__ = 'MIT License'
5
  __copyright__ = 'Copyright 2015 Nick Ficano'
pytube/models.py CHANGED
@@ -4,6 +4,8 @@ from __future__ import unicode_literals, print_function
4
  from os import remove
5
  from os.path import normpath, isfile, isdir
6
  from time import clock
 
 
7
  try:
8
  from urllib2 import urlopen
9
  except ImportError:
@@ -72,9 +74,9 @@ class Video(object):
72
  try:
73
  with open(fullpath, 'wb') as dst_file:
74
  # Print downloading message
75
- print("Downloading: '{0}.{1}' (Bytes: {2}) to path: "
76
- "{3}".format(self.filename, self.extension,
77
- sizeof(file_size), path))
78
 
79
  while True:
80
  self._buffer = response.read(chunk_size)
 
4
  from os import remove
5
  from os.path import normpath, isfile, isdir
6
  from time import clock
7
+ import logging
8
+
9
  try:
10
  from urllib2 import urlopen
11
  except ImportError:
 
74
  try:
75
  with open(fullpath, 'wb') as dst_file:
76
  # Print downloading message
77
+ logging.info("Downloading: '{0}.{1}' (Bytes: {2}) to path: "
78
+ "{3}".format(self.filename, self.extension,
79
+ sizeof(file_size), path))
80
 
81
  while True:
82
  self._buffer = response.read(chunk_size)