summary refs log tree commit diff
diff options
context:
space:
mode:
authorPhilipp Hagemeister <phihag@phihag.de>2014-01-28 03:53:00 +0100
committerPhilipp Hagemeister <phihag@phihag.de>2014-01-28 03:53:00 +0100
commite299f6d27f8ba003e22ccbc550309ea60e7229ad (patch)
tree0d74089e99ff94f6bce6bb0f060ab75ee9c1e4d9
parent4a192f817ee8f3283e0799a4b960b762a8590770 (diff)
downloadyoutube-dl-e299f6d27f8ba003e22ccbc550309ea60e7229ad.tar.gz
youtube-dl-e299f6d27f8ba003e22ccbc550309ea60e7229ad.tar.xz
youtube-dl-e299f6d27f8ba003e22ccbc550309ea60e7229ad.zip
[pornhd] Fix
-rw-r--r--youtube_dl/extractor/pornhd.py24
1 files changed, 15 insertions, 9 deletions
diff --git a/youtube_dl/extractor/pornhd.py b/youtube_dl/extractor/pornhd.py
index e9ff8d1af..58f9c690e 100644
--- a/youtube_dl/extractor/pornhd.py
+++ b/youtube_dl/extractor/pornhd.py
@@ -1,3 +1,5 @@
+from __future__ import unicode_literals
+
 import re
 
 from .common import InfoExtractor
@@ -7,12 +9,12 @@ from ..utils import compat_urllib_parse
 class PornHdIE(InfoExtractor):
     _VALID_URL = r'(?:http://)?(?:www\.)?pornhd\.com/(?:[a-z]{2,4}/)?videos/(?P<video_id>[0-9]+)/(?P<video_title>.+)'
     _TEST = {
-        u'url': u'http://www.pornhd.com/videos/1962/sierra-day-gets-his-cum-all-over-herself-hd-porn-video',
-        u'file': u'1962.flv',
-        u'md5': u'35272469887dca97abd30abecc6cdf75',
-        u'info_dict': {
-            u"title": u"sierra-day-gets-his-cum-all-over-herself-hd-porn-video",
-            u"age_limit": 18,
+        'url': 'http://www.pornhd.com/videos/1962/sierra-day-gets-his-cum-all-over-herself-hd-porn-video',
+        'file': '1962.flv',
+        'md5': '35272469887dca97abd30abecc6cdf75',
+        'info_dict': {
+            "title": "sierra-day-gets-his-cum-all-over-herself-hd-porn-video",
+            "age_limit": 18,
         }
     }
 
@@ -24,9 +26,13 @@ class PornHdIE(InfoExtractor):
 
         webpage = self._download_webpage(url, video_id)
 
-        video_url = self._html_search_regex(
-            r'&hd=(http.+?)&', webpage, u'video URL')
-        video_url = compat_urllib_parse.unquote(video_url)
+        next_url = self._html_search_regex(
+            r'&hd=(http.+?)&', webpage, 'video URL')
+        next_url = compat_urllib_parse.unquote(next_url)
+
+        video_url = self._download_webpage(
+            next_url, video_id, note='Retrieving video URL',
+            errnote='Could not retrieve video URL')
         age_limit = 18
 
         return {