X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=youtube_dl%2Fextractor%2Fgoldenmoustache.py;h=0fb5097244a6218afca0a0908448127f74073b77;hb=b5aad37f6bdc72acaca198202dc9f7eaa3185e51;hp=f2e231bf4b1422c7ad53554a1ef5b96f3cd4ffac;hpb=11b28e93d3a5496916e55a717c362fe7a6a1c7e7;p=youtube-dl diff --git a/youtube_dl/extractor/goldenmoustache.py b/youtube_dl/extractor/goldenmoustache.py index f2e231bf4..0fb509724 100644 --- a/youtube_dl/extractor/goldenmoustache.py +++ b/youtube_dl/extractor/goldenmoustache.py @@ -1,16 +1,11 @@ from __future__ import unicode_literals -import re from .common import InfoExtractor -from ..utils import ( - parse_duration, - int_or_none, -) class GoldenMoustacheIE(InfoExtractor): _VALID_URL = r'https?://(?:www\.)?goldenmoustache\.com/(?P[\w-]+)-(?P\d+)' - _TEST = { + _TESTS = [{ 'url': 'http://www.goldenmoustache.com/suricate-le-poker-3700/', 'md5': '0f904432fa07da5054d6c8beb5efb51a', 'info_dict': { @@ -19,9 +14,18 @@ class GoldenMoustacheIE(InfoExtractor): 'title': 'Suricate - Le Poker', 'description': 'md5:3d1f242f44f8c8cb0a106f1fd08e5dc9', 'thumbnail': 're:^https?://.*\.jpg$', - 'view_count': int, } - } + }, { + 'url': 'http://www.goldenmoustache.com/le-lab-tout-effacer-mc-fly-et-carlito-55249/', + 'md5': '27f0c50fb4dd5f01dc9082fc67cd5700', + 'info_dict': { + 'id': '55249', + 'ext': 'mp4', + 'title': 'Le LAB - Tout Effacer (Mc Fly et Carlito)', + 'description': 'md5:9b7fbf11023fb2250bd4b185e3de3b2a', + 'thumbnail': 're:^https?://.*\.(?:png|jpg)$', + } + }] def _real_extract(self, url): video_id = self._match_id(url) @@ -30,12 +34,9 @@ class GoldenMoustacheIE(InfoExtractor): video_url = self._html_search_regex( r'data-src-type="mp4" data-src="([^"]+)"', webpage, 'video URL') title = self._html_search_regex( - r'(.*?) - Golden Moustache', webpage, 'title') + r'(.*?)(?: - Golden Moustache)?', webpage, 'title') thumbnail = self._og_search_thumbnail(webpage) description = self._og_search_description(webpage) - view_count = int_or_none(self._html_search_regex( - r'([0-9]+)\s*VUES', - webpage, 'view count', fatal=False)) return { 'id': video_id, @@ -44,5 +45,4 @@ class GoldenMoustacheIE(InfoExtractor): 'title': title, 'description': description, 'thumbnail': thumbnail, - 'view_count': view_count, }