const {analyzeEmbed} = require('@mobilon-dev/text-extract-embeds');
const input = [
'YouTube: https://www.youtube.com/watch?v=dQw4w9WgXcQ ',
'Vimeo: https://vimeo.com/123456789 ',
'Rutube: https://rutube.ru/video/b1c6f3a861e2e4f84179ba2f92521a57/ ',
'VK: https://vk.com/video-45256126_456242536',
].join('');
const result = analyzeEmbed(input);
console.log('e', JSON.stringify(result));
// [
// {"type":"youtube","videoId":"dQw4w9WgXcQ","url":"https://www.youtube.com/watch?v=dQw4w9WgXcQ","index":9},
// {"type":"vimeo","videoId":"123456789","url":"https://vimeo.com/123456789","index":60},
// {"type":"rutube","videoId":"b1c6f3a861e2e4f84179ba2f92521a57","url":"https://rutube.ru/video/b1c6f3a861e2e4f84179ba2f92521a57/","index":96},
// {"type":"vk_video","videoId":"45256126_456242536","url":"https://vk.com/video-45256126_456242536","index":158}
// ]
forked from Julzz10110/embed_analyze
-
Notifications
You must be signed in to change notification settings - Fork 0
mobilon-dev/text-extract-embeds
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
About
Function for embeds parsing/analyze with test coverage.
Resources
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published
Languages
- TypeScript 98.1%
- JavaScript 1.9%