aboutsummaryrefslogtreecommitdiff
path: root/youtube_dl
diff options
context:
space:
mode:
authorTRox1972 <TRox1972@users.noreply.github.com>2016-05-19 03:42:09 +0200
committerSergey M․ <dstftw@gmail.com>2016-05-20 22:10:13 +0600
commit6756602be6b59c7bff57ccaeb33844cdc5636910 (patch)
treec5790bb93667c48838a0258c4aa9589aba6c7ecc /youtube_dl
parent6c114b12104e8c9d0713d1cb2cd6c4ddc7872b7f (diff)
downloadyoutube-dl-6756602be6b59c7bff57ccaeb33844cdc5636910.tar.xz
[LocalNews8] add extractor (Closes #9200)
Diffstat (limited to 'youtube_dl')
-rw-r--r--youtube_dl/extractor/extractors.py1
-rw-r--r--youtube_dl/extractor/localnews8.py29
2 files changed, 30 insertions, 0 deletions
diff --git a/youtube_dl/extractor/extractors.py b/youtube_dl/extractor/extractors.py
index 74aba2d5c..5b96a086d 100644
--- a/youtube_dl/extractor/extractors.py
+++ b/youtube_dl/extractor/extractors.py
@@ -396,6 +396,7 @@ from .livestream import (
LivestreamShortenerIE,
)
from .lnkgo import LnkGoIE
+from .localnews8 import LocalNews8IE
from .lovehomeporn import LoveHomePornIE
from .lrt import LRTIE
from .lynda import (
diff --git a/youtube_dl/extractor/localnews8.py b/youtube_dl/extractor/localnews8.py
new file mode 100644
index 000000000..b38d1d58a
--- /dev/null
+++ b/youtube_dl/extractor/localnews8.py
@@ -0,0 +1,29 @@
+# coding: utf-8
+from __future__ import unicode_literals
+
+from .common import InfoExtractor
+
+
+class LocalNews8IE(InfoExtractor):
+ _VALID_URL = r'https?://(?:www\.)?localnews8\.com/.+?/(?P<id>[0-9]+)'
+ _TEST = {
+ 'url': 'http://www.localnews8.com/news/rexburg-business-turns-carbon-fiber-scraps-into-wedding-rings/35183304',
+ 'md5': '477bdb188f177788c65db27ecb56649b',
+ 'info_dict': {
+ 'id': '35183304',
+ 'ext': 'mp4',
+ 'title': 'Rexburg business turns carbon fiber scraps into wedding ring',
+ 'description': 'The process was first invented by Lamborghini and less than a dozen companies around the world use it.',
+ 'duration': '153',
+ 'timestamp': '1441844822',
+ 'uploader_id': 'api',
+ }}
+
+ def _real_extract(self, url):
+ video_id = self._match_id(url)
+ webpage = self._download_webpage(url, video_id)
+
+ partner_id = self._search_regex(r'partnerId\s*:\s*"(\d+)"', webpage, video_id)
+ kaltura_id = self._search_regex(r'var\s+videoIdString\s*=\s*"kaltura:(.+)";', webpage, video_id)
+
+ return self.url_result('kaltura:%s:%s' % (partner_id, kaltura_id), 'Kaltura')