Skip to content

Conversation

@Grabien
Copy link
Contributor

@Grabien Grabien commented Jul 18, 2022

The stream.nbcnews.com API host used in the plugin recently stopped working. It fixes of plugin for the new API endpoint.

Copy link
Member

@bastimeyer bastimeyer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR. The rest is looking fine.

The plugin could use a rewrite/cleanup though, but that's not important right now... (parsing HTML and querying XPath instead of matching a regex, moving schemas away from class attribute definitions, replacing single-quote strings, using self.id instead of video_id, etc)

from streamlink.plugin import Plugin, pluginmatcher
from streamlink.plugin.api import validate
from streamlink.stream.hls import HLSStream
from streamlink.stream import HLSStream
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't change the HLSStream import

from streamlink.plugin.api import validate
from streamlink.stream.hls import HLSStream
from streamlink.stream import HLSStream
from streamlink.utils import parse_json
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't import this. The validate.parse_json() method should be used.

Comment on lines +41 to +44
validate.get('cdnSources'),
validate.get('primary'),
validate.get(0),
validate.get('sourceUrl'),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

validate.get can receive a tuple of strings which will call __getitem__ on each successive object, which is much better than calling validate.get lots of times.

@bastimeyer bastimeyer added the plugin issue A Plugin does not work correctly label Jul 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

plugin issue A Plugin does not work correctly

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants