@warren-bank/hls-proxy 0.20.2 → 0.20.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/hls-proxy/proxy.js +2 -2
- package/hls-proxy/segment_cache.js +2 -1
- package/package.json +1 -1
package/hls-proxy/proxy.js
CHANGED
|
@@ -37,8 +37,8 @@ const proxy = function({server, host, is_secure, req_headers, req_options, hooks
|
|
|
37
37
|
ts_duration: new RegExp('^#EXT-X-TARGETDURATION:(\\d+)(?:\\.\\d+)?$', 'im'),
|
|
38
38
|
vod: new RegExp('^(?:#EXT-X-PLAYLIST-TYPE:VOD|#EXT-X-ENDLIST)$', 'im'),
|
|
39
39
|
vod_start_at: new RegExp('#vod_start(?:_prefetch_at)?=((?:\\d+:)?(?:\\d+:)?\\d+)$', 'i'),
|
|
40
|
-
urls: new RegExp('(^|[\\s\'"])((?:https?:/)?/)?((?:[^\\?#,/\\s\'"]*/)+?)?([^\\?#,/\\s\'"]+?)(\\.[^\\?#,/\\.\\s\'"]+(?:[\\?#][^\\s\'"]*)?)?([\\s\'"]|$)', 'img'),
|
|
41
|
-
keys: new RegExp('(^#EXT-X-KEY:
|
|
40
|
+
urls: new RegExp('(^|(?<!(?:KEYFORMAT=))[\\s\'"])((?:https?:/)?/)?((?:[^\\?#,/\\s\'"]*/)+?)?([^\\?#,/\\s\'"]+?)(\\.[^\\?#,/\\.\\s\'"]+(?:[\\?#][^\\s\'"]*)?)?([\\s\'"]|$)', 'img'),
|
|
41
|
+
keys: new RegExp('(^#EXT-X-KEY:(?:.+,)?URI=")([^"]+)(".*$)', 'img')
|
|
42
42
|
}
|
|
43
43
|
|
|
44
44
|
const add_CORS_headers = function(res) {
|
|
@@ -168,8 +168,9 @@ module.exports = function({should_prefetch_url, debug, debug_level, request, get
|
|
|
168
168
|
|
|
169
169
|
let options = get_request_options(url, referer_url)
|
|
170
170
|
promise = request(options, '', {binary: true, stream: false})
|
|
171
|
-
.then(({response}) => {
|
|
171
|
+
.then(({redirects, response}) => {
|
|
172
172
|
debug(1, `prefetch (complete, ${response.length} bytes):`, debug_url)
|
|
173
|
+
debug(2, 'prefetch response:', {status_code: response.statusCode, headers: response.headers, redirects})
|
|
173
174
|
|
|
174
175
|
// asynchronous callback could occur after garbage collection; the index could've changed
|
|
175
176
|
index = find_index_of_segment(m3u8_url, url)
|
package/package.json
CHANGED