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

Use googleapi to get metadata #576

Merged
merged 3 commits into from
Mar 28, 2025
Merged

Conversation

gunnarvelle
Copy link
Member

Vi har allerede et googleapi oppsett fra læringssti/ed. Gjenbruker et token fra en av desse.

@gunnarvelle gunnarvelle requested a review from a team March 21, 2025 09:32
url: ogs.result.ogUrl,
};
} else {
const videoId = url.split("/")[3]?.split("?")[0] ?? "";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Denne var litt skummel synes jeg. Kanskje vi burde ha noen tester på dette?
Hva med dette?

  const urlObj = new URL(url);
  let videoId;
  if (urlObj.pathname.startsWith("watch")) {
    videoId = urlObj.searchParams.get("v");
  } else {
    videoId = urlObj.pathname.split("?")[0];
  }

@gunnarvelle gunnarvelle requested a review from a team March 28, 2025 11:44
@gunnarvelle gunnarvelle merged commit ac38716 into master Mar 28, 2025
3 checks passed
@gunnarvelle gunnarvelle deleted the handle-undefined-as-string branch March 28, 2025 11:48
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.

2 participants