Suporte a URLs de Live e Shorts no VideoMind
This commit is contained in:
@@ -696,7 +696,7 @@ app.delete('/api/comics/projects/:id', requireAuth, async (req, res) => {
|
|||||||
// ROTAS DO VIDEOMIND (TRANSCRIÇÃO E ANÁLISE DE VÍDEO)
|
// ROTAS DO VIDEOMIND (TRANSCRIÇÃO E ANÁLISE DE VÍDEO)
|
||||||
// ============================================================
|
// ============================================================
|
||||||
function getYouTubeId(url) {
|
function getYouTubeId(url) {
|
||||||
const regExp = /^.*(youtu.be\/|v\/|u\/\w\/|embed\/|watch\?v=|\&v=)([^#\&\?]*).*/;
|
const regExp = /^.*(youtu.be\/|v\/|u\/\w\/|embed\/|watch\?v=|\&v=|live\/|shorts\/)([^#\&\?]*).*/;
|
||||||
const match = url.match(regExp);
|
const match = url.match(regExp);
|
||||||
return (match && match[2].length === 11) ? match[2] : null;
|
return (match && match[2].length === 11) ? match[2] : null;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user