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

Question: How do you check if Youtube video is available on Nebula? #71

Open
CarlosHartmann opened this issue Jan 2, 2025 · 1 comment
Labels
question Further information is requested

Comments

@CarlosHartmann
Copy link

Hi there, I'm currently coding a super simple "Watch on Nebula" Safari extension here and I'm running into issues when checking if a Youtube uploader is also present on Nebula. Since I'm a newbie at this, I'm having trouble understanding where and how exactly you perform that check.

Hope it's okay if I just ask you to point me in the right direction so I can improve my own simple project.

It would be enough if you said "The HTML of the creator list site is queried for the name," I don't need a lengthy explanation with the exact code snippets.

@cpiber
Copy link
Owner

cpiber commented Jan 3, 2025

There's quite a few parts to this. All of it is done in the background part of the extension (extensions are split into a background part which is always present and a content part which is injected into each individual tab), so you'll find them in https://github.com/cpiber/NebulaEnhance/tree/master/src/scripts/background and https://github.com/cpiber/NebulaEnhance/blob/master/src/scripts/background_script.ts

Specifically, the mapping of creators is in https://github.com/cpiber/NebulaEnhance/blob/master/src/scripts/page/offscreen.ts. I parse https://talent.nebula.tv/creators/ which lists for (most) Nebula channels their YouTube channels. The actual call to that is a bit convoluted due to MV3 being a pain.

The search again is a bit complicated, since Nebula does not allow you to search for a video from a specific creator, so I implemented a manual search mechanism (I fetch the 50 latest videos of the creator and do a manual likeness), and only as fallback do I do a site-wide search. My custom search is also quite useful because creators tend to change the video title on YouTube slightly because of the algorithm, so Nebula's search does not always find the video, while I can, with a lower confidence score. You'll find that implementation in https://github.com/cpiber/NebulaEnhance/blob/master/src/scripts/background/nebula.ts and https://github.com/cpiber/NebulaEnhance/blob/master/src/scripts/background/ifidf.ts

@cpiber cpiber added the question Further information is requested label Jan 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants