{"id":17472609,"url":"https://github.com/shinnn/parse-m3u8","last_synced_at":"2025-04-09T22:53:39.469Z","repository":{"id":57319409,"uuid":"142082042","full_name":"shinnn/parse-m3u8","owner":"shinnn","description":"Parse M3U8","archived":false,"fork":false,"pushed_at":"2019-06-14T06:37:09.000Z","size":87,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-24T00:42:48.517Z","etag":null,"topics":["hls","javascript","m3u","m3u8","nodejs","parser","streaming","video"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"isc","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/shinnn.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-07-24T00:04:11.000Z","updated_at":"2024-07-01T19:26:01.000Z","dependencies_parsed_at":"2022-08-25T20:41:24.549Z","dependency_job_id":null,"html_url":"https://github.com/shinnn/parse-m3u8","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shinnn%2Fparse-m3u8","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shinnn%2Fparse-m3u8/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shinnn%2Fparse-m3u8/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shinnn%2Fparse-m3u8/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/shinnn","download_url":"https://codeload.github.com/shinnn/parse-m3u8/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248085321,"owners_count":21045139,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["hls","javascript","m3u","m3u8","nodejs","parser","streaming","video"],"created_at":"2024-10-18T17:28:53.436Z","updated_at":"2025-04-09T22:53:39.444Z","avatar_url":"https://github.com/shinnn.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# parse-m3u8\n\n[![npm version](https://img.shields.io/npm/v/parse-m3u8.svg)](https://www.npmjs.com/package/parse-m3u8)\n[![GitHub Actions](https://action-badges.now.sh/shinnn/parse-m3u8)](https://wdp9fww0r9.execute-api.us-west-2.amazonaws.com/production/results/shinnn/parse-m3u8)\n[![codecov](https://codecov.io/gh/shinnn/parse-m3u8/branch/master/graph/badge.svg)](https://codecov.io/gh/shinnn/parse-m3u8)\n\nA [Node.js](https://nodejs.org/) module to parse [M3U8](https://en.wikipedia.org/wiki/M3U#M3U8)\n\n```javascript\nconst parseM3u8 = require('parse-m3u8');\n\nparseM3u8(`#EXTM3U\n#EXT-X-TARGETDURATION:10\n#EXTINF:10,\n0.ts\n#EXTINF:20,\n1.ts\n`).segments; /*=\u003e  [\n  {\n    duration: 10,\n    uri: '0.ts',\n    timeline: 0\n  },\n  {\n    duration: 20,\n    uri: '1.ts',\n    timeline: 0\n  }\n] */\n```\n\n## Installation\n\n[Use](https://docs.npmjs.com/cli/install) [npm](https://docs.npmjs.com/about-npm/).\n\n```\nnpm install parse-m3u8\n```\n\n## API\n\n```javascript\nconst parseM3u8 = require('parse-m3u8');\n```\n\n### parseM3u8(*contents* [, *option*])\n\n*contents*: `string`  \n*option*: `Object`  \nReturn: `Object`\n\nIt parses a given `string` with [m3u8-parser](https://github.com/videojs/m3u8-parser) and returns a [result `Object`](https://github.com/videojs/m3u8-parser#parsed-output).\n\n#### option.baseUri\n\nType: `string | URL`\n\nRebase `uri` properties of each items in `playlists` and `segments` to this URL.\n\n```javascript\nconst source = `#EXTM3U\n#EXT-X-STREAM-INF:BANDWIDTH=300000\nlow.m3u8\n#EXT-X-STREAM-INF:BANDWIDTH=600000\nhigh.m3u8`;\n\nparseM3u8(source).playlists; /*=\u003e [\n  {\n    attributes: {BANDWIDTH: 300000},\n    uri: 'low.m3u8',\n    timeline: 0\n  },\n  {\n    attributes: {BANDWIDTH: 600000},\n    uri: 'high.m3u8',\n    timeline: 0\n  }\n] */\n\nparseM3u8(source, {baseUri: 'https://example.org/assets/playlists/'}).playlists; /*=\u003e [\n  {\n    attributes: {BANDWIDTH: 300000},\n    uri: 'https://example.org/assets/playlists/low.m3u8',\n    timeline: 0\n  },\n  {\n    attributes: {BANDWIDTH: 600000},\n    uri: 'https://example.org/assets/playlists/high.m3u8',\n    timeline: 0\n  }\n] */\n```\n\n## License\n\n[ISC License](./LICENSE) © 2018 - 2019 Watanabe Shinnosuke\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshinnn%2Fparse-m3u8","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fshinnn%2Fparse-m3u8","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshinnn%2Fparse-m3u8/lists"}