Skip to content

Commit

Permalink
🐞 fix(sbs-news): filter short video
Browse files Browse the repository at this point in the history
  • Loading branch information
summerscar committed Dec 18, 2024
1 parent a35ee25 commit 9cc8424
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
1 change: 1 addition & 0 deletions app/api/cron/sbs-news/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ export async function GET() {
order: "viewCount",
publishedAfter: twentyFourHoursAgo,
maxResults: 1,
videoDuration: "short",
});

const videos = await Promise.all(
Expand Down
12 changes: 6 additions & 6 deletions app/api/cron/sbs-news/template.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ type Video = {
const buildContent = (video: Video) => {
return `
<iframe
width="560"
height="315"
src="https://www.youtube.com/embed/${video.videoId}"
title="${video.title?.replace(/"/g, '\\"')}"
frameborder="0"
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"
width="560"
height="315"
src="https://www.youtube.com/embed/${video.videoId}"
title="${video.title?.replace(/"/g, "&quot;")}"
frameborder="0"
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"
/>
---
Expand Down

0 comments on commit 9cc8424

Please sign in to comment.