aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tools/peertube-import-videos.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2021-07-16 09:04:35 +0200
committerChocobozzz <me@florianbigard.com>2021-07-20 15:27:18 +0200
commit89d241a79c262b9775c233b73cff080043ebb5e6 (patch)
treecb3b6cb431d25d891ef4e02f66c61d252d17048f /server/tools/peertube-import-videos.ts
parentd23dd9fbfc4d26026352c10f81d2795ceaf2908a (diff)
downloadPeerTube-89d241a79c262b9775c233b73cff080043ebb5e6.tar.gz
PeerTube-89d241a79c262b9775c233b73cff080043ebb5e6.tar.zst
PeerTube-89d241a79c262b9775c233b73cff080043ebb5e6.zip
Shorter server command names
Diffstat (limited to 'server/tools/peertube-import-videos.ts')
-rw-r--r--server/tools/peertube-import-videos.ts10
1 files changed, 5 insertions, 5 deletions
diff --git a/server/tools/peertube-import-videos.ts b/server/tools/peertube-import-videos.ts
index fc76735b9..caf1facc7 100644
--- a/server/tools/peertube-import-videos.ts
+++ b/server/tools/peertube-import-videos.ts
@@ -150,7 +150,7 @@ async function processVideo (parameters: {
150 } 150 }
151 151
152 const server = buildServer(url) 152 const server = buildServer(url)
153 const { data } = await server.searchCommand.advancedVideoSearch({ 153 const { data } = await server.search.advancedVideoSearch({
154 search: { 154 search: {
155 search: videoInfo.title, 155 search: videoInfo.title,
156 sort: '-match', 156 sort: '-match',
@@ -249,14 +249,14 @@ async function uploadVideoOnPeerTube (parameters: {
249 log.info('\nUploading on PeerTube video "%s".', attributes.name) 249 log.info('\nUploading on PeerTube video "%s".', attributes.name)
250 250
251 try { 251 try {
252 await server.videosCommand.upload({ attributes }) 252 await server.videos.upload({ attributes })
253 } catch (err) { 253 } catch (err) {
254 if (err.message.indexOf('401') !== -1) { 254 if (err.message.indexOf('401') !== -1) {
255 log.info('Got 401 Unauthorized, token may have expired, renewing token and retry.') 255 log.info('Got 401 Unauthorized, token may have expired, renewing token and retry.')
256 256
257 server.accessToken = await server.loginCommand.getAccessToken(username, password) 257 server.accessToken = await server.login.getAccessToken(username, password)
258 258
259 await server.videosCommand.upload({ attributes }) 259 await server.videos.upload({ attributes })
260 } else { 260 } else {
261 exitError(err.message) 261 exitError(err.message)
262 } 262 }
@@ -277,7 +277,7 @@ async function getCategory (server: ServerInfo, categories: string[]) {
277 277
278 if (categoryString === 'News & Politics') return 11 278 if (categoryString === 'News & Politics') return 11
279 279
280 const categoriesServer = await server.videosCommand.getCategories() 280 const categoriesServer = await server.videos.getCategories()
281 281
282 for (const key of Object.keys(categoriesServer)) { 282 for (const key of Object.keys(categoriesServer)) {
283 const categoryServer = categoriesServer[key] 283 const categoryServer = categoriesServer[key]