Improve URL extraction

This commit is contained in:
Sergey M․ 2018-07-21 19:08:28 +07:00
parent 4ecf300d13
commit 3052a30d42
No known key found for this signature in database
GPG key ID: 2C393E0F18A9236D
47 changed files with 166 additions and 139 deletions

View file

@ -11,6 +11,7 @@ from ..compat import (
from ..utils import (
ExtractorError,
parse_duration,
url_or_none,
urlencode_postdata,
)
@ -80,7 +81,7 @@ class FrontendMastersPageBaseIE(FrontendMastersBaseIE):
chapters = []
lesson_elements = course.get('lessonElements')
if isinstance(lesson_elements, list):
chapters = [e for e in lesson_elements if isinstance(e, compat_str)]
chapters = [url_or_none(e) for e in lesson_elements if url_or_none(e)]
return chapters
@staticmethod