1
0
mirror of https://codeberg.org/polarisfm/youtube-dl synced 2025-02-18 10:07:55 +01:00

Added extractor for News18.com

This commit is contained in:
Ashwin Dhakaita 2018-11-04 07:55:51 +05:30
parent b99b0bcfa0
commit 45f72f2cd0
2 changed files with 24 additions and 0 deletions

View File

@ -708,6 +708,7 @@ from .newgrounds import (
NewgroundsIE,
NewgroundsPlaylistIE,
)
from .news18 import News18IE
from .newstube import NewstubeIE
from .nextmedia import (
NextMediaIE,

View File

@ -0,0 +1,23 @@
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<id>\d+)\.html'''
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'(?P<url>https?:\/\/vodpd\.news18\.com[\/\w_-]+\.mp4)', webpage, 'video URL',default='')
title = self._og_search_title(webpage)
return {
'url': video_url,
'id': video_id,
'title': title,
'ext': '.mp4'
}