diff options
author | dirkf <[email protected]> | 2022-05-28 13:54:32 +0100 |
---|---|---|
committer | dirkf <[email protected]> | 2022-05-28 13:54:32 +0100 |
commit | 04fd3289d30de3c99c7d2de34d555b050bc96d4d (patch) | |
tree | 69bc5755ee5219a282f058743bc17be68cd79bde | |
parent | 52c3751df722ab6f31f0229a415c7389a95c2307 (diff) | |
download | youtube-dl-04fd3289d30de3c99c7d2de34d555b050bc96d4d.tar.gz youtube-dl-04fd3289d30de3c99c7d2de34d555b050bc96d4d.zip |
[YouPorn] Improve `upload_date` extraction
See https://github.com/yt-dlp/yt-dlp/issues/2701#issuecomment-1034341883
-rw-r--r-- | youtube_dl/extractor/youporn.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/youtube_dl/extractor/youporn.py b/youtube_dl/extractor/youporn.py index 7084d3d12..31e8abb72 100644 --- a/youtube_dl/extractor/youporn.py +++ b/youtube_dl/extractor/youporn.py @@ -1,3 +1,4 @@ +# coding: utf-8 from __future__ import unicode_literals import re @@ -137,9 +138,10 @@ class YouPornIE(InfoExtractor): r'(?s)<div[^>]+class=["\']submitByLink["\'][^>]*>(.+?)</div>', webpage, 'uploader', fatal=False) upload_date = unified_strdate(self._html_search_regex( - [r'UPLOADED:\s*<span>([^<]+)', + (r'UPLOADED:\s*<span>([^<]+)', r'Date\s+[Aa]dded:\s*<span>([^<]+)', - r'(?s)<div[^>]+class=["\']videoInfo(?:Date|Time)["\'][^>]*>(.+?)</div>'], + r'''(?s)<div[^>]+class=["']videoInfo(?:Date|Time)\b[^>]*>(.+?)</div>''', + r'(?s)<label\b[^>]*>Uploaded[^<]*</label>\s*<span\b[^>]*>(.+?)</span>'), webpage, 'upload date', fatal=False)) age_limit = self._rta_search(webpage) |