From 8b85d2d0195c36cd1cb4aa732401c9171a73b1cd Mon Sep 17 00:00:00 2001 From: Ashwin Dhakaita Date: Sun, 4 Nov 2018 10:13:07 +0530 Subject: [PATCH] [news18] Add new extractor --- youtube_dl/extractor/news18.py | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/youtube_dl/extractor/news18.py b/youtube_dl/extractor/news18.py index 22f8dfc0e..4776c444b 100644 --- a/youtube_dl/extractor/news18.py +++ b/youtube_dl/extractor/news18.py @@ -1,14 +1,13 @@ from __future__ import unicode_literals -import re - from .common import InfoExtractor + class News18IE(InfoExtractor): _VALID_URL = r'''https?:\/\/www\.news18\.com[a-zA-Z0-9_\/-]+-(?P\d+)\.html''' _TEST = { - 'url' : 'https://www.news18.com/news/ivideos/inside-naxal-bastion-news18-visits-the-villages-voting-first-time-ever-1928149.html', - 'md5' : 'cb5a78310f3e583da5ba0de38b450938', + 'url': 'https://www.news18.com/news/ivideos/inside-naxal-bastion-news18-visits-the-villages-voting-first-time-ever-1928149.html', + 'md5': 'cb5a78310f3e583da5ba0de38b450938', 'info_dict': { 'id': '1928149', 'ext': 'mp4', @@ -17,10 +16,9 @@ class News18IE(InfoExtractor): } def _real_extract(self, url): - IE_NAME = 'News18' video_id = self._match_id(url) - webpage = self._download_webpage(url,video_id) - video_url = self._search_regex(r'(?Phttps?:\/\/vodpd\.news18\.com[\/\w_-]+\.mp4)', webpage, 'video URL',default='') + webpage = self._download_webpage(url, video_id) + video_url = self._search_regex(r'(?Phttps?:\/\/vodpd\.news18\.com[\/\w_-]+\.mp4)', webpage, 'video URL', default='') title = self._og_search_title(webpage) return { @@ -29,4 +27,3 @@ class News18IE(InfoExtractor): 'title': title, 'ext': 'mp4' } -