Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

127
Visualizações
I need help getting video ids from a playlist in youtube

I'm trying to fetch all the video ids from a playlist on YouTube. Currently, I have things almost working, except the ids that YouTube is returning a much longer than usual and don't seem to work. Here's part of my code:

const requestUrl = `https://www.googleapis.com/youtube/v3/playlistItems?key=${process.env.KEY}&playlistId=${id}&part=id&maxResults=40`

The result under data.items looks like this:

[
  {
    kind: 'youtube#playlistItem',
    etag: 'DxS1pY8G6dwZwfAUJeE8naJEvXM',
    id: 'T0xBSzV1eV9uUHdpaDVQbWY3aEJWQ1Q2LU14bVFOTGFBSVAwellYVGsuRUVCNzhFRENBQzBENDM4MA'
  },
  {
    kind: 'youtube#playlistItem',
    etag: 'hi9WR5RovxYzHpBXddP__e5nFSA',
    id: 'T0xBSzV1eV9uUHdpaDVQbWY3aEJWQ1Q2LU14bVFOTGFBSVAwellYVGsuQzVBOTAwNjQ1OTJFMTVBRg'
  }
etc...

However those ids are much longer than normal and when I go to for example

youtube.com/watch?v=T0xBSzV1eV9uUHdpaDVQbWY3aEJWQ1Q2LU14bVFOTGFBSVAwellYVGsuRUVCNzhFRENBQzBENDM4MA the url automatically gets shortened to https://www.youtube.com/watch?v=T0xBSzV1eV9 and I get a video unavailable screen. When I changed &part=id to &part=snippet, the same thing happened, I just got more video info.

Thanks in advance!

about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda