def urlopen(url, offset=None):
if url.startswith("//"):
- url = "http:" + url
+ url = "https:" + url
+ if not url.startswith("http://") and not url.startswith("https://"):
+ url = "https://www.youtube.com" + url
global referrer
req = urllib2.Request(url)
def find_func_name(script):
FUNC_NAME = R"([a-zA-Z0-9$]+)"
FUNC_PARAMS = R"(\([a-zA-Z]+\.s\))"
- TERMINATOR = R"[,;]"
+ TERMINATOR = R"[,;\)]"
PATTERN = FUNC_NAME + FUNC_PARAMS + TERMINATOR
match = re.search(PATTERN, script)