1
0
Fork 0
mirror of https://github.com/DanielnetoDotCom/YouPHPTube synced 2025-10-05 19:42:38 +02:00

Improving the get restream credentials

This commit is contained in:
DanieL 2022-05-20 16:22:54 -03:00
parent 654dda115a
commit 56cb1fd5cb
6058 changed files with 1166166 additions and 1430809 deletions

View file

@ -1,15 +1,15 @@
.DS_Store
.monitor
.*.swp
.nodemonignore
releases
*.log
*.err
fleet.json
public/browserify
bin/*.json
.bin
build
compile
.lock-wscript
node_modules
.DS_Store
.monitor
.*.swp
.nodemonignore
releases
*.log
*.err
fleet.json
public/browserify
bin/*.json
.bin
build
compile
.lock-wscript
node_modules

View file

@ -1,14 +1,14 @@
{
"launchers": {
"node": {
"command": "node ./test"
}
},
"src_files": [
"./**/*.js"
],
"before_tests": "npm run build-test",
"on_exit": "rm test/static/bundle.js",
"test_page": "test/static/index.html",
"launch_in_dev": ["node", "phantomjs"]
}
{
"launchers": {
"node": {
"command": "node ./test"
}
},
"src_files": [
"./**/*.js"
],
"before_tests": "npm run build-test",
"on_exit": "rm test/static/bundle.js",
"test_page": "test/static/index.html",
"launch_in_dev": ["node", "phantomjs"]
}

View file

@ -1,6 +1,6 @@
language: node_js
node_js:
- 0.8
- 0.9
- 0.10
script: node ./test/index.js
language: node_js
node_js:
- 0.8
- 0.9
- 0.10
script: node ./test/index.js

38
node_modules/safe-json-parse/LICENCE generated vendored
View file

@ -1,19 +1,19 @@
Copyright (c) 2013 Raynos.
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:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
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.
Copyright (c) 2013 Raynos.
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:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
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.

View file

@ -1,82 +1,82 @@
# safe-json-parse
[![build status][1]][2] [![dependency status][3]][4]
<!-- [![browser support][5]][6] -->
Parse JSON safely without throwing
## Example (callback)
```js
var safeParse = require("safe-json-parse/callback")
safeParse("{}", function (err, json) {
/* we have json */
})
safeparse("WRONG", function (err) {
/* we have err! */
})
```
## Example (tuple)
```js
var safeParse = require("safe-json-parse/tuple")
var tuple1 = safeParse("{}")
var json = tuple1[1] /* we have json */
var tuple2 = safeparse("WRONG")
var err = tuple2[0] /* we have err! */
var tuple3 = safeParse(something)
if (tuple3[0]) {
var err = tuple3[0]
// handle err
} else {
var json = tuple3[1]
// handle json
}
```
## Example (result)
```js
var Result = require('rust-result')
var safeParse = require('safe-json-parse/result')
var result1 = safeParse("{}")
var json = Result.Ok(result1) /* we have json */
var result2 = safeparse("WRONG")
var err = Result.Err(result2) /* we have err! */
var result3 = safeParse(something)
if (Result.ifErr(result3)) {
var err = Result.Err(result3)
// handle err
} else if (Result.ifOk(result3)) {
var json = Result.Ok(result3)
// handle json
}
```
## Installation
`npm install safe-json-parse`
## Contributors
- Raynos
## MIT Licenced
[1]: https://secure.travis-ci.org/Raynos/safe-json-parse.png
[2]: https://travis-ci.org/Raynos/safe-json-parse
[3]: https://david-dm.org/Raynos/safe-json-parse.png
[4]: https://david-dm.org/Raynos/safe-json-parse
[5]: https://ci.testling.com/Raynos/safe-json-parse.png
[6]: https://ci.testling.com/Raynos/safe-json-parse
# safe-json-parse
[![build status][1]][2] [![dependency status][3]][4]
<!-- [![browser support][5]][6] -->
Parse JSON safely without throwing
## Example (callback)
```js
var safeParse = require("safe-json-parse/callback")
safeParse("{}", function (err, json) {
/* we have json */
})
safeparse("WRONG", function (err) {
/* we have err! */
})
```
## Example (tuple)
```js
var safeParse = require("safe-json-parse/tuple")
var tuple1 = safeParse("{}")
var json = tuple1[1] /* we have json */
var tuple2 = safeparse("WRONG")
var err = tuple2[0] /* we have err! */
var tuple3 = safeParse(something)
if (tuple3[0]) {
var err = tuple3[0]
// handle err
} else {
var json = tuple3[1]
// handle json
}
```
## Example (result)
```js
var Result = require('rust-result')
var safeParse = require('safe-json-parse/result')
var result1 = safeParse("{}")
var json = Result.Ok(result1) /* we have json */
var result2 = safeparse("WRONG")
var err = Result.Err(result2) /* we have err! */
var result3 = safeParse(something)
if (Result.ifErr(result3)) {
var err = Result.Err(result3)
// handle err
} else if (Result.ifOk(result3)) {
var json = Result.Ok(result3)
// handle json
}
```
## Installation
`npm install safe-json-parse`
## Contributors
- Raynos
## MIT Licenced
[1]: https://secure.travis-ci.org/Raynos/safe-json-parse.png
[2]: https://travis-ci.org/Raynos/safe-json-parse
[3]: https://david-dm.org/Raynos/safe-json-parse.png
[4]: https://david-dm.org/Raynos/safe-json-parse
[5]: https://ci.testling.com/Raynos/safe-json-parse.png
[6]: https://ci.testling.com/Raynos/safe-json-parse

