mirror of https://github.com/Chocobozzz/PeerTube
Server: fix real world tools
parent
1f0f84c27e
commit
3fad43acfb
|
@ -2,7 +2,8 @@
|
||||||
|
|
||||||
const program = require('commander')
|
const program = require('commander')
|
||||||
|
|
||||||
const utils = require('../../api/utils')
|
const utilsClient = require('../../utils/clients')
|
||||||
|
const utilsLogin = require('../../utils/login')
|
||||||
|
|
||||||
program
|
program
|
||||||
.option('-u, --url <url>', 'Server url')
|
.option('-u, --url <url>', 'Server url')
|
||||||
|
@ -30,13 +31,13 @@ const server = {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
utils.getClient(program.url, function (err, res) {
|
utilsClient.getClient(program.url, function (err, res) {
|
||||||
if (err) throw err
|
if (err) throw err
|
||||||
|
|
||||||
server.client.id = res.body.client_id
|
server.client.id = res.body.client_id
|
||||||
server.client.secret = res.body.client_secret
|
server.client.secret = res.body.client_secret
|
||||||
|
|
||||||
utils.loginAndGetAccessToken(server, function (err, accessToken) {
|
utilsLogin.loginAndGetAccessToken(server, function (err, accessToken) {
|
||||||
if (err) throw err
|
if (err) throw err
|
||||||
|
|
||||||
console.log(accessToken)
|
console.log(accessToken)
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
const program = require('commander')
|
const program = require('commander')
|
||||||
const fs = require('fs')
|
const fs = require('fs')
|
||||||
|
|
||||||
const utils = require('../../api/utils')
|
const utils = require('../../utils/videos')
|
||||||
|
|
||||||
program
|
program
|
||||||
.option('-u, --url <url>', 'Server url')
|
.option('-u, --url <url>', 'Server url')
|
||||||
|
|
|
@ -9,7 +9,7 @@ const clientsUtils = {
|
||||||
// ---------------------- Export functions --------------------
|
// ---------------------- Export functions --------------------
|
||||||
|
|
||||||
function getClient (url, end) {
|
function getClient (url, end) {
|
||||||
const path = '/api/v1/users/client'
|
const path = '/api/v1/clients/local'
|
||||||
|
|
||||||
request(url)
|
request(url)
|
||||||
.get(path)
|
.get(path)
|
||||||
|
|
Loading…
Reference in New Issue