GithubHelp home page GithubHelp logo

streamlink-helper's Introduction

Streamlink Helper

A companion addon for Streamlink.

Listing on AMO: Streamlink Helper.

What it does

This add-on adds an entry to the context menu for URLs and the current page. Clicking it will launch streamlink with the URL/page as its first argument. This allows you to watch livestreams, for example from twitch, with a custom media player without the hassle of inputting commands.

Configuration

You need to do multiple things for this to work:

  • Install Python, and add it to your PATH environment variable.
  • Install Streamlink, propably using pip install streamlink. Add the executable to your path.
  • Set default-stream best (or another quality) and a default player in the streamlinkrc (found on Windows at %APPDATA%\streamlink\streamlinkrc, on Linux at ~/.streamlinkrc).
  • Download and unzip streamlink_helper.zip from Releases somewhere you can read and write to. Note that location. Then:
    • Windows:
      • Edit registry.reg with the path to streamlink_helper_windows.json in that location and execute it, or edit the registry on your own.
      • Edit streamlink_helper_windows.json with the path to streamlink_helper.bat.
      • Edit streamlink_helper.bat with the path to streamlink_helper.py (and to Python, if it's not on your path).
      • If streamlink.exe is not on your path, edit streamlink_helper.py, replacing streamlink.exe with the location to it.
        • If streamlink.exe IS on your path, but firefox still refuses to find it, you can find out the path to streamlink.exe with where streamlink and put that in streamlink_helper.py.
    • Linux:
      • Ensure Python is in your path. If you can call python from a terminal, that is propably the case.
      • Execute chmod +x streamlink_helper.py.
      • Edit streamlink_helper.json with the path to streamlink_helper.py.
      • Copy streamlink_helper.json to the appropriate directory according to this documentation (most likely you want to do cp streamlink_helper.json ~/.mozilla/native-messaging-hosts/).
      • If streamlink is not in your path, edit streamlink_helper.py, replacing streamlink with the location to it.
      • If streamlink IS on your path, but firefox still refuses to find it, you can find out the path to streamlink with which streamlink and put that in streamlink_helper.py.

Troubleshooting

To do any kind of troubleshooting, go to about:debugging in your firefox, enable debugging and click on "Debug" under the extension "Streamlink Helper". Two windows open:

  • A message asking if you want to debug โ†’ click "Ok"
  • A console window. This will display any error messages. Some are found below. Note that I might not know of all errors, or all causes. If you find some more please create a new issue so I can add them. If you know how to resolve them, even better!

"Error: Error: Attempt to postMessage on disconnected port"

  • The path to streamlink_helper_windows.json is wrong or missing in your registry
  • The path to streamlink_helper.bat is wrong in streamlink_helper_windows.json

"Error: Error: An unexpected error occurred"

  • The path to streamlink_helper.py is wrong in streamlink_helper.bat or python is not on your path. Paths with spaces need to be enclosed in double quotes, for example

call "C:\Program Files\Python36\bin\python.exe" "C:\Streamlink Helper\streamlink_helper.py"

A long message is displayed with different paths

  • python couldn't find streamlink. Put it on your path or tell python where it is (in streamlink_helper.py).

FAQ

  • "This is all too complicated! Is this really neccessary? Couldn't you have made this easier?"

    Yes, its way too complicated, but neccessary for FF57. Maybe I could have made it easier, but relative paths don't seem to work in all these files. If you want, you could create an installer for this ;)

  • "Does this work on MacOS?"

    Probably, but you have to consult the official documentation for how to configure your equivalent of a registry, point directly to the python file instead of a bat and make it executable. YMMV.

  • "Why only FF57?"

    The templates (1, 2) I used to create this had some lower version limits, so I took the upper one. Since there is already a functioning addon for FF โ‰ค 56, I didn't check if this addon works with lower versions.

    To use Open with Livestreamer, just set the path to "livestreamer" to the streamlink executable, and it works with streamlink.

Invoking Streamlink from another extension

browser.runtime.sendMessage("[email protected]", "https://example.com/your/url/here")
  .then(onSuccess)
  .catch(onError);

You can use the built-in management API to check if the extension is installed.

streamlink-helper's People

Contributors

freaktechnik avatar jazzzz avatar plneappl avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

streamlink-helper's Issues

Linux: streamlink_helper.py contains CR characters

Hello,
I needed to remove CR characters from the file in order to make it work in Linux.
I got the "An unexpected error occurred" error in Console.
For example you can convert it with vim (:set ff=unix)
After I removed the CR characters it worked as expected.

[Enhancement/Feature request] Add support for FF keyboard shortcut

As topic states. Would it be possible to add support for Firefox's add-on shortcut feature? Using the context menu is cumbersome. As of today I use AHK to automatically navigate the menu, but it requires three different keybinds because the location of the "Open with Streamlink" entry changes depending on if you right click on the left pane/right pane on the Twitch page or playing stream.

Having the context menu popping up isn't very elegant either. So having a simple global "Open with Streamlink" shortcut in FF would be awesome :)

Possible to hide Python console on Windows?

As topic states, I'm wondering if it's possible to hide the Python console that opens on Windows and has to run while the stream is open. I would like it to run in the background to avoid clutter, for my other streamlink batch files I'm using SilentCMD to accomplish this.

Would it be possible to launch pythonw.exe instead of python.exe maybe?

Streamlink.exe

Hello,
I have streamlink helper installed. When on Twitch and I right click play in streamlink the streamlink.exe command terminal opens and then closes. Like it's trying to load something. Then MPV for windows doesn't open. Do I specifically need to edit something to tell it to play in MPV? I have streamlink configured correctly.

Thank you,
Nathan

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.