GithubHelp home page GithubHelp logo

pemre / iptv-cli Goto Github PK

View Code? Open in Web Editor NEW
9.0 3.0 4.0 30 KB

iptv-cli is a command line tool to parse, filter iptv lists (m3u/m3u8 files).

License: GNU General Public License v3.0

JavaScript 100.00%
iptv iptv-m3u iptv-channels iptv-playlist iptv-m3u8 cli nodejs

iptv-cli's Introduction

iptv-cli

npm npm npm

iptv-cli is a command line tool to parse, filter iptv lists (m3u/m3u8 files).

Install

npm install -g iptv-cli

Usage

You can start by generating an allowed-categories.js file from your iptv list:

iptv-cli get-categories --from-file iptv-list.m3u
> File has been created: allowed-categories.js

Now you have a list of categories in allowed-categories.js file. You can edit it to filter out the categories that you don't want to see. After editing that file, use it as an argument in filter command:

iptv-cli filter --from-file iptv-list.m3u --allowed-categories allowed-categories.js --out new.m3u
> File has been created: new.m3u

Enjoy your filtered new.m3u file. You can use your favorite IpTv client to watch your channels!

Tip: If you also want to filter by channel ids, you can add another argument. See Commands section below.

Commands

iptv-cli [command] <options>
  filter ............. generate an iptv list filtered by at least one allowed-*.js file
  get-categories ..... generate categories file (allowed-categories.js) from an iptv list file
  get-channels ....... generate channels file (allowed-channels.js) from an iptv list file
  version ............ show cli version
  help ............... show help menu for a command

filter

iptv-cli filter <options> (at least one --allowed-* argument is required)
  --from-file ........... (required) set the source iptv file. e.g. --from-file example.m3u
  --allowed-categories .. filter by category file. You can generate the file with get-categories command.
  --allowed-channels .... filter by channel ids file. You can generate one with get-channels command.
  --out ................. set the filename for filtered iptv file. default: iptv-list.m3u

get-categories

iptv-cli get-categories <options>
  --from-file ........... (required) set the source iptv channel list file. e.g. --from-file example.m3u

get-channels

iptv-cli get-channels <options>
  --from-file ........... (required) set the source iptv channel list file. e.g. --from-file example.m3u

Example files

You can find all example files to parse/generate in the root folder of the project, starting with example- prefix.

iptv-cli's People

Contributors

dependabot[bot] avatar kishcom avatar pemre avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

iptv-cli's Issues

TypeError: Cannot read property 'trim' of undefined

when i use the tool i get this error with large list more than 160M

TypeError: Cannot read property 'trim' of undefined
at channels.map (/usr/local/lib/node_modules/iptv-cli/src/commands/get-categories.js:13:74)
at Array.map ()
at getCategories (/usr/local/lib/node_modules/iptv-cli/src/commands/get-categories.js:13:34)
at Proxy.cli (/usr/local/lib/node_modules/iptv-cli/src/cli.js:31:7)
at Object. (/usr/local/lib/node_modules/iptv-cli/index.js:3:25)
at Module._compile (module.js:652:30)
at Object.Module._extensions..js (module.js:663:10)
at Module.load (module.js:565:32)
at tryModuleLoad (module.js:505:12)
at Function.Module._load (module.js:497:3)

could you help to solve this issue plz

thanx

Error on getting categories

Hi, brand new install and attempting to parse a local m3u file is giving me the following error when getting categories:

/usr/local/lib/node_modules/iptv-cli/node_modules/m3u8-file-parser/src/parser/extinf.js:55
        token = str.slice(pos + 1, match.index);
                                         ^

TypeError: Cannot read property 'index' of null
    at Object.extinf [as parser] (/usr/local/lib/node_modules/iptv-cli/node_modules/m3u8-file-parser/src/parser/extinf.js:55:42)
    at M3U8FileParser.invokeParser (/usr/local/lib/node_modules/iptv-cli/node_modules/m3u8-file-parser/src/reader.js:77:46)
    at M3U8FileParser.read (/usr/local/lib/node_modules/iptv-cli/node_modules/m3u8-file-parser/src/reader.js:59:12)
    at getChannelsFromFile (/usr/local/lib/node_modules/iptv-cli/src/lib/helpers.js:14:10)
    at getCategories (/usr/local/lib/node_modules/iptv-cli/src/commands/get-categories.js:7:16)
    at Proxy.cli (/usr/local/lib/node_modules/iptv-cli/src/cli.js:31:7)
    at Object.<anonymous> (/usr/local/lib/node_modules/iptv-cli/index.js:3:25)
    at Module._compile (internal/modules/cjs/loader.js:1063:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
    at Module.load (internal/modules/cjs/loader.js:928:32)

An idea what's going wrong? Thanks.

--allowed-categories not detected

Hi,

Brand new install, of npm, then of your scripts; seems very promising, but even copying the basic examples you document, it does not detect the --allowed-categories in filter mode and complains that at least one argument is required.

I would say this is to blame (in the filter command):
if (!args['allowed-channels'] && !args['allowed-channels']) {
console.error(Error: Missing arguments. At least one allowed argument must be used.);
return;
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.