aboutsummaryrefslogtreecommitdiffhomepage
path: root/youtube_dl/extractor/videopress.py
diff options
context:
space:
mode:
authorYen Chi Hsuan <[email protected]>2017-05-01 23:09:18 +0800
committerYen Chi Hsuan <[email protected]>2017-05-04 16:26:17 +0800
commit0c265486016b06342fb257966474ce591667aaff (patch)
tree535a5d3331dd5be08e818174e630389485ad30ac /youtube_dl/extractor/videopress.py
parent5401bea27fd6bcdd030e50f3af85145807eeab27 (diff)
downloadyoutube-dl-0c265486016b06342fb257966474ce591667aaff.tar.gz
youtube-dl-0c265486016b06342fb257966474ce591667aaff.zip
[cda] Implement birthday verification (closes #12789)
Diffstat (limited to 'youtube_dl/extractor/videopress.py')
-rw-r--r--youtube_dl/extractor/videopress.py9
1 files changed, 3 insertions, 6 deletions
diff --git a/youtube_dl/extractor/videopress.py b/youtube_dl/extractor/videopress.py
index 049db25a5..e5f964d39 100644
--- a/youtube_dl/extractor/videopress.py
+++ b/youtube_dl/extractor/videopress.py
@@ -1,7 +1,6 @@
# coding: utf-8
from __future__ import unicode_literals
-import random
import re
from .common import InfoExtractor
@@ -11,6 +10,7 @@ from ..utils import (
float_or_none,
parse_age_limit,
qualities,
+ random_birthday,
try_get,
unified_timestamp,
urljoin,
@@ -47,13 +47,10 @@ class VideoPressIE(InfoExtractor):
def _real_extract(self, url):
video_id = self._match_id(url)
+ query = random_birthday('birth_year', 'birth_month', 'birth_day')
video = self._download_json(
'https://public-api.wordpress.com/rest/v1.1/videos/%s' % video_id,
- video_id, query={
- 'birth_month': random.randint(1, 12),
- 'birth_day': random.randint(1, 31),
- 'birth_year': random.randint(1950, 1995),
- })
+ video_id, query=query)
title = video['title']