View file

@ -1,18 +1,18 @@
module.exports = SafeParseCallback
function SafeParseCallback(obj, reviver, callback) {
if (arguments.length === 2) {
callback = reviver
reviver = null
}
var json
try {
json = JSON.parse(obj, reviver)
} catch (err) {
return callback(err)
}
callback(null, json)
}
module.exports = SafeParseCallback
function SafeParseCallback(obj, reviver, callback) {
if (arguments.length === 2) {
callback = reviver
reviver = null
}
var json
try {
json = JSON.parse(obj, reviver)
} catch (err) {
return callback(err)
}
callback(null, json)
}

View file

@ -1,81 +1,50 @@
{
"_from": "safe-json-parse@4.0.0",
"_id": "safe-json-parse@4.0.0",
"_inBundle": false,
"_integrity": "sha1-fA9XjPzNEtM6ccDgVBPi7KFx6qw=",
"_location": "/safe-json-parse",
"_phantomChildren": {},
"_requested": {
"type": "version",
"registry": true,
"raw": "safe-json-parse@4.0.0",
"name": "safe-json-parse",
"escapedName": "safe-json-parse",
"rawSpec": "4.0.0",
"saveSpec": null,
"fetchSpec": "4.0.0"
},
"_requiredBy": [
"/video.js"
],
"_resolved": "https://registry.npmjs.org/safe-json-parse/-/safe-json-parse-4.0.0.tgz",
"_shasum": "7c0f578cfccd12d33a71c0e05413e2eca171eaac",
"_spec": "safe-json-parse@4.0.0",
"_where": "G:\\GDrive\\htdocs\\YouPHPTube\\node_modules\\video.js",
"author": {
"name": "Raynos",
"email": "raynos2@gmail.com"
},
"bugs": {
"url": "https://github.com/Raynos/safe-json-parse/issues",
"email": "raynos2@gmail.com"
},
"bundleDependencies": false,
"contributors": [
{
"name": "Raynos"
}
],
"dependencies": {
"rust-result": "^1.0.0"
},
"deprecated": false,
"description": "Parse JSON safely without throwing",
"devDependencies": {
"tape": "~1.0.2"
},
"homepage": "https://github.com/Raynos/safe-json-parse",
"keywords": [],
"licenses": [
{
"type": "MIT",
"url": "http://github.com/Raynos/safe-json-parse/raw/master/LICENSE"
}
],
"main": "callback",
"name": "safe-json-parse",
"repository": {
"type": "git",
"url": "git://github.com/Raynos/safe-json-parse.git"
},
"scripts": {
"test": "node ./test/index.js"
},
"testling": {
"files": "test/index.js",
"browsers": [
"ie/8..latest",
"firefox/16..latest",
"firefox/nightly",
"chrome/22..latest",
"chrome/canary",
"opera/12..latest",
"opera/next",
"safari/5.1..latest",
"ipad/6.0..latest",
"iphone/6.0..latest",
"android-browser/4.2..latest"
]
},
"version": "4.0.0"
}
{
"name": "safe-json-parse",
"version": "4.0.0",
"description": "Parse JSON safely without throwing",
"keywords": [],
"author": "Raynos <raynos2@gmail.com>",
"repository": "git://github.com/Raynos/safe-json-parse.git",
"main": "callback",
"homepage": "https://github.com/Raynos/safe-json-parse",
"contributors": [
{
"name": "Raynos"
}
],
"bugs": {
"url": "https://github.com/Raynos/safe-json-parse/issues",
"email": "raynos2@gmail.com"
},
"dependencies": {
"rust-result": "^1.0.0"
},
"devDependencies": {
"tape": "~1.0.2"
},
"licenses": [
{
"type": "MIT",
"url": "http://github.com/Raynos/safe-json-parse/raw/master/LICENSE"
}
],
"scripts": {
"test": "node ./test/index.js"
},
"testling": {
"files": "test/index.js",
"browsers": [
"ie/8..latest",
"firefox/16..latest",
"firefox/nightly",
"chrome/22..latest",
"chrome/canary",
"opera/12..latest",
"opera/next",
"safari/5.1..latest",
"ipad/6.0..latest",
"iphone/6.0..latest",
"android-browser/4.2..latest"
]
}
}

