Skip to content
Discussion options

You must be logged in to vote

Glad it helped! In case it saves you some time with the plugin: you can avoid scraping the watch page entirely. The thumbnail and the embed URL can be built from the video ID alone, and the title can come from YouTube's oEmbed endpoint (https://www.youtube.com/oembed?url=...&format=json), which is a different and much lighter endpoint than the watch page.

A minimal plugin matching Summaly's SummalyPlugin interface (test + summarize):

function videoId(url) {
  if (url.hostname === 'youtu.be') return url.pathname.slice(1) || null;
  if (url.pathname === '/watch') return url.searchParams.get('v');
  const m = url.pathname.match(/^\/(shorts|embed|live)\/([\w-]{11})/);
  return m ? m[2] : null;
}

Replies: 1 comment 5 replies

Comment options

You must be logged in to vote
5 replies
@tassoman
Comment options

@oykaD
Comment options

@tassoman
Comment options

@oykaD
Comment options

Answer selected by tassoman
@tassoman
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants