-
Notifications
You must be signed in to change notification settings - Fork 304
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
youtube: detect age-restrictions for YouTube shorts as well
- Loading branch information
1 parent
c6bd724
commit 4d63698
Showing
3 changed files
with
13 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,19 @@ | ||
/** | ||
* This is an alternative fix for https://github.com/itteco/iframely/issues/543. | ||
* If your servers are in EU, this avoids a redirect to cookie consents, | ||
* Activate it by addong | ||
* This was an alternative fix for https://github.com/itteco/iframely/issues/543. | ||
* YT Shorts are now covered by main plugin to detect age-restricted players that do not work. | ||
* Here, we only need a bigger og-image | ||
*/ | ||
|
||
export default { | ||
|
||
re: /^https?:\/\/www\.youtube\.com\/shorts\/([a-zA-Z0-9_-]+)/i, | ||
|
||
mixins: [ | ||
"domain-icon", | ||
"oembed-title", | ||
"oembed-site", | ||
"oembed-author", | ||
"oembed-thumbnail", | ||
"oembed-video", // "allow" attributes will be merged from there | ||
"oembed-iframe" | ||
"og-image", | ||
"oembed-thumbnail" // smaller image is backup for EU where they may get a redirect to consent page | ||
], | ||
|
||
getLink: function(iframe) { | ||
return { | ||
href: iframe.src, | ||
type: CONFIG.T.text_html, | ||
rel: CONFIG.R.player, | ||
"aspect-ratio": 9/16, | ||
} | ||
getData: function(options) { | ||
options.followHTTPRedirect = true; | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters