Plugin cleanup and tweaks

This commit is contained in:
2023-02-20 19:18:45 -06:00
parent 372e4ff3dc
commit 3ad9e1c7bb
1138 changed files with 48878 additions and 40445 deletions

View File

@@ -1,6 +1,3 @@
# coding: utf-8
from __future__ import unicode_literals
import hashlib
import random
import re
@@ -117,8 +114,8 @@ class NexxIE(InfoExtractor):
webpage)
return mobj.group('id') if mobj else None
@staticmethod
def _extract_urls(webpage):
@classmethod
def _extract_embed_urls(cls, url, webpage):
# Reference:
# 1. https://nx-s.akamaized.net/files/201510/44.pdf
@@ -138,10 +135,6 @@ class NexxIE(InfoExtractor):
return entries
@staticmethod
def _extract_url(webpage):
return NexxIE._extract_urls(webpage)[0]
def _handle_error(self, response):
if traverse_obj(response, ('metadata', 'notice'), expected_type=str):
self.report_warning('%s said: %s' % (self.IE_NAME, response['metadata']['notice']))
@@ -459,8 +452,6 @@ class NexxIE(InfoExtractor):
else:
self.raise_no_formats(f'{cdn} formats are currently not supported', video_id)
self._sort_formats(formats)
subtitles = {}
for sub in video.get('captiondata') or []:
if sub.get('data'):
@@ -501,6 +492,8 @@ class NexxIE(InfoExtractor):
class NexxEmbedIE(InfoExtractor):
_VALID_URL = r'https?://embed\.nexx(?:\.cloud|cdn\.com)/\d+/(?:video/)?(?P<id>[^/?#&]+)'
# Reference. https://nx-s.akamaized.net/files/201510/44.pdf
_EMBED_REGEX = [r'<iframe[^>]+\bsrc=(["\'])(?P<url>(?:https?:)?//embed\.nexx(?:\.cloud|cdn\.com)/\d+/(?:(?!\1).)+)\1']
_TESTS = [{
'url': 'http://embed.nexx.cloud/748/KC1614647Z27Y7T?autoplay=1',
'md5': '16746bfc28c42049492385c989b26c4a',
@@ -524,16 +517,6 @@ class NexxEmbedIE(InfoExtractor):
'only_matching': True,
}]
@staticmethod
def _extract_urls(webpage):
# Reference:
# 1. https://nx-s.akamaized.net/files/201510/44.pdf
# iFrame Embed Integration
return [mobj.group('url') for mobj in re.finditer(
r'<iframe[^>]+\bsrc=(["\'])(?P<url>(?:https?:)?//embed\.nexx(?:\.cloud|cdn\.com)/\d+/(?:(?!\1).)+)\1',
webpage)]
def _real_extract(self, url):
embed_id = self._match_id(url)