Skip to content

Commit dbb734d

Browse files
committed
Module library consistency
1 parent a6d4fa1 commit dbb734d

File tree

4 files changed

+69
-8
lines changed

4 files changed

+69
-8
lines changed

.github/FUNDING.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# These are supported funding model platforms
2+
3+
github: [alan-null]
4+
custom: ['https://www.paypal.com/paypalme/plocieniak']

LICENSE.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
MIT License
2+
3+
Copyright (c) 2017 Alan Płócieniak
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
6+
7+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
8+
9+
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

README.md

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
[![Build status](https://ci.appveyor.com/api/projects/status/xaaaux3yhb7k9a66/branch/master?svg=true)](https://ci.appveyor.com/project/alannull/nullkit/branch/master)
2-
31
# NullKit
2+
[![PowerShell Gallery](https://img.shields.io/powershellgallery/v/NullKit?label=NullKit&color=blue&logo=data:image/svg%2bxml;base64,PHN2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IuMzA1IDEuMDI2LTMuMTE0IDMuOTU1LTIuODkzIDcuOTAzLTUuNzk4IDExLjgzNC04LjcyNUMyMy44NjUgMjQuODMgMjQuNTk1IDI0LjI2NyAyNS4wNTcgMjMuOTIyek0yMS43NSAzN0MyMC42MjUgMzcgMjAgMzYgMjAgMzVzLjYyNS0yIDEuNzUtMmM0LjIyNCAwIDYuMTEyIDAgOS41IDAgMS4xMjUgMCAxLjc1IDEgMS43NSAycy0uNjI1IDItMS43NSAyQzI5LjEyNSAzNyAyNSAzNyAyMS43NSAzN3oiLz48L3N2Zz4=)](https://www.powershellgallery.com/packages/NullKit)
3+
[![License](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE.md)
44

55
## Installation
66

@@ -9,21 +9,17 @@ Module is available on [Powershell Gallery][gallery]
99
### Install
1010

1111
```powershell
12-
PS> Install-Module -Name NullKit
12+
Install-Module -Name NullKit
1313
```
1414

1515
### Import
1616

1717
```powershell
18-
PS> Import-Module NullKit
18+
Import-Module NullKit
1919
```
2020

2121
## Usage
2222

2323
Documentation soon
2424

25-
## Publishing
26-
27-
`Publish-Module -Name WebPIPS -NuGetApiKey [API_KEY]`
28-
2925
[gallery]: https://www.powershellgallery.com/packages/NullKit/

media/Save-Stream.ps1

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
function Invoke-WithoutProgress {
2+
[CmdletBinding()]
3+
param (
4+
[Parameter(Mandatory)] [scriptblock] $ScriptBlock
5+
)
6+
7+
$prevProgressPreference = $global:ProgressPreference
8+
$global:ProgressPreference = 'SilentlyContinue'
9+
10+
try {
11+
. $ScriptBlock
12+
}
13+
finally {
14+
$global:ProgressPreference = $prevProgressPreference
15+
}
16+
}
17+
18+
function Save-Stream {
19+
[CmdletBinding()]
20+
param (
21+
[Parameter(Mandatory = $false, Position = 0)]
22+
[string]$M3UPlaylistUrl
23+
)
24+
25+
if ([string]::IsNullOrWhiteSpace($M3UPlaylistUrl)) {
26+
return
27+
}
28+
29+
$baseUrl = Split-Path $M3UPlaylistUrl
30+
$baseUrl = $baseUrl.Replace("\", "/")
31+
$location = Get-Location
32+
33+
$indexList = (Invoke-WebRequest -Uri $M3UPlaylistUrl).RawContent.Split("`n") `
34+
| ? { $_ -ne "" } `
35+
| Skip-While { $_.StartsWith("#EXTM3U") -eq $false } `
36+
| ? { -not $_.StartsWith("#") } `
37+
| % { "$baseUrl/$_" }
38+
39+
$i = 0
40+
$totalItems = $indexList.Count
41+
$percentComplete = 0
42+
$indexList | % {
43+
Write-Progress -Activity "Saving stream" -Status "Processing part $i of $totalItems" -PercentComplete $percentComplete
44+
Invoke-WithoutProgress {
45+
Write-Host "$location\$i.ts"
46+
Invoke-WebRequest -Uri $_ -OutFile "$location\$i.ts"
47+
}
48+
# $i++
49+
$percentComplete = ($i++ / $totalItems) * 100
50+
}
51+
52+
}

0 commit comments

Comments
 (0)