WIP: [DEPRECATED] Feature: Adds integration of topik/youtube-music-obs-widget as plugin #1120
No reviewers
Labels
No labels
awaiting-reply
breaking changes
bug
cannot-reproduce
dependencies
documentation
duplicate
electron-issue
enhancement
fix-available
good first issue
help wanted
invalid
javascript
need more information
need rebase
official-youtube-music-issue
plugin request
question
release
security
stale
Status: blocked
typo
wontfix
ytmd-issue
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: YTMD/youtube-music#1120
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "topik/master"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Hello,
I got a request to add a plugin for my obs widget so here it is.
Plugin makes a simple http server and give a info about current song in JSON. The JSON structure is the same as in other YT music software that is being used so the obs widget is compatible.
Feel free to rename the plugin.
Thanks
This looks extremely similar to https://github.com/th-ch/youtube-music/blob/master/plugins/tuna-obs/back.js
Could you give a quick explanation why a new plugin is needed?
I took some inspiration from tuna-obs because I'm not a Node.js developer. Tuna-obs sends requests to the OBS plugin itself, which means you have to install the OBS (and the OBS plugin) for the whole thing to work.
However, my plugin works the opposite way. It creates a webserver and serves JSON data about the current song, so you don't need to install anything. Just open the plugin's webpage and it will work. You can add the webpage as a source to OBS.
Additionally, my plugin has a different design.
PS: You should use a formatter on your code :^)
@ -0,0 +1,62 @@
const {ipcMain} = require("electron");
Just a small lifehack :^)
Since you assign a list to it, shouldn't the initial value be an empty list?
You are absolutely right, no idea why i didn't do that. I would do it in any other language :| ... Also thanks for pointing out wrong variable type.
@topik
Could you rework this PR? The entire plugin system has been reworked.
If you are still interested, this may be helpful: https://github.com/th-ch/youtube-music/pull/2723/files
Nah, a rewrite to work with the new codebase wouldn't be enough.
I did just that
but when I saw the client code, it doesn't even use the
/query
endpoint, it uses/api/v1/*
stuff specific to ytmdit is trying to authenticate, and if it fails it will show annoying alerts to the user

One solution would be to fake compatibility with the ytmd API, and only implement the endpoints used, but do we want that?
Faking ytmd compatibility requires socket.io as a dependency, and I am not a fan of that.
But hey, it can be done
I will not be making a PR on this, because I do not really want it merged.
But I'll be leaving my code here
Honestly, I'd suggest we make our own realtime websocket using hono's websocket helper.
PS: I did try faking socket.io compatibility, but their documentation doesn't explain shit, so I gave up and used their library.
If there is an accessible endpoint, I can change the widget so it works with both programs, so there will be no authentication for https://github.com/th-ch/youtube-music/tree/master. The question is, who's gonna make the endpoint and how.
PS: good job 😂
we do not currently have websockets, but the plugin
api-server
does have an endpoint to get the player state as well as the current song, so it would be similar to the/query
you used to call in the pasthere is the schema of the response, and here is the route
I do see that having websockets would be useful, so enhancing the
api-server
plugin with it would be an optionThen I can just use the plugin that already exists 🙂 I think that would be the easiest solution.
you'll have to deal with authentication there as well 😔, although it is optional iirc
since I'm invested in this topic already, leave it to me, I'll make a PR to your widget
man I completely forgot about this
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.