Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

generic plugin error message #1

Closed
johnthecracker opened this issue Oct 11, 2018 · 3 comments
Closed

generic plugin error message #1

johnthecracker opened this issue Oct 11, 2018 · 3 comments
Labels
question Further information is requested solved

Comments

@johnthecracker
Copy link

johnthecracker commented Oct 11, 2018

streamlink-0.14.2-20181001.exe

I installed generic.py in 2 different ways, and outcome is the same.

First time I copied plugin to plugins directory, C:\P\STREAMLINK\pkgs\streamlink\plugins

second time to %APPDATA%\streamlink\plugins, C:\Users\J\AppData\Roaming\streamlink\plugins

I have resolve.py in plugins directory C:\P\STREAMLINK\pkgs\streamlink\plugins, no chaturbate plugin.

Website aside, here is how resolve works and generic does not.

What am I doing wrong?

Here is the same output for plugin being in eather location:

Failed to load plugin generic:
  File "imp.py", line 235, in load_module
  File "imp.py", line 172, in load_source
  File "<frozen importlib._bootstrap>", line 684, in _load
  File "<frozen importlib._bootstrap>", line 665, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 674, in exec_module
  File "<frozen importlib._bootstrap_external>", line 781, in get_code
  File "<frozen importlib._bootstrap_external>", line 741, in source_to_code
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "C:\P\STREAMLINK\pkgs\streamlink\plugins\generic.py", line 7
    <!DOCTYPE html>
    ^
SyntaxError: invalid syntax

[cli][info] Found matching plugin resolve for URL https://chaturbate.com/kittycaitlin/
[plugin.resolve][info] This is a custom plugin.
[plugin.resolve][info]   1. URL=https://chaturbate.com/kittycaitlin/
[plugin.resolve][info] Found Playlists: 1 (valid)
[cli][info] Available streams: 240p (worst), 360p, 480p, 576p, 720p, 1080p (best)
[cli][info] Opening stream: 1080p (hls)
[cli][info] Starting player: C:\P\VLC\vlc.exe
[cli][info] Player closed
[cli][info] Stream ended
[cli][info] Closing currently open stream...
Press any key to continue . . .
@back-to
Copy link
Owner

back-to commented Oct 11, 2018

@johnthecracker
Copy link
Author

johnthecracker commented Oct 11, 2018

It works after downloading plugin from new location:

[cli][info] Found matching plugin generic for URL https://chaturbate.com/heatherbby9/
[plugin.generic][info] Version 2018-10-03 - https://github.com/back-to/generic
[plugin.generic][info] 1. URL=https://chaturbate.com/heatherbby9/
[plugin.generic][info] Found Playlists: 1 (valid)
[cli][info] Available streams: 240p (worst), 360p, 480p, 576p, 720p (best)
[cli][info] Opening stream: 720p (hls)
[cli][info] Starting player: C:\P\VLC\vlc.exe

I have observed one thing, maybe worth saying, for new beginners:

I had resolve.py in streamlink plugins directory and generic.py in %APPDATA%\streamlink\plugins at the same time.
With this setup streamlink ran resolve.py.
After deleting resolve.py from plugins directory, streamlink ran generic.py.

Then I removed %APPDATA%\streamlink\plugins directory and copied generic.py and resolve.py to streamlink plugins directory.

Streamlink ran generic.py, giving it preference over resolve.py as if resolve.py was not there.

@back-to
Copy link
Owner

back-to commented Oct 11, 2018

Streamlink ran generic.py, giving it preference over resolve.py as if resolve.py was not there.

Streamlink usally checks the plugins after its PRIORITY which is used in the plugin file,
if plugins have the same PRIORITY, the alphabet is used until one plugin can use the given URL.

both plugins are NO_PRIORITY so generic will always be used before resolve

generic/plugins/generic.py

Lines 449 to 456 in 25b2797

@classmethod
def priority(cls, url):
m = cls.pattern_re.match(url)
if m:
prefix, url = cls.pattern_re.match(url).groups()
if prefix is not None:
return HIGH_PRIORITY
return NO_PRIORITY

@back-to back-to added question Further information is requested solved labels Oct 11, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested solved
Projects
None yet
Development

No branches or pull requests

2 participants