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 🙏

© 2025 – Pkg Stats / Ryan Hefner

node-subscene-api

v1.1.1

Published

simple project for download subtitle from subscene

Downloads

32

Readme

subscene

Small project for Download Subtitle From SUBSCENE

Important : This is not an official project, so there is no guarantee that it will work for a long time.

Installation

npm i node-subscene-api

Require Module

const subscene = require("node-subscene-api")

How to search a movie?

const subscene = require("node-subscene-api") //require Module

//Search A Movie/series Name Query
subscene.search(query).then(results=> {

  //results may be an array or null

}).catch(err=> {

  //Handle Errors

})


/* An Example For How to Use Search Function*/

subscene.search("Money heist").then(results=> {
  /*
  [
    {
      title:"money heist",
      path:"/subtitle/money-heist"
    },
    {
      title:".....",
      path:"...."
    }.....
  ]
  */
})

How to get Subtitles?

subscene.getSubtitles(moviePath,datas).then(subtitles=> {// "moviePath" is the "path" returned in the subscene.search() function
  console.log(subtitles)
  /*
    {
      english:[
        {
          title:"money-heist s01e01",
          path:"/money-heist/english/028292",
          lang:"English"
        },
        {
          title:"bababa",
          path:"baba a",
          lang:"English"
        }
      ],
      hindi:[
        {
          title:"hindi sub name",
          path:"some path",
          lang:"Hindi"
        }....
      ]....
    },
    
  */

}).catch(err=>console.log(err))

datas : Boolean (default=false)

if you pass datas as true the response will be contain a key named datas as an object

eg :-

     response={
       english:[...],
       arabic:[...],
       datas:{
         title:"Dark",
         year:"2017",
         poster:"https://poster.url",
         imdb:tt00000
       }
     }

How To Download Subtitle?

subscene.download(subtitlePath,options).then(files=>{  // "subtitlePath" is the "path" returned in the subscene.getSubtitles() function
  console.log(files)
  /*
   A buffer will return according to the options
  */
  
}).catch(err=>console.log(err))

options : {object}

zip :(default false) : The zip option refers to whether the file buffer to be returned is zip file buffer or unzipped type buffer. default it will be return unzipped type buffer, If the zip option is true then return value will be an Object

example :-

subscene.download(subPath,{zip:true}).then(file=>{
  console.log(file)
  /*
  {
    zip: <Buffer 12 12 221 122...>
  }
  */
})

if the zip option is false then the response will be an Array

example :-

subscene.download(subPath).then(file=>{
  console.log(file)
  /*
    [
      {
        filename:"money heist s05e01.srt",
        file:<Buffer 00 11 11 22 112...>
      },
      {
        filename:"money-heist s05e02.srt",
        file:<some buffer>
      }....
    ]
  */
})

One More Example to easly understand

subscene.search("money heist").then(res=>{
  /*
  [
  {title:"money heist", path:"some path"}...
  ]
  */
  var selectedSeriesPath=res[0].path //select a path
  subscene.getSubtitles(selectedSeriesPath).then(subtitles=>{
    /*
    {
      english:[
      {title:"some title",path:"some path",lang:"English"}...
      ]
    }...
    */
    var selectedSubtitlePath=subtitles.english[0].path //select a Subtitile path
    subscene.download(selectedSubtitlePath,{zip:false}).then((file)=>{
      /*
      [
      {
        filename:"filename",
        file: buffer
      }...
      ]
      */
      console.log(file[0].file.toString())
      /*
      1
      00:00:01,500 --> 00:00:05,200
      Some diloge is here
      ..
      ..
      ..
      */
    })
  })
})