Skip to content

Commit

Permalink
Pleromaの等のURLプレビューが意図せずプレイヤーになってしまうのを修正
Browse files Browse the repository at this point in the history
  • Loading branch information
mei23 committed Aug 2, 2021
1 parent cc81d5b commit e9f5466
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/misc/summaly/general.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ export default async (url: URL): Promise<Summary> => {

const landingUrl = new URL($.documentInfo().url);

const twitterCard = $('meta[property="twitter:card"]').attr('content');

let title =
$('meta[property="og:title"]').attr('content') ||
$('meta[property="twitter:title"]').attr('content') ||
Expand All @@ -47,8 +49,8 @@ export default async (url: URL): Promise<Summary> => {
image = image ? new URL(image, landingUrl.href).href : null;

const playerUrl =
$('meta[property="twitter:player"]').attr('content') ||
$('meta[name="twitter:player"]').attr('content') ||
(twitterCard !== 'summary_large_image' && $('meta[property="twitter:player"]').attr('content')) ||
(twitterCard !== 'summary_large_image' && $('meta[name="twitter:player"]').attr('content')) ||
$('meta[property="og:video"]').attr('content') ||
$('meta[property="og:video:secure_url"]').attr('content') ||
$('meta[property="og:video:url"]').attr('content') ||
Expand Down

0 comments on commit e9f5466

Please sign in to comment.