GithubHelp home page GithubHelp logo

m3u-parser's Introduction

Парсер M3U плейлистов

Latest Version on Packagist Total Downloads License

Теги, поддерживаемые парсером:

  • #EXTM3U
  • #EXTENC
  • #PLAYLIST
  • #EXT-X-PLAYLIST-TYPE
  • #EXT-X-TARGETDURATION
  • #EXT-X-VERSION
  • #EXT-X-MEDIA-SEQUENCE
  • #EXT-X-ALLOWCACHE
  • #EXT-X-MAP
  • #EXT-X-START
  • #EXT-X-ENDLIST
  • #EXTINF
  • #EXT-X-PROGRAM-DATE-TIME
  • #EXTGRP
  • #EXTLOGO
  • #EXTVLCOPT
  • #EXT-X-DISCONTINUITY
  • #EXT-X-BYTERANGE

Пример использования:

use Akaramires\M3uParser\Processors\PlaylistProcessor;
use Akaramires\M3uParser\Sources\FileSource;

...

$source = new FileSource(__DIR__ . '/../Data/playlist.m3u');

/** @var PlaylistProcessor $processor */
$processor = app(PlaylistProcessor::class);

$processor->load($source);
$processor->parse();

$playlist = $processor->getPlaylist();

Пример ответа:

[
  "inlineAttributes" => [
    [
      "key" => "cache",
      "value" => "500",
    ],
    [
      "key" => "playlist",
      "value" => "1",
    ],
  ],
  "attributes" => [],
  "attributesWithoutValue" => [],
  "channels" => [
    [
      "title" => "TVMatic Comedy",
      "duration" => "0",
      "url" => "https://iptv.com/channel.m3u8",
      "inlineAttributes" => [
        [
          "key" => "tvg-country",
          "value" => "es",
        ],
        [
          "key" => "group-title",
          "value" => "Spain",
        ],
      ],
      "attributes" => [],
    ]
    [
      "title" => "TVMatic Comedy 2",
      "duration" => "0",
      "url" => "https://iptv.com/channel.m3u8",
      "inlineAttributes" => [],
      "attributes" => [],
    ],
  ],

m3u-parser's People

Contributors

akaramires avatar

Watchers

 avatar

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.