Skip to content

Commit

Permalink
[YouPorn] Improve upload_date extraction
Browse files Browse the repository at this point in the history
  • Loading branch information
dirkf committed May 28, 2022
1 parent 52c3751 commit 04fd328
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions youtube_dl/extractor/youporn.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# coding: utf-8
from __future__ import unicode_literals

import re
Expand Down Expand Up @@ -137,9 +138,10 @@ def _real_extract(self, url):
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)
Expand Down

0 comments on commit 04fd328

Please sign in to comment.