mirror of
https://github.com/l1ving/youtube-dl
synced 2025-02-11 18:12:52 +08:00
Fixed Pornhub Extractor
This commit is contained in:
parent
896a15aea4
commit
8ee42812f1
@ -159,21 +159,23 @@ class PornHubIE(InfoExtractor):
|
|||||||
video_variables = []
|
video_variables = []
|
||||||
video_variablenames = []
|
video_variablenames = []
|
||||||
for video_variablename, quote, video_variable in re.findall(
|
for video_variablename, quote, video_variable in re.findall(
|
||||||
r'(player_quality_[0-9]{3,4}p.*?)=\s*(["\'])(.+?)\1;', webpage):
|
r'(player_quality_[0-9]{3,4}p[0-9a-z]+?)=\s*(["\'])(.*?)\2;', webpage):
|
||||||
video_variables.append(compat_urllib_parse_unquote(re.sub(
|
video_variables.append(video_variable)
|
||||||
r'{0}\s*\+\s*{0}'.format(quote), '', video_variable)))
|
|
||||||
video_variablenames.append(video_variablename)
|
video_variablenames.append(video_variablename)
|
||||||
|
exestring = str(video_variablename) + ' = "' + str(video_variable) + '"'
|
||||||
|
exec(exestring) in locals()
|
||||||
|
|
||||||
video_urls = []
|
encoded_video_urls = []
|
||||||
for video_url in re.findall(
|
for encoded_video_url in re.findall(
|
||||||
r'player_quality_[0-9]{3,4}p\s*=(.*?);', webpage):
|
r'player_quality_[0-9]{3,4}p\s*=(.*?);', webpage):
|
||||||
video_urls.append(video_url)
|
encoded_video_urls.append(encoded_video_url)
|
||||||
|
|
||||||
print('varnames: ' + str(video_variablenames))
|
|
||||||
print('vars: ' + str(video_variables))
|
|
||||||
print('urls: ' + str(video_urls))
|
|
||||||
|
|
||||||
# Decode the URLs
|
# Decode the URLs
|
||||||
|
video_urls = []
|
||||||
|
for url in encoded_video_urls:
|
||||||
|
exestring = 'video_urls.append(' + str(url) + ')'
|
||||||
|
#print('exe2: ' + exestring)
|
||||||
|
exec(exestring) in locals()
|
||||||
|
|
||||||
if webpage.find('"encrypted":true') != -1:
|
if webpage.find('"encrypted":true') != -1:
|
||||||
password = compat_urllib_parse_unquote_plus(
|
password = compat_urllib_parse_unquote_plus(
|
||||||
|
Loading…
Reference in New Issue
Block a user