From 0ad70a76f0a16505683849690dda947323400444 Mon Sep 17 00:00:00 2001 From: schnusch Date: Fri, 30 Apr 2021 17:40:27 +0200 Subject: [PATCH] [ninjastream] fix video ID --- youtube_dl/extractor/ninjastream.py | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/youtube_dl/extractor/ninjastream.py b/youtube_dl/extractor/ninjastream.py index 92b918181..d91e0c853 100644 --- a/youtube_dl/extractor/ninjastream.py +++ b/youtube_dl/extractor/ninjastream.py @@ -11,7 +11,7 @@ class NinjaStreamIE(InfoExtractor): """ Handles downloading video from ninjastream.to """ - _VALID_URL = r'https?://(?:\w+\.)?ninjastream\.to/watch/[0-9a-zA-Z]+' + _VALID_URL = r'https?://(?:www\.)?ninjastream\.to/(?:download|watch)/(?P[^/?#]+)' _TESTS = [ { 'url': 'https://ninjastream.to/watch/GbJQP8rawQ7rw', @@ -24,13 +24,7 @@ class NinjaStreamIE(InfoExtractor): ] def _real_extract(self, url): - """ - Parses the URL into the video's URL. - """ - # Parse the video id - video_id = self._search_regex( - r'https?://(?:\w+\.)?ninjastream\.to/watch/([0-9a-zA-Z]+)', - url, 'video_id', fatal=False, default='') + video_id = self._match_id(url) # Get the hosted webpage webpage = self._download_webpage(url, video_id)