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

Add YouTube clips "expando" #5417

Closed

Conversation

thomasasfk
Copy link

  • Can now expand and watch YouTube clips
  • Supports full embedded player functionality

Image of the new expando option:
image

Video demo to see it in action;
https://user-images.githubusercontent.com/22506439/191857353-ee5bff89-7aef-4488-882c-73b3de544c99.mp4

I see there is an existing old implementation in #5358, which may still work. It however uses https://opengraph.io/ and requires an app_id query parameter to extract the embed link, in contrast, the implementation in this PR uses https://web.scraper.workers.dev/ to do the same thing, just without any required authentication.

With that being said, it is a third-party dependency and could stop working or change it's underlying functionality, it may also end up hitting issues given YouTube's underlying implementation changes, although it is working at this time of raising this PR.

Relevant issue: #5344
Other implementations: #5358
Tested in browser: Chrome, Firefox

- Can now expand and watch YouTube clips
- Supports full embedded player functionality
@thomasasfk thomasasfk force-pushed the add-youtube-clips-expando branch 3 times, most recently from 2ca09e2 to 01ae815 Compare September 24, 2022 19:43
@corylulu
Copy link
Contributor

corylulu commented Sep 30, 2022

This API isn't doing anything other than being a proxy and returning the entire body of the uncached HTML body and searching for the link in the body. You could just as easily call Youtube directly. The reason embed.ly was used was because it cached the data so it wouldn't spam calls or have taxing responses.

It's also easier to find in the og:video:url metadata tag.

This might be a solid alternative though, however, I'm unsure if it caches the data:
https://jsonlink.io/api/extract?url=https%3A%2F%2Fwww.youtube.com%2Fclip%2F<CLIP_ID>
But I haven't been able to extract the clipt parameter to find the final URL from anywhere.

@thomasasfk
Copy link
Author

thomasasfk commented Oct 1, 2022

This API isn't doing anything other than being a proxy and returning the entire body of the uncached HTML body and searching for the link in the body. You could just as easily call Youtube directly. The reason embed.ly was used was because it cached the data so it wouldn't spam calls or have taxing responses.

Hey, good point. With caching in mind, I forked the original worker repository and changed it to just specifically handle our use-case with caching.

You can see the project here: https://github.com/thomasasfk/web.scraper.workers.dev
And I've added changes to support it in: add7922

@jonas1015119
Copy link

is there a reason why this isn't being added?

@creesch
Copy link
Contributor

creesch commented Feb 11, 2023

is there a reason why this isn't being added?

No specific reason that this isn't specifically added, but in general:
https://www.reddit.com/r/RESAnnouncements/comments/sh83gx/announcement_life_of_reddit_enhancement_suite/

@jonas1015119
Copy link

ah, thanks. I guess this is isn't something that could just be added via Tampermonkey by users?

@thomasasfk thomasasfk closed this by deleting the head repository Nov 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants