-
Notifications
You must be signed in to change notification settings - Fork 5
/
run.sh
98 lines (76 loc) · 3.05 KB
/
run.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
#!/usr/bin/env bash
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
workspace="${DIR}/workspace"
[ -d "$workspace" ] && rm -rf "$workspace"
mkdir "$workspace"
cd "$workspace"
npm init -y
npm install --save "${DIR}/.."
clear
PATH="${workspace}/node_modules/.bin:${PATH}"
# ------------------------------------------------------------------------------
# =================================
# master manifest w/
# - several bitrates
# - no encryption
# =================================
# http://inisoft.tv/demo/demo_desh.html
# https://ext.inisoft.tv/demo.xml
# =================================
hls_url='https://ext.inisoft.tv/demo/ED/hls_v4/demo.m3u8'
wrk_dir="${workspace}/1"
mkdir "${wrk_dir}"
mkdir "${wrk_dir}/1. hls"
mkdir "${wrk_dir}/2. mp4"
hlsdl -mc 5 --url "$hls_url" -P "${wrk_dir}/1. hls" --mp4 "${wrk_dir}/2. mp4/video.mp4"
# ------------------------------------------------------------------------------
# =================================
# video manifest only
# - heavy encryption
# (each video segment has a unique encryption key)
# =================================
# http://demo.theoplayer.com/drm-aes-protection-128-encryption
# =================================
hls_url='https://cdn.theoplayer.com/video/big_buck_bunny_encrypted/stream-800/index.m3u8'
wrk_dir="${workspace}/2"
mkdir "${wrk_dir}"
mkdir "${wrk_dir}/1. hls"
mkdir "${wrk_dir}/2. mp4"
hlsdl -mc 5 --url "$hls_url" -P "${wrk_dir}/1. hls" --mp4 "${wrk_dir}/2. mp4/video.mp4"
# ------------------------------------------------------------------------------
# =================================
# master manifest w/
# - several bitrates
# - no encryption
# - 3x audio streams
# - 6x subtitles streams
# =================================
# https://developer.jwplayer.com/jw-player/demos/toolbox/closed-captions/
# =================================
hls_url='https://wowzaec2demo.streamlock.net/vod-multitrack/_definst_/smil:ElephantsDream/elephantsdream2.smil/playlist.m3u8'
wrk_dir="${workspace}/3"
mkdir "${wrk_dir}"
mkdir "${wrk_dir}/1. hls"
mkdir "${wrk_dir}/2. mp4"
# workaround for TLS error: "certificate has expired"
NODE_TLS_REJECT_UNAUTHORIZED=0 && \
hlsdl -hq -fa '^english$' -as -mc 5 --url "$hls_url" -P "${wrk_dir}/1. hls" --mp4 "${wrk_dir}/2. mp4/video.mp4"
# ------------------------------------------------------------------------------
# =================================
# master manifest w/
# - several bitrates
# - no encryption
# - no audio streams
# - 12x subtitles streams (total)
# - 6x subtitles streams (unique)
# =================================
# https://roosterteeth.com/watch/rwby-volume-6-1
# https://svod-be.roosterteeth.com/api/v1/watch/rwby-volume-6-1/videos
# =================================
hls_url='https://svod-be.roosterteeth.com/api/v1/videos/4cde6796-0a42-4b57-bb3c-dc520042b539/master.m3u8'
wrk_dir="${workspace}/4"
mkdir "${wrk_dir}"
mkdir "${wrk_dir}/1. hls"
mkdir "${wrk_dir}/2. mp4"
hlsdl -hq -sv -sa -as -mc 5 --url "$hls_url" -P "${wrk_dir}/1. hls" --mp4 "${wrk_dir}/2. mp4/video.mp4"
# ------------------------------------------------------------------------------