diff options
| -rw-r--r-- | youtube_dl/extractor/behindkink.py | 29 | ||||
| -rw-r--r-- | youtube_dl/extractor/ntv.py | 2 | ||||
| -rw-r--r-- | youtube_dl/extractor/tvplay.py | 4 | ||||
| -rw-r--r-- | youtube_dl/extractor/youtube.py | 37 | ||||
| -rw-r--r-- | youtube_dl/utils.py | 4 | 
5 files changed, 43 insertions, 33 deletions
| diff --git a/youtube_dl/extractor/behindkink.py b/youtube_dl/extractor/behindkink.py index 31fdc0dcc..1bdc25812 100644 --- a/youtube_dl/extractor/behindkink.py +++ b/youtube_dl/extractor/behindkink.py @@ -10,15 +10,15 @@ from ..utils import url_basename  class BehindKinkIE(InfoExtractor):      _VALID_URL = r'http://(?:www\.)?behindkink\.com/(?P<year>[0-9]{4})/(?P<month>[0-9]{2})/(?P<day>[0-9]{2})/(?P<id>[^/#?_]+)'      _TEST = { -        'url': 'http://www.behindkink.com/2014/08/14/ab1576-performers-voice-finally-heard-the-bill-is-killed/', -        'md5': '41ad01222b8442089a55528fec43ec01', +        'url': 'http://www.behindkink.com/2014/12/05/what-are-you-passionate-about-marley-blaze/', +        'md5': '507b57d8fdcd75a41a9a7bdb7989c762',          'info_dict': { -            'id': '36370', +            'id': '37127',              'ext': 'mp4', -            'title': 'AB1576 - PERFORMERS VOICE FINALLY HEARD - THE BILL IS KILLED!', -            'description': 'The adult industry voice was finally heard as Assembly Bill 1576 remained\xa0 in suspense today at the Senate Appropriations Hearing. AB1576 was, among other industry damaging issues, a condom mandate...', -            'upload_date': '20140814', -            'thumbnail': 'http://www.behindkink.com/wp-content/uploads/2014/08/36370_AB1576_Win.jpg', +            'title': 'What are you passionate about – Marley Blaze', +            'description': 'md5:aee8e9611b4ff70186f752975d9b94b4', +            'upload_date': '20141205', +            'thumbnail': 'http://www.behindkink.com/wp-content/uploads/2014/12/blaze-1.jpg',              'age_limit': 18,          }      } @@ -26,26 +26,19 @@ class BehindKinkIE(InfoExtractor):      def _real_extract(self, url):          mobj = re.match(self._VALID_URL, url)          display_id = mobj.group('id') -        year = mobj.group('year') -        month = mobj.group('month') -        day = mobj.group('day') -        upload_date = year + month + day          webpage = self._download_webpage(url, display_id)          video_url = self._search_regex( -            r"'file':\s*'([^']+)'", -            webpage, 'URL base') - -        video_id = url_basename(video_url) -        video_id = video_id.split('_')[0] +            r'<source src="([^"]+)"', webpage, 'video URL') +        video_id = url_basename(video_url).split('_')[0] +        upload_date = mobj.group('year') + mobj.group('month') + mobj.group('day')          return {              'id': video_id, +            'display_id': display_id,              'url': video_url, -            'ext': 'mp4',              'title': self._og_search_title(webpage), -            'display_id': display_id,              'thumbnail': self._og_search_thumbnail(webpage),              'description': self._og_search_description(webpage),              'upload_date': upload_date, diff --git a/youtube_dl/extractor/ntv.py b/youtube_dl/extractor/ntv.py index 13c8d79cd..ee740cd9c 100644 --- a/youtube_dl/extractor/ntv.py +++ b/youtube_dl/extractor/ntv.py @@ -130,7 +130,7 @@ class NTVIE(InfoExtractor):                  'rtmp_conn': 'B:1',                  'player_url': 'http://www.ntv.ru/swf/vps1.swf?update=20131128',                  'page_url': 'http://www.ntv.ru', -                'flash_ver': 'LNX 11,2,202,341', +                'flash_version': 'LNX 11,2,202,341',                  'rtmp_live': True,                  'ext': 'flv',                  'filesize': int(size.text), diff --git a/youtube_dl/extractor/tvplay.py b/youtube_dl/extractor/tvplay.py index eb9473754..0157392cc 100644 --- a/youtube_dl/extractor/tvplay.py +++ b/youtube_dl/extractor/tvplay.py @@ -182,8 +182,8 @@ class TVPlayIE(InfoExtractor):              'http://playapi.mtgx.tv/v1/videos/%s' % video_id, video_id, 'Downloading video JSON')          if video['is_geo_blocked']: -            raise ExtractorError( -                'This content is not available in your country due to copyright reasons', expected=True) +            self.report_warning( +                'This content might not be available in your country due to copyright reasons')          streams = self._download_json(              'http://playapi.mtgx.tv/v1/videos/stream/%s' % video_id, video_id, 'Downloading streams JSON') diff --git a/youtube_dl/extractor/youtube.py b/youtube_dl/extractor/youtube.py index 42441d9fa..7b6179a2a 100644 --- a/youtube_dl/extractor/youtube.py +++ b/youtube_dl/extractor/youtube.py @@ -14,23 +14,24 @@ from .common import InfoExtractor, SearchInfoExtractor  from .subtitles import SubtitlesInfoExtractor  from ..jsinterp import JSInterpreter  from ..swfinterp import SWFInterpreter -from ..utils import ( +from ..compat import (      compat_chr,      compat_parse_qs,      compat_urllib_parse,      compat_urllib_request,      compat_urlparse,      compat_str, - +) +from ..utils import (      clean_html, -    get_element_by_id, -    get_element_by_attribute,      ExtractorError, +    get_element_by_attribute, +    get_element_by_id,      int_or_none,      OnDemandPagedList, +    orderedSet,      unescapeHTML,      unified_strdate, -    orderedSet,      uppercase_escape,  ) @@ -432,7 +433,23 @@ class YoutubeIE(YoutubeBaseInfoExtractor, SubtitlesInfoExtractor):              'expected_warnings': [                  'DASH manifest missing',              ] -        } +        }, +        # Olympics (https://github.com/rg3/youtube-dl/issues/4431) +        { +            'url': 'lqQg6PlCWgI', +            'info_dict': { +                'id': 'lqQg6PlCWgI', +                'ext': 'mp4', +                'upload_date': '20120731', +                'uploader_id': 'olympic', +                'description': 'HO09  - Women -  GER-AUS - Hockey - 31 July 2012 - London 2012 Olympic Games', +                'uploader': 'Olympics', +                'title': 'Hockey - Women -  GER-AUS - London 2012 Olympic Games', +            }, +            'params': { +                'skip_download': 'requires avconv', +            } +        },      ]      def __init__(self, *args, **kwargs): @@ -856,7 +873,7 @@ class YoutubeIE(YoutubeBaseInfoExtractor, SubtitlesInfoExtractor):          m_cat_container = self._search_regex(              r'(?s)<h4[^>]*>\s*Category\s*</h4>\s*<ul[^>]*>(.*?)</ul>', -            video_webpage, 'categories', fatal=False) +            video_webpage, 'categories', default=None)          if m_cat_container:              category = self._html_search_regex(                  r'(?s)<a[^<]+>(.*?)</a>', m_cat_container, 'category', @@ -934,7 +951,7 @@ class YoutubeIE(YoutubeBaseInfoExtractor, SubtitlesInfoExtractor):                  'url': video_info['conn'][0],                  'player_url': player_url,              }] -        elif len(video_info.get('url_encoded_fmt_stream_map', [])) >= 1 or len(video_info.get('adaptive_fmts', [])) >= 1: +        elif len(video_info.get('url_encoded_fmt_stream_map', [''])[0]) >= 1 or len(video_info.get('adaptive_fmts', [''])[0]) >= 1:              encoded_url_map = video_info.get('url_encoded_fmt_stream_map', [''])[0] + ',' + video_info.get('adaptive_fmts', [''])[0]              if 'rtmpe%3Dyes' in encoded_url_map:                  raise ExtractorError('rtmpe downloads are not supported, see https://github.com/rg3/youtube-dl/issues/343 for more information.', expected=True) @@ -1000,9 +1017,7 @@ class YoutubeIE(YoutubeBaseInfoExtractor, SubtitlesInfoExtractor):          # Look for the DASH manifest          if self._downloader.params.get('youtube_include_dash_manifest', True):              dash_mpd = video_info.get('dashmpd') -            if not dash_mpd: -                self.report_warning('%s: DASH manifest missing' % video_id) -            else: +            if dash_mpd:                  dash_manifest_url = dash_mpd[0]                  try:                      dash_formats = self._parse_dash_manifest( diff --git a/youtube_dl/utils.py b/youtube_dl/utils.py index a95d2c942..75f9594e6 100644 --- a/youtube_dl/utils.py +++ b/youtube_dl/utils.py @@ -712,8 +712,10 @@ def date_from_str(date_str):      Return a datetime object from a string in the format YYYYMMDD or      (now|today)[+-][0-9](day|week|month|year)(s)?"""      today = datetime.date.today() -    if date_str == 'now'or date_str == 'today': +    if date_str in ('now', 'today'):          return today +    if date_str == 'yesterday': +        return today - datetime.timedelta(days=1)      match = re.match('(now|today)(?P<sign>[+-])(?P<time>\d+)(?P<unit>day|week|month|year)(s)?', date_str)      if match is not None:          sign = match.group('sign') | 
