uiolee/iptv2m3u


convert getAllChannel.json to m3u format.

https://npmjs.com/iptv2m3u

License: MPL-2.0

Language: TypeScript


iptv2m3u

convert getAllChannel.json to m3u format.

GitHub Tag GitHub Release GitHub commits since latest release GitHub top language CI Libraries.io dependency status for GitHub repo

npmjs

NPM Version NPM License NPM Downloads NPM Downloads Libraries.io dependency status for latest release

an examlple run in Node.JS

npm i iptv2m3u
// node example.mjs
import { readFile, writeFile } from "fs/promises";
import { IPTV2M3U } from "iptv2m3u";

readFile("./test/getAllChannel.json", { encoding: "utf-8" }).then((str) => {
  const iptv2m3u = new IPTV2M3U(str, { platform: "hw", sort: true });

  iptv2m3u.getM3uStringAsync().then(async (m3uStr) => {
    await writeFile(`./output/cmcc-iptv-${iptv2m3u.length} rtp.m3u`, m3uStr, {
      encoding: "utf-8",
    });
  });

  iptv2m3u
    .getM3uStringAsync({
      proxyPrefix: "https://127.0.0.1:4022/udp/",
    })
    .then(async (m3uStr) => {
      await writeFile(
        `./output/cmcc-iptv-${iptv2m3u.length} http.m3u`,
        m3uStr,
        { encoding: "utf-8" }
      );
    });
});

run in browser

Maybe it will works in the browser too, but I haven't tested it yet.

Project Statistics

Sourcerank 3
Repository Size 55.7 KB
Stars 1
Forks 0
Watchers 1
Open issues 0
Dependencies 8
Contributors 1
Tags 1
Created
Last updated
Last pushed

Top Contributors See all

Uiolee

Packages Referencing this Repo

iptv2m3u
convert getAllChannel.json to m3u format.
Latest release 0.1.0 - Published - 1 stars

Recent Tags See all

v0.1.0 September 01, 2024

Something wrong with this page? Make a suggestion

Last synced: 2024-11-06 18:12:40 UTC

Login to resync this repository