mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2024-11-08 22:17:07 +01:00
[youporn] Imrove JSON regex and preserve the old one
This commit is contained in:
parent
376817c6d4
commit
50c9949d7a
@ -47,7 +47,8 @@ def _real_extract(self, url):
|
|||||||
|
|
||||||
# Get JSON parameters
|
# Get JSON parameters
|
||||||
json_params = self._search_regex(
|
json_params = self._search_regex(
|
||||||
r'var videoJason = (.*)[,;]',
|
[r'var\s+videoJa?son\s*=\s*({.+?});',
|
||||||
|
r'var\s+currentVideo\s*=\s*new\s+Video\((.+?)\)[,;]'],
|
||||||
webpage, 'JSON parameters')
|
webpage, 'JSON parameters')
|
||||||
try:
|
try:
|
||||||
params = json.loads(json_params)
|
params = json.loads(json_params)
|
||||||
|
Loading…
Reference in New Issue
Block a user