1
0
mirror of https://github.com/ytdl-org/youtube-dl.git synced 2025-01-30 22:59:48 +00:00

[ninjastream] fix video ID

This commit is contained in:
schnusch 2021-04-30 17:40:27 +02:00
parent 291703cefd
commit 0ad70a76f0

View File

@ -11,7 +11,7 @@ class NinjaStreamIE(InfoExtractor):
""" """
Handles downloading video from ninjastream.to 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<id>[^/?#]+)'
_TESTS = [ _TESTS = [
{ {
'url': 'https://ninjastream.to/watch/GbJQP8rawQ7rw', 'url': 'https://ninjastream.to/watch/GbJQP8rawQ7rw',
@ -24,13 +24,7 @@ class NinjaStreamIE(InfoExtractor):
] ]
def _real_extract(self, url): def _real_extract(self, url):
""" video_id = self._match_id(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='')
# Get the hosted webpage # Get the hosted webpage
webpage = self._download_webpage(url, video_id) webpage = self._download_webpage(url, video_id)