Coder Social home page Coder Social logo

xfg16 / youtubediscordpresence Goto Github PK

View Code? Open in Web Editor NEW
123.0 6.0 6.0 49.51 MB

An extension that takes data directly from the YouTube video playing on the browser and displays it as a rich presence on Discord. Works similar to the Spotify Discord rich presence.

Home Page: https://chrome.google.com/webstore/detail/youtubediscordpresence/hnmeidgkfcbpjjjpmjmpehjdljlaeaaa

License: MIT License

C++ 45.51% JavaScript 27.63% C 17.17% CSS 4.31% HTML 5.37%
chrome-extension cpp discord javascript native-messaging youtube youtube-video 64-bit windows opera-extension

youtubediscordpresence's Introduction

Installation

Watch the installation tutorial on YouTube: https://www.youtube.com/watch?v=BWPNqPGFyL4

If you're here from the Chrome Web Store, continue your installation here!

  1. Add the Chrome Extension from the Chrome Web Store if you haven't already done so
  2. Download the latest YTDPsetup.msi file in the releases section of this repository and run it on your device to install the secondary desktop component.
    • NOTE: Only Windows x64 versions are currently supported.



You should be all set and ready to go.

To access the personalization page, you need to click on the small icon on the top right of the browser under the extensions icon. It would also be easier to access if you pinned the extension.

It would be greatly appreciated if you could leave a rating and review describing your experience on the Chrome Web Store! Thank you for your consideration and enjoy the extension to its fullest!



splotch


YouTubeDiscordPresence for Windows (x64)

General Notes

  • This is an extension used to create a detailed rich presence for YouTube and YouTube Music on Discord. It is a project that I decided to take on towards the end of my freshman year.
  • Currently, the application only supports Windows, although more operating systems will be supported in the future. Stay tuned!
  • Creates a rich presence for both normal and livestream/premiere videos on YouTube, as well as YouTube Music songs. Includes an album cover feature for the currently playing YouTube Music song (if detectable) and an optional thumbnail feature for YouTube as well.
  • There are two components:
    • Chrome Extension << Source code [v1.5.7]: Extension || Release [v1.5.7]: Chrome Web Store >>
    • Desktop Application << Source code [v1.4.2]: Host || Release [v1.4.2]: Releases >>
      • Any warning you see if you scan the installer is simply a false positive that results from the code being compiled with pkg

Troubleshooting/Known Issues

  • It only works alongside the desktop application of Discord, not the browser version. Also, make sure to have Display current activity as status message in your Discord settings on.
  • The appearance and disappearance of the rich presence on your profile can be delayed because Discord limits the processing of rich presence update requests to once every 15 seconds.
  • The rich presence can also randomly disappear and reappear within a few seconds because Chrome forcibly unloads and reloads the background.js in Manifest v3

Otherwise, this is the first thing you should always do: head to chrome://extensions and turn the extension off. Then, close your browser, reopen the browser, and turn the extension back on, especially...

  • If the extension is not appearing even after you installed the desktop application...
    • In this case, your Discord client is likely ratelimiting YouTubeDiscordPresence. To fix this, do not simply just reload Discord. Go to your system tray or task manager and quit Discord before relaunching it.
  • If the presence gets stuck at some video at 00:00 left...
    • This is simply a problem with the client socket API in the way that Discord handles presence update requests. Currently, there is no easy solution around it.
  • If two or more instances of the rich presence appear on your profile...
    • Again, this is an error with the socket implementation Discord currently has and there is currently no easy way around it.

Opening a GitHub Issue

  • If you need more details and have the ability to open an issue, then before that, please head to chrome://extensions, turn on developer mode, and click "inspect views service worker". This should open a developer window. From there, head to the console section and describe what the debug log shows.
  • Don't hesistate to open an issue if there's something wrong with YouTubeDiscordPresence. In fact, you should also open one if you have any suggestions for a new feature to be added.

Detailed Installation Instructions

  1. Building the installer from scratch:
    • For NodeJS version: download the NodeHost directory and use pkg to compile app.js into an executable. However, you have to link the Chrome extension to the compiled executable manually, which can be done by following this guide
      • Note that in node_modules/discord-rpc/src/client.js, the RPC_CONNECTION_TIMEOUT was changed from 10e3 to 2000
      • The bundle.js file contains the application IDs for the YouTube and YouTube Music rich presence that you have to create separately in the Discord Developer Portal. Make sure the image keys match the ones in app.js
    • For C++ version: you can build the whole thing yourself with Visual Studio 2022. Just download the Host directory from this repository and open YTDPwin.sln under Host/YTDPwin in Visual Studio. Also, make sure to have the Microsoft Visual Studio Installer Project extension installed
  2. Add the Chrome Extension from the Chrome Web Store
    • If you want to load the extension without the Chrome Web Store or make edits, download the Extension directory, compress it into a zip, and load it onto your browser manually.
    • Make sure that the "allowed_origins" key in the JSON file involved in native messaging contains the extension's ID. This file can be found in the location you installed YouTubeDiscordPresence, which is usually C:\Program Files\YouTubeDiscordPresence as main.json

Miscellaneous

