aboutsummaryrefslogtreecommitdiff
path: root/youtube_dl/extractor/veoh.py
diff options
context:
space:
mode:
authorPhilipp Hagemeister <phihag@phihag.de>2014-02-25 01:45:00 +0100
committerPhilipp Hagemeister <phihag@phihag.de>2014-02-25 01:45:00 +0100
commiteda1d49a62b92b3dbefd8b80702a5dec7f0617ad (patch)
tree11c3676cafad17780da89d48417e2be349afc346 /youtube_dl/extractor/veoh.py
parent62e609ab771140b185e98ed085445d40b751cbfc (diff)
parent2bfe4ead4ba13e1fed69e70ef49cec9dfa7f84a2 (diff)
downloadyoutube-dl-eda1d49a62b92b3dbefd8b80702a5dec7f0617ad.tar.xz
Merge remote-tracking branch 'origin/master'
Diffstat (limited to 'youtube_dl/extractor/veoh.py')
-rw-r--r--youtube_dl/extractor/veoh.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/youtube_dl/extractor/veoh.py b/youtube_dl/extractor/veoh.py
index baa57f343..c90feefd2 100644
--- a/youtube_dl/extractor/veoh.py
+++ b/youtube_dl/extractor/veoh.py
@@ -4,6 +4,7 @@ import re
import json
from .common import InfoExtractor
+from ..utils import compat_urllib_request
class VeohIE(InfoExtractor):
@@ -24,6 +25,13 @@ class VeohIE(InfoExtractor):
mobj = re.match(self._VALID_URL, url)
video_id = mobj.group('id')
webpage = self._download_webpage(url, video_id)
+ age_limit = 0
+ if 'class="adultwarning-container"' in webpage:
+ self.report_age_confirmation()
+ age_limit = 18
+ request = compat_urllib_request.Request(url)
+ request.add_header('Cookie', 'confirmedAdult=true')
+ webpage = self._download_webpage(request, video_id)
m_youtube = re.search(r'http://www\.youtube\.com/v/(.*?)(\&|")', webpage)
if m_youtube is not None:
@@ -44,4 +52,5 @@ class VeohIE(InfoExtractor):
'thumbnail': info.get('highResImage') or info.get('medResImage'),
'description': info['description'],
'view_count': info['views'],
+ 'age_limit': age_limit,
}