[MLB] Add new extractor

Please review and merge the new extractor for MLB.com
Great idea, I'll make the changes and try again.

Date: Mon, 14 Jul 2014 15:28:03 -0700
From: notifications@github.com
To: youtube-dl@noreply.github.com
CC: chaochichen@hotmail.com
Subject: Re: [youtube-dl] [MLB] Add new extractor (#3252)

In youtube_dl/extractor/mlb.py:

> +
> +    def _real_extract(self, url):
> +        mobj = re.match(self._VALID_URL, url)
> +        video_id = mobj.group('id')
> +
> +        webpage = self._download_webpage(url, video_id)
> +
> +        title = self._og_search_title(webpage, default=video_id)
> +        description = self._html_search_regex(r'<meta name="description" (?:content|value)="(.*?)"/>', webpage, 'description', fatal=False)
> +        thumbnail = self._html_search_regex(r'<meta itemprop="image" (?:content|value)="(.*?)" />', webpage, 'image', fatal=False)
> +        
> +        # use the thumbnail URL to find the folder that contains the videos
> +        _image_url = r'http://mediadownloads.mlb.com/mlbam/(?P<_date>n?.+)/images/.*$'
> +        bobj = re.match(_image_url, thumbnail)
> +        datestr = bobj.group('_date')
> +        base_url = 'http://mediadownloads.mlb.com/mlbam/' + datestr

I've tried http://mediadownloads.mlb.com/mlbam/2014/07/12/ in a browser and it takes more than 50 seconds to download. We should use a faster method, for example looking into: http://m.mlb.com/gen/multimedia/detail/6/6/3/34496663.xml


—
Reply to this email directly or view it on GitHub.