aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tools/peertube-watch.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2021-09-10 15:05:53 +0200
committerChocobozzz <me@florianbigard.com>2021-09-10 15:06:57 +0200
commit624e42fdf9456816f92000e632d01390f3b5c840 (patch)
tree83cadd83bbf6cf393bf570d9947ad0469083a42e /server/tools/peertube-watch.ts
parente367da949bb97c3db8c2f9a28ea09eef93abb2f5 (diff)
downloadPeerTube-624e42fdf9456816f92000e632d01390f3b5c840.tar.gz
PeerTube-624e42fdf9456816f92000e632d01390f3b5c840.tar.zst
PeerTube-624e42fdf9456816f92000e632d01390f3b5c840.zip
Remove peertube watch and peertube repl
I don't have time to maintain these scripts that cause some install issues/maintenance difficulties
Diffstat (limited to 'server/tools/peertube-watch.ts')
-rw-r--r--server/tools/peertube-watch.ts42
1 files changed, 0 insertions, 42 deletions
diff --git a/server/tools/peertube-watch.ts b/server/tools/peertube-watch.ts
deleted file mode 100644
index 892c9e7a6..000000000
--- a/server/tools/peertube-watch.ts
+++ /dev/null
@@ -1,42 +0,0 @@
1import { registerTSPaths } from '../helpers/register-ts-paths'
2registerTSPaths()
3
4import { program, Option, OptionValues } from 'commander'
5import { join } from 'path'
6import { execSync } from 'child_process'
7
8program
9 .name('watch')
10 .arguments('<url>')
11 .addOption(
12 new Option('-g, --gui <player>', 'player type')
13 .default('vlc')
14 .choices([ 'airplay', 'stdout', 'chromecast', 'mpv', 'vlc', 'mplayer', 'xbmc' ])
15 )
16 .option('-r, --resolution <res>', 'video resolution', '480')
17 .addHelpText('after', '\n\n Examples:\n\n' +
18 ' $ peertube watch -g mpv https://peertube.cpy.re/videos/watch/e8a1af4e-414a-4d58-bfe6-2146eed06d10\n' +
19 ' $ peertube watch --gui stdout https://peertube.cpy.re/videos/watch/e8a1af4e-414a-4d58-bfe6-2146eed06d10\n' +
20 ' $ peertube watch https://peertube.cpy.re/videos/watch/e8a1af4e-414a-4d58-bfe6-2146eed06d10\n'
21 )
22 .action((url, options) => run(url, options))
23 .parse(process.argv)
24
25function run (url: string, options: OptionValues) {
26 if (!url) {
27 console.error('<url> positional argument is required.')
28 process.exit(-1)
29 }
30
31 const cmd = 'node ' + join(__dirname, 'node_modules', 'webtorrent-hybrid', 'bin', 'cmd.js')
32 const args = ` --${options.gui} ` +
33 url.replace(/(\/videos\/watch\/)|\/w\//, '/download/torrents/') +
34 `-${options.resolution}.torrent`
35
36 try {
37 execSync(cmd + args)
38 } catch (err) {
39 console.error('Cannto exec command.', err)
40 process.exit(-1)
41 }
42}