Permalink
Browse files

Add youtube mobile url.

  • Loading branch information...
marcomontalbano committed Nov 8, 2018
1 parent 83f6446 commit 3d1f12a9c4d58eef97c24f71bc52ce321a4c0321
Showing with 4 additions and 0 deletions.
  1. +3 −0 src/lambda/classes/Providers/Youtube.js
  2. +1 −0 src/lambda/classes/Providers/Youtube.test.js
@@ -9,6 +9,9 @@ export default class Youtube extends VideoProvider {
// - //www.youtube.com/watch?v=oRdzL2DX0yU
/https?\:\/\/www\.youtube\.com\/watch\?v\=([a-zA-Z0-9\_\-]+)/,
// - //m.youtube.com/watch?v=oRdzL2DX0yU
/https?\:\/\/m\.youtube\.com\/watch\?v\=([a-zA-Z0-9\_\-]+)/,
// - //youtu.be/oRdzL2DX0yU
/https?\:\/\/youtu\.be\/([a-zA-Z0-9\_\-]+)/,
@@ -3,6 +3,7 @@ import Youtube from './Youtube';
describe('Youtube', () => {
it('"regex" must be correct.', () => {
expect(Youtube.getVideoId('https://www.youtube.com/watch?v=oRdzL2DX0yU')).toBe('oRdzL2DX0yU');
expect(Youtube.getVideoId('https://m.youtube.com/watch?v=oRdzL2DX0yU')).toBe('oRdzL2DX0yU');
expect(Youtube.getVideoId('https://youtu.be/oRdzL2DX0yU')).toBe('oRdzL2DX0yU');
expect(Youtube.getVideoId('https://www.youtube.com/embed/oRdzL2DX0yU')).toBe('oRdzL2DX0yU');
expect(Youtube.getVideoId('https://youtube.com/embed/oRdzL2DX0yU')).toBe('oRdzL2DX0yU');

0 comments on commit 3d1f12a

Please sign in to comment.