View file

@ -1,15 +1,15 @@
var Result = require('rust-result');
module.exports = SafeParseTuple
function SafeParseTuple(obj, reviver) {
var json
try {
json = JSON.parse(obj, reviver);
} catch (err) {
return Result.Err(err);
}
return Result.Ok(json);
}
var Result = require('rust-result');
module.exports = SafeParseTuple
function SafeParseTuple(obj, reviver) {
var json
try {
json = JSON.parse(obj, reviver);
} catch (err) {
return Result.Err(err);
}
return Result.Ok(json);
}

View file

@ -1,65 +1,65 @@
var test = require("tape")
var Result = require("rust-result")
var safeParse = require("../callback")
var safeParseTuple = require("../tuple")
var safeParseResult = require("../result")
test("safeParse is a function", function (assert) {
assert.equal(typeof safeParse, "function")
assert.end()
})
test("safeParse valid json", function (assert) {
safeParse("{ \"foo\": true }", function (err, json) {
assert.ifError(err)
assert.equal(json.foo, true)
assert.end()
})
})
test("safeParse faulty", function (assert) {
safeParse("WRONG", function (err) {
assert.ok(err)
assert.equal(err.message, "Unexpected token W")
assert.end()
})
})
test("safeParseTuple valid json", function (assert) {
var t = safeParseTuple("{ \"foo\": true }")
assert.ifError(t[0])
assert.equal(t[1].foo, true)
assert.end()
})
test("safeParseTuple faulty", function (assert) {
var t = safeParseTuple("WRONG")
assert.ok(t[0])
assert.equal(t[0].message, "Unexpected token W")
assert.end()
})
test("safeParseResult valid json", function (assert) {
var t = safeParseResult("{ \"foo\": true }")
assert.ifError(Result.isErr(t))
assert.equal(Result.Ok(t).foo, true)
assert.end()
})
test("safeParseResult faulty", function (assert) {
var t = safeParseResult("WRONG")
assert.ok(Result.Err(t))
assert.equal(Result.Err(t).message, "Unexpected token W")
assert.end()
})
var test = require("tape")
var Result = require("rust-result")
var safeParse = require("../callback")
var safeParseTuple = require("../tuple")
var safeParseResult = require("../result")
test("safeParse is a function", function (assert) {
assert.equal(typeof safeParse, "function")
assert.end()
})
test("safeParse valid json", function (assert) {
safeParse("{ \"foo\": true }", function (err, json) {
assert.ifError(err)
assert.equal(json.foo, true)
assert.end()
})
})
test("safeParse faulty", function (assert) {
safeParse("WRONG", function (err) {
assert.ok(err)
assert.equal(err.message, "Unexpected token W")
assert.end()
})
})
test("safeParseTuple valid json", function (assert) {
var t = safeParseTuple("{ \"foo\": true }")
assert.ifError(t[0])
assert.equal(t[1].foo, true)
assert.end()
})
test("safeParseTuple faulty", function (assert) {
var t = safeParseTuple("WRONG")
assert.ok(t[0])
assert.equal(t[0].message, "Unexpected token W")
assert.end()
})
test("safeParseResult valid json", function (assert) {
var t = safeParseResult("{ \"foo\": true }")
assert.ifError(Result.isErr(t))
assert.equal(Result.Ok(t).foo, true)
assert.end()
})
test("safeParseResult faulty", function (assert) {
var t = safeParseResult("WRONG")
assert.ok(Result.Err(t))
assert.equal(Result.Err(t).message, "Unexpected token W")
assert.end()
})

