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

iptv-checker

v0.28.0

Published

Node.js CLI tool for checking links in IPTV playlists

Downloads

1,047

Readme

IPTV Checker Build Status

Node.js CLI tool for checking links in IPTV playlists.

This tool is based on the ffmpeg library, so you need to install it on your computer first. You can find the right installer for your system here: https://www.ffmpeg.org/download.html

Usage

CLI

npm install -g iptv-checker

Check local playlist file:

iptv-checker /path-to-playlist/example.m3u

Check playlist URL:

iptv-checker https://some-playlist.lol/list.m3u

Pipe playlist from stdin:

cat ~/some-playlist.m3u | iptv-checker

Arguments:

  • -o, --output: change default output directory
  • -t, --timeout: specifies the number of milliseconds before the request will be aborted (default to 60000)
  • -a, --user-agent: set custom HTTP User-Agent
  • -k, --insecure: allow insecure connections when using SSL
  • -p, --parallel: Batch size of channels to check concurrently (default to 1)

Module

npm install iptv-checker
var IPTVChecker = require('iptv-checker')

var checker = new IPTVChecker()

// using playlist url
checker.checkPlaylist('https://some-playlist.lol/list.m3u').then(results => {
  console.log(results)
})

// using local path
checker.checkPlaylist('path/to/playlist.m3u').then(results => {
  console.log(results)
})

// using playlist as string
checker.checkPlaylist(string).then(results => {
  console.log(results)
})

Results

On success:

{
  header: {
    attrs: {},
    raw: '#EXTM3U x-tvg-url=""'
  },
  items: [
    {
      name: 'KBSV/AssyriaSat (720p) [Not 24/7]',
      tvg: {
        id: 'KBSVAssyriaSat.us',
        name: '',
        logo: 'https://i.imgur.com/zEWSSdf.jpg',
        url: '',
        rec: ''
      },
      group: {
        title: 'General'
      },
      http: {
        referrer: '',
        'user-agent': ''
      },
      url: 'http://66.242.170.53/hls/live/temp/index.m3u8',
      raw: '#EXTINF:-1 tvg-id="KBSVAssyriaSat.us" tvg-logo="https://i.imgur.com/zEWSSdf.jpg" group-title="General",KBSV/AssyriaSat (720p) [Not 24/7]\r\nhttp://66.242.170.53/hls/live/temp/index.m3u8',
      line: 2,
      catchup: {
        type: '',
        days: '',
        source: ''
      },
      timeshift: '',
      status: {
        ok: true,
        metadata: {
          streams: [
            {
              index: 0,
              codec_name: 'h264',
              codec_long_name: 'H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10',
              profile: 'High',
              codec_type: 'video',
              codec_tag_string: '[27][0][0][0]',
              codec_tag: '0x001b',
              width: 1280,
              height: 720,
              coded_width: 1280,
              coded_height: 720,
              closed_captions: 0,
              has_b_frames: 2,
              pix_fmt: 'yuv420p',
              level: 31,
              chroma_location: 'left',
              refs: 1,
              is_avc: 'false',
              nal_length_size: '0',
              r_frame_rate: '30/1',
              avg_frame_rate: '0/0',
              time_base: '1/90000',
              start_pts: 943358850,
              start_time: '10481.765000',
              bits_per_raw_sample: '8',
              disposition: {
                default: 0,
                dub: 0,
                original: 0,
                comment: 0,
                lyrics: 0,
                karaoke: 0,
                forced: 0,
                hearing_impaired: 0,
                visual_impaired: 0,
                clean_effects: 0,
                attached_pic: 0,
                timed_thumbnails: 0
              },
              tags: {
                variant_bitrate: '400000'
              }
            },
            //...
          ],
          format: {
            filename: 'http://66.242.170.53/hls/live/temp/index.m3u8',
            nb_streams: 2,
            nb_programs: 1,
            format_name: 'hls',
            format_long_name: 'Apple HTTP Live Streaming',
            start_time: '10481.560589',
            size: '214',
            probe_score: 100
          },
          requests: [
            {
              method: 'GET',
              url: 'http://66.242.170.53/hls/live/temp/index.m3u8',
              headers: {
                'User-Agent': 'Lavf/58.76.100',
                Accept: '*/*',
                Range: 'bytes=0-',
                Connection: 'close',
                Host: '66.242.170.53',
                'Icy-MetaData': '1'
              }
            },
            //...
          ]
        }
      }
    },
    //...
  ]
}

On error:

{
  header: {
    attrs: {},
    raw: '#EXTM3U x-tvg-url=""'
  },
  items: [
    {
      name: 'Addis TV (720p)',
      tvg: {
        id: 'AddisTV.et',
        name: '',
        logo: 'https://i.imgur.com/KAg6MOI.png',
        url: '',
        rec: ''
      },
      group: {
        title: ''
      },
      http: {
        referrer: '',
        'user-agent': ''
      },
      url: 'https://rrsatrtmp.tulix.tv/addis1/addis1multi.smil/playlist.m3u8',
      raw: '#EXTINF:-1 tvg-id="AddisTV.et" tvg-logo="https://i.imgur.com/KAg6MOI.png" group-title="Undefined",Addis TV (720p)\\r\\nhttps://rrsatrtmp.tulix.tv/addis1/addis1multi.smil/playlist.m3u8',
      line: 2,
      catchup: {
        type: '',
        days: '',
        source: ''
      },
      timeshift: '',
      status: {
        ok: false,
        code: 'HTTP_REQUEST_TIMEOUT',
        message: 'HTTP 408 Request Timeout',
      }
    },
    //...
  ]
}

Error codes

A full list of the error codes used and their descriptions can be found here.

Contribution

If you find a bug or want to contribute to the code or documentation, you can help by submitting an issue or a pull request.

License

MIT