diff --git a/api/resolvers/item.js b/api/resolvers/item.js index 6ecf4e38..13ed049b 100644 --- a/api/resolvers/item.js +++ b/api/resolvers/item.js @@ -568,6 +568,9 @@ export default { // extract id and create both links const matches = url.match(/(https?:\/\/)?((www\.)?(youtube(-nocookie)?|youtube.googleapis)\.com.*(v\/|v=|vi=|vi\/|e\/|embed\/|user\/.*\/u\/\d+\/)|youtu\.be\/)(?[_0-9a-z-]+)/i) similar = `(http(s)?://)?((www.|m.)?youtube.com/(watch\\?v=|v/|live/)${matches?.groups?.id}|youtu.be/${matches?.groups?.id})((\\?|&|#)%)?` + } else if (urlObj.hostname === 'yewtu.be') { + const matches = url.match(/(https?:\/\/)?yewtu\.be.*(v=|embed\/)(?[_0-9a-z-]+)/i) + similar = `(http(s)?://)?yewtu.be/(watch\\?v=|embed/)${matches?.groups?.id}((\\?|&|#)%)?` } else { similar += '((\\?|#)%)?' } diff --git a/contributors.txt b/contributors.txt index 51b547e8..922e9b82 100644 --- a/contributors.txt +++ b/contributors.txt @@ -6,3 +6,4 @@ rleed bitcoinplebdev benthecarman stargut +mz