View file

@ -1,11 +1,11 @@
<!doctype html>
<html>
<head>
<title>TAPE Example</title>
<script src="/testem.js"></script>
<script src="test-adapter.js"></script>
<script src="bundle.js"></script>
</head>
<body>
</body>
</html>
<!doctype html>
<html>
<head>
<title>TAPE Example</title>
<script src="/testem.js"></script>
<script src="test-adapter.js"></script>
<script src="bundle.js"></script>
</head>
<body>
</body>
</html>

View file

@ -1,49 +1,49 @@
(function () {
var Testem = window.Testem
var regex = /^((?:not )?ok) (\d+) (.+)$/
Testem.useCustomAdapter(tapAdapter)
function tapAdapter(socket){
var results = {
failed: 0
, passed: 0
, total: 0
, tests: []
}
socket.emit('tests-start')
Testem.handleConsoleMessage = function(msg){
var m = msg.match(regex)
if (m) {
var passed = m[1] === 'ok'
var test = {
passed: passed ? 1 : 0,
failed: passed ? 0 : 1,
total: 1,
id: m[2],
name: m[3],
items: []
}
if (passed) {
results.passed++
} else {
results.failed++
}
results.total++
socket.emit('test-result', test)
results.tests.push(test)
} else if (msg === '# ok' || msg.match(/^# tests \d+/)){
socket.emit('all-test-results', results)
}
// return false if you want to prevent the console message from
// going to the console
// return false
}
}
}())
(function () {
var Testem = window.Testem
var regex = /^((?:not )?ok) (\d+) (.+)$/
Testem.useCustomAdapter(tapAdapter)
function tapAdapter(socket){
var results = {
failed: 0
, passed: 0
, total: 0
, tests: []
}
socket.emit('tests-start')
Testem.handleConsoleMessage = function(msg){
var m = msg.match(regex)
if (m) {
var passed = m[1] === 'ok'
var test = {
passed: passed ? 1 : 0,
failed: passed ? 0 : 1,
total: 1,
id: m[2],
name: m[3],
items: []
}
if (passed) {
results.passed++
} else {
results.failed++
}
results.total++
socket.emit('test-result', test)
results.tests.push(test)
} else if (msg === '# ok' || msg.match(/^# tests \d+/)){
socket.emit('all-test-results', results)
}
// return false if you want to prevent the console message from
// going to the console
// return false
}
}
}())

View file

@ -1,14 +1,14 @@
module.exports = SafeParseTuple
function SafeParseTuple(obj, reviver) {
var json
var error = null
try {
json = JSON.parse(obj, reviver)
} catch (err) {
error = err
}
return [error, json]
}
module.exports = SafeParseTuple
function SafeParseTuple(obj, reviver) {
var json
var error = null
try {
json = JSON.parse(obj, reviver)
} catch (err) {
error = err
}
return [error, json]
}