From 4c3bc5ba4e893c062eb1da1684011419c402ade2 Mon Sep 17 00:00:00 2001 From: Erik Date: Mon, 19 Oct 2015 20:19:25 +0200 Subject: [PATCH] [youporn] Fixed date, fatal, formats and /s* --- youtube_dl/extractor/youporn.py | 29 +++++++++++------------------ 1 file changed, 11 insertions(+), 18 deletions(-) diff --git a/youtube_dl/extractor/youporn.py b/youtube_dl/extractor/youporn.py index ac35be13f..3886c1b45 100644 --- a/youtube_dl/extractor/youporn.py +++ b/youtube_dl/extractor/youporn.py @@ -4,6 +4,7 @@ from __future__ import unicode_literals import json import re import sys +import datetime from .common import InfoExtractor from ..compat import ( @@ -31,7 +32,7 @@ class YouPornIE(InfoExtractor): 'description': 'Watch Sex Ed: Is It Safe To Masturbate Daily? at YouPorn.com - YouPorn is the biggest free porn tube site on the net!', 'uploader': 'Ask Dan And Jennifer', 'thumbnail': 'http://cdn5.image.youporn.phncdn.com/201012/17/505835/640x480/8/sex-ed-is-it-safe-to-masturbate-daily-8.jpg', - 'date': 'December 21, 2010', + 'date': '20101221', 'age_limit': 18, } } @@ -47,30 +48,22 @@ class YouPornIE(InfoExtractor): age_limit = self._rta_search(webpage) self.report_extraction(video_id) - video_title = self._html_search_regex(r'page_params.video_title = \'(.+?)\';', webpage, 'video URL') - video_description = self._html_search_meta('description', webpage, 'video DESC') - video_thumbnail = self._html_search_regex(r'page_params.imageurl\t=\t"(.+?)";', webpage, 'video THUMB') - video_uploader = self._html_search_regex(r"
By:
\n]+\">(.+?)", webpage, 'video UPLOADER') - video_date = self._html_search_regex(r"
\n (.+?)\n
", webpage, 'video DATE') + video_title = self._html_search_regex(r'page_params.video_title = \'(.+?)\';', webpage, 'video URL', fatal=False) + video_description = self._html_search_meta('description', webpage, 'video DESC', fatal=False) + video_thumbnail = self._html_search_regex(r'page_params.imageurl\t=\t"(.+?)";', webpage, 'video THUMB', fatal=False) + video_uploader = self._html_search_regex(r"
By:
\n]+\">(.+?)", webpage, 'video UPLOADER', fatal=False) + video_date = self._html_search_regex(r"
\n (.+?)\n
", webpage, 'video DATE', fatal=False) + video_date = datetime.datetime.strptime(video_date, '%B %d, %Y').strftime('%Y%m%d') # Get all of the links from the page - DOWNLOAD_LIST_RE = r'(?s)