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 🙏

© 2024 – Pkg Stats / Ryan Hefner

viurr

v1.4.0

Published

Download programmes from Viu

Downloads

12

Readme

Viurr

Download programmes from Viu

Install

If you have already installed node>=16.20, you can install Viurr globally to make it available in PATH.

# npm
npm install -g viurr
# pnpm
pnpm install -g viurr

Usage

Command Line Interface

Inspect

# Inspect the details of an episode
viurr inspect episode <productId>
# Inspect details of a series
viurr inspect series <productId>

| Option | Description | | -------- | ------------------------------- | | --json | Print the result in JSON format |

Download

# Download files of an episode
viurr download episode <type> <productId>
# Download files of a series
viurr download series <type> <productId>

Options

type

cover | subtitle | video

Specify --help to see the available options of each type, for example:

$ viurr download episode video --help
viurr download episode video <productId>

Download video of an episode

Options:
  --help     Show help                                                 [boolean]
  --version  Show version number                                       [boolean]
  --quality  Video quality
          [string] [choices: "1080p", "720p", "480p", "240p"] [default: "1080p"]

productId

The ID that can be found in the URL on viu.com, for example,

https://www.viu.com/ott/hk/zh-hk/vod/6979/男兒當入樽
                                     ----

The productId of this episode is 6979.


Examples

Cover image

$ viurr download episode cover 6979
Downloading cover image of 「男兒當入樽」 EP.1 【天才籃球員誕生】
Downloaded: /path/to/your/directory/男兒當入樽 EP.1 【天才籃球員誕生】.jpeg

Subtitle

$ viurr download episode subtitle 6979
Downloading subtitle of 「男兒當入樽」 EP.1 【天才籃球員誕生】 (Language: 繁體中文)
Downloaded: /path/to/your/directory/男兒當入樽 EP.1 【天才籃球員誕生】.chi.srt

Video

$ viurr download episode video 6979
Downloading video of 「男兒當入樽」 EP.1 【天才籃球員誕生】 (Quality: 1080p)

# encode in progress
Downloading video of 「男兒當入樽」 EP.1 【天才籃球員誕生】 (Quality: 1080p)
Encoding [872.93/fps] [1843.7 Kb/s] [23.5 MB] [00:01:46]

# after finished
Downloading video of 「男兒當入樽」 EP.1 【天才籃球員誕生】 (Quality: 1080p)
Downloaded: /path/to/your/directory/男兒當入樽 EP.1 【天才籃球員誕生】.mkv

This program uses FFmpeg to encode the HLS playlist file and output the video with the original codecs. (i.e. -c copy).

If you already have FFmpeg available in your PATH, then you are good to go, otherwise, you need to set the environment variable FFMPEG_PATH as the path to the executable FFmpeg.

Example:

FFMPEG_PATH=/path/to/ffmpeg viurr download episode video 6979

Note

  • download series is a shortcut to download episode to handle all available episodes in a series.
  • It is recommended to use inspect to see the available subtitles and video qualities before attempting to download the files.

Programmatic

Install as local module

# npm
npm install viurr --save
# pnpm
pnpm install viurr

Types

Learn more here

Inspect

import { inspect } from "viurr";

Inspect the details of an episode

inspect.episode(productId: string): Promise<IEpisode>

Inspect the details of a series

inspect.series(productId: string): Promise<ISeries>

Download

import { download } from "viurr";

Download the video in specific quality

download.video(productId: string, quality: QualityOption = '1080p'): Promise<[ISeries, IEpisode, string, IEncoder]>

Download the cover image

download.cover(productId: string): Promise<[ISeries, IEpisode, string]>

Download the subtitle in specific language in SRT format

download.subtitle(productId: string, languageId: LanguageFlag, temporary = false): Promise<[ISeries, IEpisode, string]>

TODO

  • [x] Combine second subtitle
  • [ ] Interactive CLI

Build

pnpm build

Development

pnpm build:watch
pnpm cli

Test

Not available

License

MIT License

Disclaimer

This project is for technical testing and educational purposes only. The owner and contributors do not assume any legal responsibilities caused by the users. Users should be aware of and take the risks.