hls-fetcher
Advanced tools
Comparing version 2.2.2 to 2.3.0
@@ -0,1 +1,12 @@ | ||
<a name="2.3.0"></a> | ||
# [2.3.0](https://github.com/videojs/hls-fetcher/compare/v2.2.2...v2.3.0) (2021-05-19) | ||
### Bug Fixes | ||
* replace relative uri before converting to absolute ([#44](https://github.com/videojs/hls-fetcher/issues/44)) ([1b08ca6](https://github.com/videojs/hls-fetcher/commit/1b08ca6)) | ||
### Chores | ||
* update packages ([3010f4c](https://github.com/videojs/hls-fetcher/commit/3010f4c)) | ||
<a name="2.2.2"></a> | ||
@@ -2,0 +13,0 @@ ## [2.2.2](https://github.com/videojs/hls-fetcher/compare/v2.2.1...v2.2.2) (2020-12-02) |
{ | ||
"name": "hls-fetcher", | ||
"version": "2.2.2", | ||
"version": "2.3.0", | ||
"description": "Fetch HLS segments from an m3u8 playlist", | ||
@@ -11,3 +11,3 @@ "main": "src/index.js", | ||
"start": "npm run test -- --watch", | ||
"test": "NODE_ENV=test mocha --opts test/opts/unit.opts test/unit", | ||
"test": "NODE_ENV=test mocha test/unit", | ||
"update-changelog": "conventional-changelog -p videojs -i CHANGELOG.md -s", | ||
@@ -31,28 +31,28 @@ "preversion": "npm test", | ||
"bugs": { | ||
"url": "https://github.com/imbcmdth/hls-fetcher/issues" | ||
"url": "https://github.com/videojs/hls-fetcher/issues" | ||
}, | ||
"homepage": "https://github.com/imbcmdth/hls-fetcher#readme", | ||
"homepage": "https://github.com/videojs/hls-fetcher#readme", | ||
"dependencies": { | ||
"aes-decrypter": "^3.0.0", | ||
"bluebird": "^3.4.0", | ||
"filenamify": "^4.1.0", | ||
"m3u8-parser": "^4.4.2", | ||
"mkdirp": "^0.5.1", | ||
"mpd-parser": "^0.9.0", | ||
"aes-decrypter": "^3.1.2", | ||
"bluebird": "^3.7.2", | ||
"filenamify": "^4.3.0", | ||
"m3u8-parser": "^4.7.0", | ||
"mkdirp": "^1.0.4", | ||
"mpd-parser": "^0.16.0", | ||
"pessimist": "^0.3.5", | ||
"request": "^2.87.0", | ||
"requestretry": "^2.0.0" | ||
"requestretry": "^5.0.0" | ||
}, | ||
"devDependencies": { | ||
"conventional-changelog-cli": "^2.0.1", | ||
"conventional-changelog-cli": "^2.1.1", | ||
"conventional-changelog-videojs": "^3.0.0", | ||
"doctoc": "^1.3.1", | ||
"husky": "^1.0.0-rc.13", | ||
"lint-staged": "^7.2.2", | ||
"mocha": "^5.2.0", | ||
"nock": "^13.0.4", | ||
"doctoc": "^2.0.0", | ||
"husky": "^6.0.0", | ||
"lint-staged": "^11.0.0", | ||
"mocha": "^8.4.0", | ||
"nock": "^13.0.11", | ||
"not-prerelease": "^1.0.1", | ||
"npm-merge-driver-install": "^1.0.0", | ||
"videojs-generator-verify": "~1.0.4", | ||
"videojs-standard": "^7.0.1" | ||
"npm-merge-driver-install": "^2.0.1", | ||
"videojs-generator-verify": "~3.0.3", | ||
"videojs-standard": "^8.0.4" | ||
}, | ||
@@ -59,0 +59,0 @@ "generator-videojs-plugin": { |
@@ -96,5 +96,6 @@ /* eslint-disable no-console */ | ||
const parseMpdManifest = function(content, srcUrl) { | ||
const mpdPlaylists = mpd.toPlaylists(mpd.inheritAttributes(mpd.stringToMpdXml(content), { | ||
const parsedManifestInfo = mpd.inheritAttributes(mpd.stringToMpdXml(content), { | ||
manifestUri: srcUrl | ||
})); | ||
}); | ||
const mpdPlaylists = mpd.toPlaylists(parsedManifestInfo.representationInfo); | ||
@@ -136,6 +137,2 @@ const m3u8Result = mpd.toM3u8(mpdPlaylists); | ||
if (!isAbsolute(keyUri)) { | ||
keyUri = joinURI(path.dirname(manifest.uri), keyUri); | ||
} | ||
// if we are not decrypting then we just download the key | ||
@@ -154,2 +151,6 @@ if (!decrypt) { | ||
)); | ||
if (!isAbsolute(keyUri)) { | ||
keyUri = joinURI(path.dirname(manifest.uri), keyUri); | ||
} | ||
key.uri = keyUri; | ||
@@ -246,2 +247,9 @@ resources.push(key); | ||
); | ||
const file = existingManifest && existingManifest.file || manifest.file; | ||
const relativePath = path.relative(path.dirname(parent.file), file); | ||
// replace original uri in file with new file path | ||
parent.content = Buffer.from(parent.content.toString().replace(manifest.uri, relativePath)); | ||
// get the real uri of this playlist | ||
@@ -251,9 +259,4 @@ if (!isAbsolute(manifest.uri)) { | ||
} | ||
existingManifest = visitedUrls[manifest.uri]; | ||
const file = existingManifest && existingManifest.file || manifest.file; | ||
const relativePath = path.relative(path.dirname(parent.file), file); | ||
// replace original uri in file with new file path | ||
parent.content = Buffer.from(parent.content.toString().replace(uri, relativePath)); | ||
} | ||
@@ -333,2 +336,9 @@ | ||
if (manifest.content) { | ||
manifest.content = Buffer.from(manifest.content.toString().replace( | ||
s.uri, | ||
path.relative(path.dirname(manifest.file), s.file) | ||
)); | ||
} | ||
if (!isAbsolute(s.uri)) { | ||
@@ -341,8 +351,2 @@ s.uri = joinURI(path.dirname(manifest.uri), s.uri); | ||
} | ||
if (manifest.content) { | ||
manifest.content = Buffer.from(manifest.content.toString().replace( | ||
s.uri, | ||
path.relative(path.dirname(manifest.file), s.file) | ||
)); | ||
} | ||
resources.push(s); | ||
@@ -349,0 +353,0 @@ }); |
/* eslint-disable no-console */ | ||
const Promise = require('bluebird'); | ||
const mkdirp = Promise.promisify(require('mkdirp')); | ||
const mkdirp = require('mkdirp'); | ||
const request = require('requestretry'); | ||
@@ -5,0 +5,0 @@ const fs = Promise.promisifyAll(require('fs')); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
68658
1186
+ Addedmkdirp@1.0.4(transitive)
+ Addedmpd-parser@0.16.0(transitive)
+ Addedrequestretry@5.0.0(transitive)
+ Addedxmldom@0.5.0(transitive)
- Removed@videojs/vhs-utils@1.3.0(transitive)
- Removedajv@5.5.2(transitive)
- Removedco@4.6.0(transitive)
- Removedfast-deep-equal@1.1.0(transitive)
- Removedhar-validator@5.0.3(transitive)
- Removedjson-schema-traverse@0.3.1(transitive)
- Removedminimist@1.2.8(transitive)
- Removedmkdirp@0.5.6(transitive)
- Removedmpd-parser@0.9.0(transitive)
- Removedoauth-sign@0.8.2(transitive)
- Removedpunycode@1.4.1(transitive)
- Removedrequest@2.87.0(transitive)
- Removedrequestretry@2.0.2(transitive)
- Removedtough-cookie@2.3.4(transitive)
- Removedxmldom@0.1.31(transitive)
Updatedaes-decrypter@^3.1.2
Updatedbluebird@^3.7.2
Updatedfilenamify@^4.3.0
Updatedm3u8-parser@^4.7.0
Updatedmkdirp@^1.0.4
Updatedmpd-parser@^0.16.0
Updatedrequestretry@^5.0.0