Skip to content

Commit 48a278f

Browse files
committed
Merge branch 'master' into pr/120
2 parents 79b99a0 + aebea4a commit 48a278f

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

src/services.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,12 +113,12 @@ const SERVICES: ServicesConfigType = {
113113
width: 540,
114114
},
115115
'yandex-music-track': {
116-
regex: /https?:\/\/music\.yandex\.ru\/album\/([0-9]*)\/track\/([0-9]*)/,
116+
regex: /https?:\/\/music\.yandex\.ru\/track\/([0-9]*)(?:\?.*)?/,
117117
embedUrl: 'https://music.yandex.ru/iframe/#track/<%= remote_id %>/',
118118
html: '<iframe frameborder="0" style="border:none;width:540px;height:100px;" style="width:100%;" height="100"></iframe>',
119119
height: 100,
120120
width: 540,
121-
id: (ids) => ids.join('/'),
121+
id: (ids) => ids[0],
122122
},
123123
'yandex-music-playlist': {
124124
regex:

test/services.ts

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -274,12 +274,12 @@ describe('Services Regexps', () => {
274274

275275
const urls = [
276276
{
277-
source: 'https://music.yandex.ru/album/5643859/track/42662275',
278-
embed: 'https://music.yandex.ru/iframe/#track/5643859/42662275/',
277+
source: 'https://music.yandex.ru/track/49235718?utm_source=web&utm_medium=copy_link',
278+
embed: 'https://music.yandex.ru/iframe/#track/49235718/',
279279
},
280280
{
281-
source: 'https://music.yandex.ru/album/5393158/track/41249158',
282-
embed: 'https://music.yandex.ru/iframe/#track/5393158/41249158/',
281+
source: 'https://music.yandex.ru/track/42662275',
282+
embed: 'https://music.yandex.ru/iframe/#track/42662275/',
283283
},
284284
];
285285

@@ -500,10 +500,11 @@ describe('Services Regexps', () => {
500500
'twitch-video': 'https://www.twitch.tv/videos/315468440',
501501
'yandex-music-album': 'https://music.yandex.ru/album/5643859',
502502
'yandex-music-track':
503-
'https://music.yandex.ru/album/5643859/track/42662275',
503+
'https://music.yandex.ru/track/42662275',
504504
'yandex-music-playlist':
505505
'https://music.yandex.ru/users/yamusic-personal/playlists/25098905',
506506
codepen: 'https://codepen.io/Rikkokiri/pen/RYBrwG',
507+
507508
};
508509

509510
Object.entries(services).forEach(([name, url]) => {

0 commit comments

Comments
 (0)