]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/tools/peertube-watch.ts
Support '/w/' and '/w/p/' for watch page
[github/Chocobozzz/PeerTube.git] / server / tools / peertube-watch.ts
index 6d9cfa3b7b3948fac7bd77fef651698c8dd6ce6f..3ca3e242a6dfd19d54609c6a8f76cb9da289934c 100644 (file)
@@ -30,7 +30,7 @@ function run (url: string, options: program.OptionValues) {
 
   const cmd = 'node ' + join(__dirname, 'node_modules', 'webtorrent-hybrid', 'bin', 'cmd.js')
   const args = ` --${options.gui} ` +
-    url.replace('videos/watch', 'download/torrents') +
+    url.replace(/(\/videos\/watch\/)|\/w\//, '/download/torrents/') +
     `-${options.resolution}.torrent`
 
   try {