Skip to content

Commit

Permalink
betterEmbedsYT: better video id extraction
Browse files Browse the repository at this point in the history
  • Loading branch information
Cynosphere committed Feb 7, 2025
1 parent df8a5d6 commit f3a0dfc
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/betterEmbedsYT/manifest.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
{
"$schema": "https://moonlight-mod.github.io/manifest.schema.json",
"id": "betterEmbedsYT",
"version": "1.1.0",
"version": "1.1.1",
"meta": {
"name": "Better YouTube Embeds",
"tagline": "Bypass copyright blocks, descriptions, block ads and trackers (works with Watch Together).",
"description": "Ad blocking uses code from the [Iridium](https://github.com/ParticleCore/Iridium) web extension.",
"authors": ["Cynosphere"],
"tags": ["qol", "privacy"],
"source": "https://github.com/Cynosphere/moonlight-extensions",
"changelog": "Added option for showing descriptions"
"changelog": "Descriptions: Better video ID extraction"
},
"settings": {
"description": {
Expand Down
4 changes: 2 additions & 2 deletions src/betterEmbedsYT/webpackModules/description.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,8 @@ export default function DescriptionWrapper({
embed: { rawDescription?: string; video: { url: string } };
renderDescription: RenderDescription;
}) {
const videoId = embed.video.url.split("/embed/").pop()!;
const videoId = embed.video.url.match(/\/embed\/([a-z0-9_\-]+)/i)?.[1];
return embed.rawDescription == null ? null : (
<YTDescription description={embed.rawDescription} renderDescription={renderDescription} videoId={videoId} />
<YTDescription description={embed.rawDescription} renderDescription={renderDescription} videoId={videoId!} />
);
}

0 comments on commit f3a0dfc

Please sign in to comment.