[viidia] remove unused imports ,use compat_str and extract playlist if it' an event
This commit is contained in:
parent
61c9118134
commit
85e4942f99
@ -4,11 +4,10 @@ import re
|
|||||||
|
|
||||||
from .common import InfoExtractor
|
from .common import InfoExtractor
|
||||||
from ..compat import (
|
from ..compat import (
|
||||||
compat_HTTPError,
|
|
||||||
compat_urlparse,
|
compat_urlparse,
|
||||||
|
compat_str,
|
||||||
)
|
)
|
||||||
from ..utils import (
|
from ..utils import (
|
||||||
ExtractorError,
|
|
||||||
parse_duration,
|
parse_duration,
|
||||||
js_to_json,
|
js_to_json,
|
||||||
parse_iso8601,
|
parse_iso8601,
|
||||||
@ -97,7 +96,7 @@ class ViideaIE(InfoExtractor):
|
|||||||
|
|
||||||
webpage = self._download_webpage(url, lecture_slug)
|
webpage = self._download_webpage(url, lecture_slug)
|
||||||
|
|
||||||
cfg = self._parse_json(self._search_regex(r'cfg\s*:\s*({[^}]+})', webpage, 'cfg'), lecture_slug, js_to_json)
|
cfg = self._parse_json(self._search_regex([r'cfg\s*:\s*({.+?}),[\da-zA-Z_]:\(?function', r'cfg\s*:\s*({[^}]+})'], webpage, 'cfg'), lecture_slug, js_to_json)
|
||||||
|
|
||||||
lecture_id = str(cfg['obj_id'])
|
lecture_id = str(cfg['obj_id'])
|
||||||
|
|
||||||
@ -116,9 +115,9 @@ class ViideaIE(InfoExtractor):
|
|||||||
|
|
||||||
entries = []
|
entries = []
|
||||||
parts = cfg.get('videos')
|
parts = cfg.get('videos')
|
||||||
if parts:
|
if lecture_data.get('type') != 'evt' and parts:
|
||||||
if len(parts) == 1:
|
if len(parts) == 1:
|
||||||
part = str(parts[0])
|
part = compat_str(parts[0])
|
||||||
if part:
|
if part:
|
||||||
smil_url = '%s/%s/video/%s/smil.xml' % (base_url, lecture_slug, part)
|
smil_url = '%s/%s/video/%s/smil.xml' % (base_url, lecture_slug, part)
|
||||||
smil = self._download_smil(smil_url, lecture_id)
|
smil = self._download_smil(smil_url, lecture_id)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user