Skip to content

Commit

Permalink
update README
Browse files Browse the repository at this point in the history
  • Loading branch information
vitalygashkov committed Apr 24, 2024
1 parent 0036536 commit 06f8ff7
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 0 deletions.
13 changes: 13 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@

Library for parsing MPEG-DASH and HLS manifests. Made with the purpose of obtaining a simplified representation convenient for further downloading of segments.

<div align="left">
<span>English</span> •
<a href="https://github.com/vitalygashkov/dasha/tree/main/docs/README.ru.md">Pусский</a>
</div>

## Install

```shell
Expand All @@ -15,9 +20,17 @@ npm i dasha
## Quick start

```js
import fs from 'node:fs/promises';
import { parse } from 'dasha';

const url = 'https://dash.akamaized.net/dash264/TestCases/1a/sony/SNE_DASH_SD_CASE1A_REVISED.mpd';
const body = await fetch(url).then((res) => res.text());
const manifest = await parse(body, url);

for (const track of manifest.tracks.all) {
for (const segment of track.segments) {
const content = await fetch(url).then((res) => res.arrayBuffer());
await fs.appendFile(`${track.id}.mp4`, content);
}
}
```
36 changes: 36 additions & 0 deletions docs/README.ru.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# dasha

[![npm version](https://img.shields.io/npm/v/dasha?style=flat&color=white)](https://www.npmjs.com/package/dasha)
[![npm downloads/month](https://img.shields.io/npm/dm/dasha?style=flat&color=white)](https://www.npmjs.com/package/dasha)
[![npm downloads](https://img.shields.io/npm/dt/dasha?style=flat&color=white)](https://www.npmjs.com/package/dasha)

Библиотека для парсинга MPEG-DASH и HLS манифестов. Создана с целью получения упрощенного представления, удобного для дальнейшей загрузки сегментов.

<div align="left">
<a href="https://github.com/vitalygashkov/dasha/tree/main/README.md">English</a> •
<span>Русский</span>
</div>

## Установка

```shell
npm i dasha
```

## Быстрый старт

```js
import fs from 'node:fs/promises';
import { parse } from 'dasha';

const url = 'https://dash.akamaized.net/dash264/TestCases/1a/sony/SNE_DASH_SD_CASE1A_REVISED.mpd';
const body = await fetch(url).then((res) => res.text());
const manifest = await parse(body, url);

for (const track of manifest.tracks.all) {
for (const segment of track.segments) {
const content = await fetch(url).then((res) => res.arrayBuffer());
await fs.appendFile(`${track.id}.mp4`, content);
}
}
```

0 comments on commit 06f8ff7

Please sign in to comment.