mirror of
https://codeberg.org/polarisfm/youtube-dl
synced 2024-11-29 11:44:33 +01:00
[Panopto] Document methods wrt PEP 257
This commit is contained in:
parent
0807e39d85
commit
a29e634cfe
@ -21,6 +21,7 @@ class PanoptoBaseIE(InfoExtractor):
|
|||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def _match_organization(cls, url):
|
def _match_organization(cls, url):
|
||||||
|
"""Match and return the organization part of a Panopto hosted URL."""
|
||||||
if '_VALID_URL_RE' not in cls.__dict__:
|
if '_VALID_URL_RE' not in cls.__dict__:
|
||||||
cls._VALID_URL_RE = re.compile(cls._VALID_URL)
|
cls._VALID_URL_RE = re.compile(cls._VALID_URL)
|
||||||
m = cls._VALID_URL_RE.match(url)
|
m = cls._VALID_URL_RE.match(url)
|
||||||
@ -35,12 +36,14 @@ class PanoptoIE(PanoptoBaseIE):
|
|||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def _get_contribs_str(contribs):
|
def _get_contribs_str(contribs):
|
||||||
|
"""Returns a comma-delimited string of contributors."""
|
||||||
s = ''
|
s = ''
|
||||||
for c in contribs:
|
for c in contribs:
|
||||||
s += '{}, ' .format(c['DisplayName'])
|
s += '{}, ' .format(c['DisplayName'])
|
||||||
return s[:-2] if len(contribs) else ''
|
return s[:-2] if len(contribs) else ''
|
||||||
|
|
||||||
def _real_extract(self, url):
|
def _real_extract(self, url):
|
||||||
|
"""Extracts the video and stream information for the given Panopto hosted URL."""
|
||||||
video_id = self._match_id(url)
|
video_id = self._match_id(url)
|
||||||
org = self._match_organization(url)
|
org = self._match_organization(url)
|
||||||
|
|
||||||
@ -138,6 +141,7 @@ class PanoptoFolderIE(PanoptoBaseIE):
|
|||||||
_VALID_URL = r'^https?:\/\/(?P<org>[a-z0-9]+)\.hosted\.panopto.com\/Panopto\/Pages\/Sessions\/List\.aspx#folderID=(?:"|%22)(?P<id>[a-f0-9-]+)'
|
_VALID_URL = r'^https?:\/\/(?P<org>[a-z0-9]+)\.hosted\.panopto.com\/Panopto\/Pages\/Sessions\/List\.aspx#folderID=(?:"|%22)(?P<id>[a-f0-9-]+)'
|
||||||
|
|
||||||
def _real_extract(self, url):
|
def _real_extract(self, url):
|
||||||
|
"""Recursively extracts the video and stream information for the given Panopto hosted URL."""
|
||||||
url, smuggled = unsmuggle_url(url)
|
url, smuggled = unsmuggle_url(url)
|
||||||
if smuggled is None:
|
if smuggled is None:
|
||||||
smuggled = {}
|
smuggled = {}
|
||||||
|
Loading…
Reference in New Issue
Block a user