+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/VideoUploadResponse'
+ requestBody:
+ content:
+ multipart/form-data:
+ schema:
+ type: object
+ properties:
+ videofile:
+ description: Video file
+ type: string
+ format: binary
+ channelId:
+ description: Channel id that will contain this video
+ type: number
+ thumbnailfile:
+ description: Video thumbnail file
+ type: string
+ previewfile:
+ description: Video preview file
+ type: string
+ privacy:
+ $ref: '#/components/schemas/VideoPrivacySet'
+ category:
+ description: Video category
+ type: string
+ licence:
+ description: Video licence
+ type: string
+ language:
+ description: Video language
+ type: string
+ description:
+ description: Video description
+ type: string
+ waitTranscoding:
+ description: Whether or not we wait transcoding before publish the video
+ type: string
+ support:
+ description: Text describing how to support the video uploader
+ type: string
+ nsfw:
+ description: Whether or not this video contains sensitive content
+ type: string
+ name:
+ description: Video name
+ type: string
+ tags:
+ description: Video tags (maximum 5 tags each between 2 and 30 characters)
+ type: array
+ minItems: 1
+ maxItems: 5
+ items:
+ type: string
+ minLength: 2
+ maxLength: 30
+ commentsEnabled:
+ description: Enable or disable comments for this video
+ type: string
+ originallyPublishedAt:
+ description: Date when the content was originally published
+ type: string
+ format: date-time
+ scheduleUpdate:
+ $ref: '#/components/schemas/VideoScheduledUpdate'
+ required:
+ - videofile
+ - channelId
+ - name
+ x-code-samples:
+ - lang: Shell
+ source: |
+ ## DEPENDENCIES: httpie, jq
+ # pip install httpie
+ USERNAME="<your_username>"
+ PASSWORD="<your_password>"
+ FILE_PATH="<your_file_path>"
+ CHANNEL_ID="<your_channel_id>"
+ NAME="<video_name>"
+
+ API_PATH="https://peertube2.cpy.re/api/v1"
+ ## AUTH
+ client_id=$(http -b GET "$API_PATH/oauth-clients/local" | jq -r ".client_id")
+ client_secret=$(http -b GET "$API_PATH/oauth-clients/local" | jq -r ".client_secret")
+ token=$(http -b --form POST "$API_PATH/users/token" \
+ client_id="$client_id" client_secret="$client_secret" grant_type=password response_type=code \
+ username=$USERNAME \
+ password=$PASSWORD \
+ | jq -r ".access_token")
+ ## VIDEO UPLOAD
+ http -b --form POST "$API_PATH/videos/upload" \
+ videofile@$FILE_PATH \
+ channelId=$CHANNEL_ID \
+ name=$NAME \
+ "Authorization:Bearer $token"
+ /videos/imports:
+ post:
+ summary: Import a torrent or magnetURI or HTTP resource (if enabled by the instance administrator)
+ security:
+ - OAuth2: []
+ tags:
+ - Video
+ responses:
+ '200':
+ description: successful operation
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/VideoUploadResponse'
+ requestBody:
+ content:
+ multipart/form-data:
+ schema:
+ type: object
+ properties:
+ torrentfile:
+ description: Torrent File
+ type: string
+ format: binary
+ targetUrl:
+ description: HTTP target URL
+ type: string
+ magnetUri:
+ description: Magnet URI
+ type: string
+ channelId:
+ description: Channel id that will contain this video
+ type: number
+ thumbnailfile:
+ description: Video thumbnail file
+ type: string
+ previewfile:
+ description: Video preview file
+ type: string
+ privacy:
+ $ref: '#/components/schemas/VideoPrivacySet'
+ category:
+ description: Video category
+ type: string
+ licence:
+ description: Video licence
+ type: string
+ language:
+ description: Video language
+ type: string
+ description:
+ description: Video description
+ type: string
+ waitTranscoding:
+ description: Whether or not we wait transcoding before publish the video
+ type: string
+ support:
+ description: Text describing how to support the video uploader
+ type: string
+ nsfw:
+ description: Whether or not this video contains sensitive content
+ type: string
+ name:
+ description: Video name
+ type: string
+ tags:
+ description: Video tags (maximum 5 tags each between 2 and 30 characters)
+ type: array
+ minItems: 1
+ maxItems: 5
+ items:
+ type: string
+ minLength: 2
+ maxLength: 30
+ commentsEnabled:
+ description: Enable or disable comments for this video
+ type: string
+ scheduleUpdate:
+ $ref: '#/components/schemas/VideoScheduledUpdate'
+ required:
+ - channelId
+ - name