From a1eed21067da64a4434c4e4b0fee3ef7edfdd5fd Mon Sep 17 00:00:00 2001 From: RingoTheDog Date: Fri, 29 Apr 2016 09:38:22 -0700 Subject: [PATCH 1/3] Create lpga.py --- youtube_dl/extractor/lpga.py | 38 ++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 youtube_dl/extractor/lpga.py diff --git a/youtube_dl/extractor/lpga.py b/youtube_dl/extractor/lpga.py new file mode 100644 index 000000000..70b0baa66 --- /dev/null +++ b/youtube_dl/extractor/lpga.py @@ -0,0 +1,38 @@ +# coding: utf-8 +from __future__ import unicode_literals + +from .common import InfoExtractor + + +class YourExtractorIE(InfoExtractor): + _VALID_URL = r'https?://(?:www\.)?lpga\.com/watch/(?P[0-9]+)' + _TEST = { + 'url': 'http://www.lpga.com/videos/brooke-henderson-talks-about-solid-back-9-after-opening-round-of-2016-voa-texas-shootout', + 'md5': '0d3b32a11fdb2ab46f66be2932ea10a68790aa1d', + 'info_dict': { + 'id': '42', + 'ext': 'mp4', + 'title': 'Video title goes here', + 'thumbnail': 're:^https?://.*\.jpg$', + # TODO more properties, either as: + # * A value + # * MD5 checksum; start the string with md5: + # * A regular expression; start the string with re: + # * Any Python type (for example int or float) + } + } + + def _real_extract(self, url): + video_id = self._match_id(url) + webpage = self._download_webpage(url, video_id) + + # TODO more code goes here, for example ... + title = self._html_search_regex(r'

(.+?)

', webpage, 'title') + + return { + 'id': video_id, + 'title': title, + 'description': self._og_search_description(webpage), + 'uploader': self._search_regex(r']+id="uploader"[^>]*>([^<]+)<', webpage, 'uploader', fatal=False), + # TODO more properties (see youtube_dl/extractor/common.py) + } From 8c53281796f6e2f8b6d8e801fec04b898e99c2b3 Mon Sep 17 00:00:00 2001 From: RingoTheDog Date: Fri, 29 Apr 2016 09:41:22 -0700 Subject: [PATCH 2/3] Update extractors.py --- youtube_dl/extractor/extractors.py | 1 + 1 file changed, 1 insertion(+) diff --git a/youtube_dl/extractor/extractors.py b/youtube_dl/extractor/extractors.py index b1b7f9b42..11edeeea7 100644 --- a/youtube_dl/extractor/extractors.py +++ b/youtube_dl/extractor/extractors.py @@ -389,6 +389,7 @@ from .livestream import ( LivestreamShortenerIE, ) from .lnkgo import LnkGoIE +from .lpga import lpga from .lovehomeporn import LoveHomePornIE from .lrt import LRTIE from .lynda import ( From dbb67928bec3f44bac09eb3855ff838026a99ee6 Mon Sep 17 00:00:00 2001 From: RingoTheDog Date: Fri, 29 Apr 2016 09:56:17 -0700 Subject: [PATCH 3/3] Update lpga.py --- youtube_dl/extractor/lpga.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/youtube_dl/extractor/lpga.py b/youtube_dl/extractor/lpga.py index 70b0baa66..1d014ea4e 100644 --- a/youtube_dl/extractor/lpga.py +++ b/youtube_dl/extractor/lpga.py @@ -12,7 +12,7 @@ class YourExtractorIE(InfoExtractor): 'info_dict': { 'id': '42', 'ext': 'mp4', - 'title': 'Video title goes here', + 'title': 'Brooke Henderson Talks About Solid Back 9 after Opening Round of 2016 VOA Texas Shootout', 'thumbnail': 're:^https?://.*\.jpg$', # TODO more properties, either as: # * A value