npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

axion-play

v0.1.0

Published

Node.js helper to resolve and download YouTube videos and Instagram reels from their URLs

Readme

axion-play

Pacote Node.js para resolver URLs diretas e baixar midias a partir de links publicos de videos do YouTube e reels/posts do Instagram.

Use apenas para conteudo que voce tem permissao para baixar e distribuir. O comportamento dessas plataformas pode mudar sem aviso.

Instalacao

npm install axion-play

Uso rapido (ESM)

import { AxionPlay } from "axion-play";

const client = new AxionPlay();

const info = await client.resolve("https://www.youtube.com/watch?v=aqz-KE-bpKQ");
console.log(info.items[0].downloadUrl);

const saved = await client.download(
  "https://www.instagram.com/reel/CdmYaq3LAYo/",
  "./downloads/"
);

console.log(saved.filePath);

Uso rapido (CommonJS)

const { AxionPlay } = require("axion-play");

API

  • detectProvider(url): retorna "youtube" ou "instagram".
  • new AxionPlay(options?): cria uma instancia configuravel.
  • client.resolve(url, options?): resolve metadados e URLs diretas.
  • client.getInfo(url, options?): alias de resolve.
  • client.searchVideos(query, options?): busca videos no YouTube.
  • client.searchFirst(query, options?): resolve o primeiro resultado de busca.
  • client.searchAndDownload(query, destination?, options?): busca e baixa o primeiro resultado.
  • client.play(query, destination?, options?): alias curto de searchAndDownload.
  • client.download(url, destination?, options?): baixa o item selecionado para disco.
  • client.sendToBaileys(sock, jid, input, options?): envia por Baileys a partir de URL ou busca.
  • client.sendToVenom(client, to, input, options?): envia por Venom a partir de URL ou busca.
  • client.downloadAndSendToBaileys(...): baixa primeiro e envia o arquivo local.
  • client.downloadAndSendToVenom(...): baixa primeiro e envia o arquivo local.
  • client.playToBaileys(...) / client.playToVenom(...): aliases curtos com modo automatico.
  • client.playFileToBaileys(...) / client.playFileToVenom(...): baixa e envia arquivo local com nome curto.

Opcoes

  • youtube: sobrescreve quality, format, type e clientOptions para o resolvedor do YouTube.
  • instagram: sobrescreve requestConfig para o resolvedor do Instagram.
  • fetchImpl: injeta uma implementacao customizada de fetch.
  • userAgent: define o User-Agent usado no download final.

Notas

  • Para YouTube, o pacote usa youtubei.js.
  • Para Instagram, o pacote usa instagram-url-direct.
  • O item baixado por padrao e o primeiro da lista retornada. Use itemIndex em download() para escolher outro.

Buscar e baixar pelo nome

import { AxionPlay } from "axion-play";

const client = new AxionPlay();

const search = await client.searchVideos("big buck bunny", { maxResults: 3 });
console.log(search.items[0]);

const saved = await client.searchAndDownload("big buck bunny", "./downloads");
console.log(saved.filePath);

Integracao com Baileys

import { AxionPlay } from "axion-play";

const player = new AxionPlay();

await player.sendToBaileys(sock, "[email protected]", "big buck bunny", {
  mode: "query",
  caption: "Achei esse video para voce"
});

Integracao com Venom

import { AxionPlay } from "axion-play";

const player = new AxionPlay();

await player.sendToVenom(client, "[email protected]", "https://youtu.be/aqz-KE-bpKQ", {
  mode: "url"
});

Exemplo de comando em bot WhatsApp

if (body.startsWith("!play ")) {
  const query = body.slice(6).trim();
  await player.sendToBaileys(sock, message.key.remoteJid, query, {
    mode: "query",
    messageOptions: { quoted: message }
  });
}