removed decode('utf-8')
Browse files- .travis.yml +2 -0
- pytube/api.py +2 -2
.travis.yml
CHANGED
@@ -4,6 +4,8 @@ python:
|
|
4 |
- "2.7"
|
5 |
- "3.2"
|
6 |
- "3.3"
|
|
|
|
|
7 |
# command to install dependencies
|
8 |
install: "pip install -r tests/test_requirements.txt"
|
9 |
# command to run tests
|
|
|
4 |
- "2.7"
|
5 |
- "3.2"
|
6 |
- "3.3"
|
7 |
+
- "3.4"
|
8 |
+
- "3.5"
|
9 |
# command to install dependencies
|
10 |
install: "pip install -r tests/test_requirements.txt"
|
11 |
# command to run tests
|
pytube/api.py
CHANGED
@@ -261,7 +261,7 @@ class YouTube(object):
|
|
261 |
if not response:
|
262 |
raise PytubeError("Unable to open url: {0}".format(self.url))
|
263 |
|
264 |
-
html = response.read()
|
265 |
if "og:restrictions:age" in html:
|
266 |
raise AgeRestricted("Age restricted video. Unable to download "
|
267 |
"without being signed in.")
|
@@ -358,7 +358,7 @@ class YouTube(object):
|
|
358 |
response = urlopen(url)
|
359 |
if not response:
|
360 |
raise PytubeError("Unable to open url: {0}".format(self.url))
|
361 |
-
self._js_cache = response.read()
|
362 |
try:
|
363 |
matches = reg_exp.search(self._js_cache)
|
364 |
if matches:
|
|
|
261 |
if not response:
|
262 |
raise PytubeError("Unable to open url: {0}".format(self.url))
|
263 |
|
264 |
+
html = response.read()
|
265 |
if "og:restrictions:age" in html:
|
266 |
raise AgeRestricted("Age restricted video. Unable to download "
|
267 |
"without being signed in.")
|
|
|
358 |
response = urlopen(url)
|
359 |
if not response:
|
360 |
raise PytubeError("Unable to open url: {0}".format(self.url))
|
361 |
+
self._js_cache = response.read()
|
362 |
try:
|
363 |
matches = reg_exp.search(self._js_cache)
|
364 |
if matches:
|