hbmartin commited on
Commit
d214d8a
·
1 Parent(s): 533a3cc

guard against non-http(s) requests

Browse files
Files changed (1) hide show
  1. pytube/request.py +2 -0
pytube/request.py CHANGED
@@ -6,6 +6,8 @@ from urllib.request import urlopen
6
 
7
 
8
  def _execute_request(url: str) -> Any:
 
 
9
  return urlopen(Request(url, headers={"User-Agent": "Mozilla/5.0"}))
10
 
11
 
 
6
 
7
 
8
  def _execute_request(url: str) -> Any:
9
+ if not url.lower().startswith('http'):
10
+ raise ValueError
11
  return urlopen(Request(url, headers={"User-Agent": "Mozilla/5.0"}))
12
 
13