From 3e863e341810a1769f5010adeae07ba0ccaa812f Mon Sep 17 00:00:00 2001 From: Dante Date: Wed, 8 Apr 2020 16:25:53 -0700 Subject: [PATCH] adding a valid_url for metrotvnews --- youtube_dl/extractor/extractors.py | 3 +- youtube_dl/extractor/ixigua.py | 32 --------------------- youtube_dl/extractor/metrotvnews.py | 43 +++++++++++++++++++++++++++++ 3 files changed, 45 insertions(+), 33 deletions(-) delete mode 100644 youtube_dl/extractor/ixigua.py create mode 100644 youtube_dl/extractor/metrotvnews.py diff --git a/youtube_dl/extractor/extractors.py b/youtube_dl/extractor/extractors.py index e311eec08..cb69c9cf4 100644 --- a/youtube_dl/extractor/extractors.py +++ b/youtube_dl/extractor/extractors.py @@ -490,7 +490,7 @@ from .ivi import ( from .ivideon import IvideonIE from .iwara import IwaraIE -from .ixigua import IxiguaIE + from .izlesene import IzleseneIE from .jamendo import ( JamendoIE, @@ -618,6 +618,7 @@ from .melonvod import MelonVODIE from .meta import METAIE from .metacafe import MetacafeIE from .metacritic import MetacriticIE +from .metrotvnews import MetrotvnewsIE from .mgoon import MgoonIE from .mgtv import MGTVIE from .miaopai import MiaoPaiIE diff --git a/youtube_dl/extractor/ixigua.py b/youtube_dl/extractor/ixigua.py deleted file mode 100644 index b3aefb17b..000000000 --- a/youtube_dl/extractor/ixigua.py +++ /dev/null @@ -1,32 +0,0 @@ -from __future__ import unicode_literals - -from .common import InfoExtractor - - - - -class IxiguaIE(InfoExtractor): - - _VALID_URL = r'https://www.ixigua.com/i(?P\d+)/' - - def _real_extract(self, url): - video_id = self._match_id(url) - - webpage = self._download_webpage( - url, video_id - ) - - title = self._html_search_regex(r'(\S+ - \S+)', webpage, 'title') - - download_url = self._html_search_regex( - - r'(https://cdn\.acidcow\.com/pics/[0-9]+/video/\S+\.mp4)', - - webpage, "download_url" - ) - return { - - 'id': video_id, - 'url': download_url, - 'title': title - } \ No newline at end of file diff --git a/youtube_dl/extractor/metrotvnews.py b/youtube_dl/extractor/metrotvnews.py new file mode 100644 index 000000000..3a1bb8924 --- /dev/null +++ b/youtube_dl/extractor/metrotvnews.py @@ -0,0 +1,43 @@ +from __future__ import unicode_literals + +from .common import InfoExtractor + + + + +class MetrotvnewsIE(InfoExtractor): + _VALID_URL = r'https:\/\/www.metrotvnews\.com\/play\/(?P\S+)-\S+' + + + def _real_extract(self, url): + video_id = self._match_id(url) + + webpage = self._download_webpage( + url, video_id + ) + + title = self._html_search_regex(r'(.+) - www.metrotvnews.com<\/title>', webpage, 'title') + ''' + download_url = self._html_search_regex( + + r'(https:\/\/celebsroulette\.com\/get_file\/1\/\S+\/[0-9]+\/[0-9]+\/[0-9]+\.mp4)', + + webpage, "download_url" + ) + + download_url = self._html_search_regex( + + r'(https:\/\/5-337-10435-2.b.cdn13.com\/contents\/videos\/3000\/3032\/3032\.mp4\?.+)', + + webpage, "download_url" + ) + ''' + download_url = self._html_search_regex( + r'(https:\/\/cdn01\.metrotvnews\.com\/videos\/\d+\/\d+\/\d+\/\S+.mp4)', + webpage, "download_url" + ) + return { + 'id': video_id, + 'url': download_url, + 'title': title + }