This is a standalone tool to monitor HLS channel list.
- Only live bitrate playlist is supported
- AWS SES email will be sent if abnormal segment download size detected.
- Log data will be removed after a week.

## Dependencies
1. nodjes 10.0 or up
2. sqlite3 compatible OS
    - Normally you won't have problem.
    - sqlite3 will be installed through `npm install`.
3. Network bandwidth to monitor the channel.

## Install
```
cd <PROJECT_DIR>
npm install
```

## Config
`config.js` in the project folder. 
```javascript
{
    "url": "http://localhost:3030/list.json", // monitor list
    "port": 3030,  // You can access the log through http://localhost:<port>/
    "aws": { // optional, delete this section will disable AWS SES (Simple Email Service).
        "accessKeyId": "<AWS_KEY_ID>",
        "secretAccessKey": "<AWS_KEY_SECRET>",
        "region": "us-east-1",

        "sender": "vincent.ma@endeavorstreaming.com",     // The sender email address. Has to be verified in AWS SES.
        "recipient": ["vincent.ma@endeavorstreaming.com"] // Please list all email addresses that want to be notified. Has to be verified in AWS SES.
    }
}
```

The size related configuration is based on the . 
Channel List sample
```javascript
{
    "list": [{
        "id": "wsltest_hd_400_ipad", // Unique id.
        "url": "http://nlds86.cdnak.neulion.com/nlds/wsl/wsltest/as/live/wsltest_hd_400_ipad.m3u8",
        "bandwidth": 400,            // kbps
        "bandwidthPercentBound": 40  // It indicates the upperBound is 400*140% kbps, and the lower bound is 400*60% kbps.
    }]
}
```


## Run
```
cd <PROJECT_DIR>
npm start
```

