]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/initializers/constants.ts
Import torrents with webtorrent
[github/Chocobozzz/PeerTube.git] / server / initializers / constants.ts
index 243d544eab47544ab7120c3f4893c39f85bd80bb..cf7cd3d74ee661c99269a6e92558e13c64922362 100644 (file)
@@ -273,6 +273,12 @@ const CONSTRAINTS_FIELDS = {
   VIDEO_IMPORTS: {
     URL: { min: 3, max: 2000 }, // Length
     TORRENT_NAME: { min: 3, max: 255 }, // Length
+    TORRENT_FILE: {
+      EXTNAME: [ '.torrent' ],
+      FILE_SIZE: {
+        max: 1024 * 200 // 200 KB
+      }
+    }
   },
   VIDEOS: {
     NAME: { min: 3, max: 120 }, // Length
@@ -417,6 +423,10 @@ const VIDEO_CAPTIONS_MIMETYPE_EXT = {
   'application/x-subrip': '.srt'
 }
 
+const TORRENT_MIMETYPE_EXT = {
+  'application/x-bittorrent': '.torrent'
+}
+
 // ---------------------------------------------------------------------------
 
 const SERVER_ACTOR_NAME = 'peertube'
@@ -596,6 +606,7 @@ export {
   FEEDS,
   JOB_TTL,
   NSFW_POLICY_TYPES,
+  TORRENT_MIMETYPE_EXT,
   STATIC_MAX_AGE,
   STATIC_PATHS,
   ACTIVITY_PUB,