DISCLAIMER: this is not a bootleg copy of PreMiD. On a more technical note, it works similar to the Spotify rich presence—it only appears when a video is playing and disappears when there is no video or the video is paused. In addition, it only displays the presence for videos. Idling and searching are not displayed. Features such as exclusions, fully customizable details, and thumbnail coverage are unique and original to YouTubeDiscordPresence. YouTubeDiscordPresence has not referenced nor is affiliated with PreMiD in any way whatsoever.


License

Licensed under the MIT license.

youtubediscordpresence's People

Contributors

renyongfu avatar xfg16 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  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  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  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

youtubediscordpresence's Issues

Show album covers using YouTube Music

Hello, here are two features I'm eagerly looking forward to for this project.

  • It would be really cool to see the album cover instead of the YouTube Music icon.
  • When listening to YouTube music, all channel names end with '- Topic'. I would like this phrase to be removed.

Update readme

Virustotal shows no issues with the 1.3 msi package. Consider removing that warning from the readme.

Youtube Thumnail as Cover and Some Additional Feature

I've done some experimentation and managed to get some of "new features" working that I think would be a good addition to this extension.

Using Youtube thumbnail as cover for rich presence
image

as you can see from the above screenshot the "playing icon" is replaced by the video author image/channel icon, I think this also would be a great addition
image

More Settings
To accompanied the additional features that I mentioned above, adding a these type of new settings would be very helpful too

image
image

Adding Custom Activity Type

Is it possible to add a custom activity type for the rich presence based upon application is being used. i.e instead of showing "Playing a game" is will be "Watching" on you are on youtube and "Listening" on youtube music.

image
image

As far as I know something like this is technically possible since I have seen this plenty of time some bot, though I am not sure it's possible to do here as am not familiar with discord SDK

have the ytdp presence be a lower precedence than actual game presences

if I have ytdp on and have a game open, then the ytdp presence takes precedence over the game's presence (ie in your discord mini profile, ytdp is shown instead of the game).
not sure how precedence works with discord presences or if it's even a thing, but would it be possible to make a settings toggle for ytdp to have the lowest precedence?

Improve UI for display

Hey team, it'd be really nice if you can improve the current play icon UI to make it look a lot better! The current icon seemed a bit incomplete and may block the album picture. Thanks for working on this project, it was great! :D
image

Video stuck on 0:00 (Read description)

It's really annoying how frequent this happens, and for me it has never worked normally. Now, I know its in the readme and all, but I was wondering if anyone found any possible fixes for it that isn't turning the extension off and on again.
image
(ignore the video)
Thanks for the help!

"Inclusions" Feature

whenever I put the video link there and then I enabled it, the video I'm watching with the same link doesn't show on my discord status

Compatability with firefox extensions

I've moved from Opera GX to Librawolf, and noticed that I am unable to download the extension, nor import it from chrome.
Chrome Store Foxified is not available either.

"{"data":"0_SUCCESS: CLIENT_READY"} Stuck

Hello

I tried a few month ago and it was working flawlessly but when I format my windows and install it again, I cannot get past this message.
I have the extension installed correctly.
I tried everything restart pc, chrome, disabling and re-enabling.

an issue starting the rich presence in the new version

when I open the YTDPwin.exe it opens but a message like this pops up:Error: Could not connect
at Socket.onerror (C:\snapshot\NodeHost\node_modules\discord-rpc\src\transports\ipc.js:32:16)
at Object.onceWrapper (events.js:520:26)
at Socket.emit (events.js:400:28)
at emitErrorNT (internal/streams/destroy.js:106:8)
at emitErrorCloseNT (internal/streams/destroy.js:74:3)
at processTicksAndRejections (internal/process/task_queues.js:82:21)
� {"data":"CLIENT_ERROR"}

Discord Presence didn't work on Opera GX browser

I tried installing the browser extension on Opera GX as I mainly use it to play both Youtube Music and Youtube. However, it seems that Opera GX failed to detect the desktop client app, as the developer console log (attached below) stated that it was not properly install (which I do)
image

To prove that the desktop client is installed correctly, I tried installing the extension on Google Chrome and Microsoft Edge. And the Discord Presence indeed worked on these two browsers. Here I attached the console logs for both as well:
image
image

Stuck timer when playing videos in playlist

Played video 1 and it works fine, but when it switched to a new video, the timer in the status would stuck at video 1 and timer freezes at 00:00. Closing youtube does not help.
image

Support for Ubuntu Required

image

Currently, this extension seems to only supports Windows. To better serve our diverse user base and enhance accessibility, I suggest extending its compatibility to Ubuntu . This will benefit to the ever increasing number of users relying on Linux-based systems.

It doesn't work

I have the extension installed and enables and I installed the MSI but it wont show it on discord in the add registered game area

ext stops working after pc wakes up

works great, but sometimes after my pc wakes from hibernation, the extension stops working (no discord presence) until i fully restart chrome.
not sure if this screenshot will help:
image
they are the same error

microsoft edge support

hi xfg16, your project looks great and i like it most of all the ones ive seen doing discord presecene for ytmusic. but sadly ti doesnt seem to be working for microsoft edge. i hope when you have the time you could support it please?

can't compile it

the nodehost require a "./bundle" wich is not in the folder how can i do that ?

YTDP presence for all open Discord instances

It'd be nice if YTDP showed a presence for all open Discord instances (stable, PTB, & canary).
Right now I have stable and PTB open and the presence only shows for the first instance that's opened.

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.