f1u77y / web-media-controller

Allows controlling media player on different sites with Media Player widget on your desktop
The Unlicense
36 stars 10 forks source link

Support several Invidious instances (dynamically?) #23

Closed doronbehar closed 5 years ago

doronbehar commented 5 years ago

Since the invidious connector was merged, I've learned that there are several public invidious instances. A list is available here: https://github.com/omarroth/invidious/wiki/Invidious-Instances Users (myself included) could have wished to make the connector work for them in their preferred instance.

I was wondering, do you think web-media-controller could dynamically or via a user preference set a hostname for which the connector will work with? If not, perhaps we can at least update the list of hostnames for this connector from time to time according to the list?

f1u77y commented 5 years ago

There is a way to support all of them dynamically but:

UPD: I will still add this feature.

doronbehar commented 5 years ago

this way requires parsing a file which is not supposed to be machine-readable and has no stable format (this is the whole point of this extension but I'd like to avoid it when I can)

You are not talking about reading that WiKi page where all the instances are listed right?

If you are thinking about implementing this via a text box in the preferences that will have just a list of all hostnames that should be considered as invidious websites, doesn't sound too complicated to me, unless you wish to parse it in a very safe manner, i.e make sure spaces and other disallowed characters in every line..

f1u77y commented 5 years ago

I've added functionality that you've requested in the branch custom-match-patterns. Is this solution fine?

Update: it's in master now, so you could test it from there.

doronbehar commented 5 years ago

Looks awesome @f1u77y :smiley: I've tested it from master and the design is excellent. I have 2 questions / remarks on the UX of it:

  1. Maybe by default, the list of match patterns should include the default match patterns that the extension had before this change? It seems the extension does controll (e.g invidio.us) by default but this match pattern is not seen as included..
  2. From some reason after I add a match pattern, I don't see it after I want to add another one. I'm sure I've hit the 'Save' button.
  3. The above along with the fact I'm not sure exactly what's the syntax of this match patterns and that testing other Invidious instances doesn't seem to enable me to controll them makes me think my expressions are just not good.
f1u77y commented 5 years ago
  1. This is list of custom match patterns, so I think there's no need to display default ones in settings.
  2. So, you add some pattern, then click "Save" then try to add another one, and don't see the first one in the list, right? If so, I can't reproduce.
  3. Syntax of match patterns is described here. I've tried to add *://invidious.snopyta.org/* and it worked. EDIT It will be nice to add this link somewhere in the settings page.
doronbehar commented 5 years ago
  1. Oh right, I guess you are right.
  2. Now I've tried to load it again and all of a sudden I did see the patterns I've added before, don't know why I didn't see them before.
  3. This syntax is working so I have no further complains now :+1:.
f1u77y commented 5 years ago

Resolved in v0.9.0.