Skip to content

Commit

Permalink
chore: pull main
Browse files Browse the repository at this point in the history
  • Loading branch information
neSpecc committed Oct 18, 2023
2 parents d9adfe2 + 23de06b commit 9d8c1fd
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
8 changes: 7 additions & 1 deletion src/services.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,12 @@ export default {
return null;
}

if (value === 'LL'
|| value.startsWith('RDMM')
|| value.startsWith('FL')) {
return null;
}

return `${paramsMap[name]}=${value}`;
})
.filter(param => !!param);
Expand Down Expand Up @@ -123,7 +129,7 @@ export default {
id: (ids) => ids.join('/embed/'),
},
instagram: {
regex: /https?:\/\/www\.instagram\.com\/p\/([^\/\?\&]+)\/?/,
regex: /https?:\/\/www\.instagram\.com\/p\/([^\/\?\&]+)\/?.*/,
embedUrl: 'https://www.instagram.com/p/<%= remote_id %>/embed',
html: '<iframe width="400" height="505" style="margin: 0 auto;" frameborder="0" scrolling="no" allowtransparency="true"></iframe>',
height: 505,
Expand Down
9 changes: 8 additions & 1 deletion test/services.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,10 @@ describe('Services Regexps', () => {
const urls = [
{ source: 'https://www.youtube.com/watch?v=wZZ7oFKsKzY&t=120', embed: 'https://www.youtube.com/embed/wZZ7oFKsKzY?start=120' },
{ source: 'https://www.youtube.com/embed/_q51LZ2HpbE?list=PLLy6qvPKpdlV3OAw00EuZMoYPz4pYuwuN', embed: 'https://www.youtube.com/embed/_q51LZ2HpbE?list=PLLy6qvPKpdlV3OAw00EuZMoYPz4pYuwuN' },
{ source: 'https://www.youtube.com/watch?time_continue=173&v=Nd9LbCWpHp8', embed: 'https://www.youtube.com/embed/Nd9LbCWpHp8?start=173' }
{ source: 'https://www.youtube.com/watch?time_continue=173&v=Nd9LbCWpHp8', embed: 'https://www.youtube.com/embed/Nd9LbCWpHp8?start=173' },
{ source: 'https://www.youtube.com/watch?v=efBBjIK3b8I&list=LL&t=1337', embed: 'https://www.youtube.com/embed/efBBjIK3b8I?start=1337' },
{ source: 'https://www.youtube.com/watch?v=yQUeAin7fII&list=RDMMnMXCzscqi_M', embed: 'https://www.youtube.com/embed/yQUeAin7fII?' },
{ source: 'https://www.youtube.com/watch?v=3kw2sttGXMI&list=FLgc4xqIMDoiP4KOTFS21TJA', embed: 'https://www.youtube.com/embed/3kw2sttGXMI?' },
];

urls.forEach(url => {
Expand Down Expand Up @@ -279,6 +282,10 @@ describe('Services Regexps', () => {
source: 'https://www.instagram.com/p/B--iRCFHVxI/',
embed: 'https://www.instagram.com/p/B--iRCFHVxI/embed'
},
{
source: 'https://www.instagram.com/p/CfQzzGNphD8/?utm_source=ig_web_copy_link',
embed: 'https://www.instagram.com/p/CfQzzGNphD8/embed'
},
];

urls.forEach(url => {
Expand Down

0 comments on commit 9d8c1fd

Please sign in to comment.