mirror of
https://github.com/Tzahi12345/YoutubeDL-Material.git
synced 2026-04-07 06:41:28 +03:00
Generate types from OpenAPI
This commit is contained in:
3
.gitignore
vendored
3
.gitignore
vendored
@@ -55,6 +55,7 @@ backend/subscriptions/playlists/*
|
|||||||
backend/subscriptions/archives/*
|
backend/subscriptions/archives/*
|
||||||
backend/*.exe
|
backend/*.exe
|
||||||
src/assets/default.json
|
src/assets/default.json
|
||||||
|
src/api-types
|
||||||
backend/appdata/db.json
|
backend/appdata/db.json
|
||||||
backend/appdata/archives/archive_audio.txt
|
backend/appdata/archives/archive_audio.txt
|
||||||
backend/appdata/archives/archive_video.txt
|
backend/appdata/archives/archive_video.txt
|
||||||
@@ -65,4 +66,4 @@ backend/appdata/logs/error.log
|
|||||||
backend/appdata/users.json
|
backend/appdata/users.json
|
||||||
backend/users/*
|
backend/users/*
|
||||||
backend/appdata/cookies.txt
|
backend/appdata/cookies.txt
|
||||||
backend/public
|
backend/public
|
||||||
|
|||||||
@@ -21,14 +21,16 @@ paths:
|
|||||||
content:
|
content:
|
||||||
application/json:
|
application/json:
|
||||||
schema:
|
schema:
|
||||||
$ref: '#/components/schemas/body'
|
$ref: '#/components/schemas/Mp3DownloadRequest'
|
||||||
responses:
|
responses:
|
||||||
'200':
|
'200':
|
||||||
description: OK
|
description: OK
|
||||||
content:
|
content:
|
||||||
application/json:
|
application/json:
|
||||||
schema:
|
schema:
|
||||||
$ref: '#/components/schemas/inline_response_200'
|
$ref: '#/components/schemas/Mp3DownloadResponse'
|
||||||
|
'500':
|
||||||
|
description: Server download error
|
||||||
security:
|
security:
|
||||||
- Auth query parameter: []
|
- Auth query parameter: []
|
||||||
/api/tomp4:
|
/api/tomp4:
|
||||||
@@ -46,14 +48,16 @@ paths:
|
|||||||
content:
|
content:
|
||||||
application/json:
|
application/json:
|
||||||
schema:
|
schema:
|
||||||
$ref: '#/components/schemas/body_1'
|
$ref: '#/components/schemas/Mp4DownloadRequest'
|
||||||
responses:
|
responses:
|
||||||
'200':
|
'200':
|
||||||
description: OK
|
description: OK
|
||||||
content:
|
content:
|
||||||
application/json:
|
application/json:
|
||||||
schema:
|
schema:
|
||||||
$ref: '#/components/schemas/inline_response_200_1'
|
$ref: '#/components/schemas/Mp4DownloadResponse'
|
||||||
|
'500':
|
||||||
|
description: Server download error
|
||||||
security:
|
security:
|
||||||
- Auth query parameter: []
|
- Auth query parameter: []
|
||||||
/api/getMp3s:
|
/api/getMp3s:
|
||||||
@@ -69,8 +73,7 @@ paths:
|
|||||||
content:
|
content:
|
||||||
application/json:
|
application/json:
|
||||||
schema:
|
schema:
|
||||||
$ref: '#/components/schemas/inline_response_200_2'
|
$ref: '#/components/schemas/GetMp3sResponse'
|
||||||
requestBody: {}
|
|
||||||
security:
|
security:
|
||||||
- Auth query parameter: []
|
- Auth query parameter: []
|
||||||
/api/getMp4s:
|
/api/getMp4s:
|
||||||
@@ -86,7 +89,23 @@ paths:
|
|||||||
content:
|
content:
|
||||||
application/json:
|
application/json:
|
||||||
schema:
|
schema:
|
||||||
$ref: '#/components/schemas/inline_response_200_3'
|
$ref: '#/components/schemas/GetMp4sResponse'
|
||||||
|
security:
|
||||||
|
- Auth query parameter: []
|
||||||
|
/api/getAllFiles:
|
||||||
|
post:
|
||||||
|
tags:
|
||||||
|
- files
|
||||||
|
summary: Get all files
|
||||||
|
description: Gets all files and playlists stored in the db
|
||||||
|
operationId: get-getAllFiles
|
||||||
|
responses:
|
||||||
|
'200':
|
||||||
|
description: OK
|
||||||
|
content:
|
||||||
|
application/json:
|
||||||
|
schema:
|
||||||
|
$ref: '#/components/schemas/GetAllFilesResponse'
|
||||||
security:
|
security:
|
||||||
- Auth query parameter: []
|
- Auth query parameter: []
|
||||||
/api/getFile:
|
/api/getFile:
|
||||||
@@ -100,14 +119,14 @@ paths:
|
|||||||
content:
|
content:
|
||||||
application/json:
|
application/json:
|
||||||
schema:
|
schema:
|
||||||
$ref: '#/components/schemas/body_2'
|
$ref: '#/components/schemas/GetFileRequest'
|
||||||
responses:
|
responses:
|
||||||
'200':
|
'200':
|
||||||
description: OK
|
description: OK
|
||||||
content:
|
content:
|
||||||
application/json:
|
application/json:
|
||||||
schema:
|
schema:
|
||||||
$ref: '#/components/schemas/inline_response_200_4'
|
$ref: '#/components/schemas/GetFileResponse'
|
||||||
security:
|
security:
|
||||||
- Auth query parameter: []
|
- Auth query parameter: []
|
||||||
/api/enableSharing:
|
/api/enableSharing:
|
||||||
@@ -122,7 +141,7 @@ paths:
|
|||||||
content:
|
content:
|
||||||
application/json:
|
application/json:
|
||||||
schema:
|
schema:
|
||||||
$ref: '#/components/schemas/body_3'
|
$ref: '#/components/schemas/SharingToggle'
|
||||||
responses:
|
responses:
|
||||||
'200':
|
'200':
|
||||||
description: OK
|
description: OK
|
||||||
@@ -144,7 +163,7 @@ paths:
|
|||||||
content:
|
content:
|
||||||
application/json:
|
application/json:
|
||||||
schema:
|
schema:
|
||||||
$ref: '#/components/schemas/body_4'
|
$ref: '#/components/schemas/SharingToggle'
|
||||||
responses:
|
responses:
|
||||||
'200':
|
'200':
|
||||||
description: OK
|
description: OK
|
||||||
@@ -718,7 +737,7 @@ paths:
|
|||||||
type: object
|
type: object
|
||||||
properties:
|
properties:
|
||||||
user:
|
user:
|
||||||
$ref: '#/components/schemas/user'
|
$ref: '#/components/schemas/User'
|
||||||
token:
|
token:
|
||||||
type: string
|
type: string
|
||||||
permissions:
|
permissions:
|
||||||
@@ -761,7 +780,7 @@ paths:
|
|||||||
type: object
|
type: object
|
||||||
properties:
|
properties:
|
||||||
user:
|
user:
|
||||||
$ref: '#/components/schemas/user'
|
$ref: '#/components/schemas/User'
|
||||||
description: Use this endpoint to register a user. It will only work if registration is enabled.
|
description: Use this endpoint to register a user. It will only work if registration is enabled.
|
||||||
requestBody:
|
requestBody:
|
||||||
content:
|
content:
|
||||||
@@ -958,7 +977,7 @@ paths:
|
|||||||
users:
|
users:
|
||||||
type: array
|
type: array
|
||||||
items:
|
items:
|
||||||
$ref: '#/components/schemas/user'
|
$ref: '#/components/schemas/User'
|
||||||
description: 'Gets all users, returns a list of the user objects including their user permissions, videos, playlists, subscriptions, etc.'
|
description: 'Gets all users, returns a list of the user objects including their user permissions, videos, playlists, subscriptions, etc.'
|
||||||
security:
|
security:
|
||||||
- Auth query parameter: []
|
- Auth query parameter: []
|
||||||
@@ -966,7 +985,12 @@ paths:
|
|||||||
- multi-user mode
|
- multi-user mode
|
||||||
components:
|
components:
|
||||||
schemas:
|
schemas:
|
||||||
body:
|
FileType:
|
||||||
|
type: string
|
||||||
|
enum:
|
||||||
|
- audio
|
||||||
|
- video
|
||||||
|
BaseDownloadRequest:
|
||||||
required:
|
required:
|
||||||
- url
|
- url
|
||||||
type: object
|
type: object
|
||||||
@@ -975,64 +999,72 @@ components:
|
|||||||
type: string
|
type: string
|
||||||
customQualityConfiguration:
|
customQualityConfiguration:
|
||||||
type: string
|
type: string
|
||||||
|
description: Video format code. Overrides other quality options.
|
||||||
example: '251'
|
example: '251'
|
||||||
maxBitrate:
|
|
||||||
type: string
|
|
||||||
example: '160'
|
|
||||||
customArgs:
|
customArgs:
|
||||||
type: string
|
type: string
|
||||||
|
description: Custom command-line arguments for youtubedl. Overrides all other options, except url.
|
||||||
customOutput:
|
customOutput:
|
||||||
type: string
|
type: string
|
||||||
|
description: Custom output filename template.
|
||||||
youtubeUsername:
|
youtubeUsername:
|
||||||
type: string
|
type: string
|
||||||
|
description: Login with this account ID
|
||||||
youtubePassword:
|
youtubePassword:
|
||||||
type: string
|
type: string
|
||||||
inline_response_200:
|
description: Account password
|
||||||
|
ui_uid:
|
||||||
|
type: string
|
||||||
|
nullable: true
|
||||||
|
Mp3DownloadRequest:
|
||||||
|
allOf:
|
||||||
|
- $ref: '#/components/schemas/BaseDownloadRequest'
|
||||||
|
- type: object
|
||||||
|
properties:
|
||||||
|
maxBitrate:
|
||||||
|
type: string
|
||||||
|
description: Specify ffmpeg/avconv audio quality
|
||||||
|
example: '160'
|
||||||
|
Mp4DownloadRequest:
|
||||||
|
allOf:
|
||||||
|
- $ref: '#/components/schemas/BaseDownloadRequest'
|
||||||
|
- type: object
|
||||||
|
properties:
|
||||||
|
selectedHeight:
|
||||||
|
type: string
|
||||||
|
description: Height of the video, if known
|
||||||
|
example: '1080'
|
||||||
|
BaseDownloadResponse:
|
||||||
required:
|
required:
|
||||||
- audiopathEncoded
|
|
||||||
- uid
|
- uid
|
||||||
type: object
|
type: object
|
||||||
properties:
|
properties:
|
||||||
uid:
|
uid:
|
||||||
type: string
|
type: string
|
||||||
file_names:
|
file_names:
|
||||||
type: string
|
nullable: true
|
||||||
audiopathEncoded:
|
type: array
|
||||||
type: string
|
items:
|
||||||
body_1:
|
type: string
|
||||||
required:
|
Mp3DownloadResponse:
|
||||||
- url
|
allOf:
|
||||||
type: object
|
- $ref: '#/components/schemas/BaseDownloadResponse'
|
||||||
properties:
|
- type: object
|
||||||
url:
|
required:
|
||||||
type: string
|
- audiopathEncoded
|
||||||
customQualityConfiguration:
|
properties:
|
||||||
type: string
|
audiopathEncoded:
|
||||||
example: 242+251
|
type: string
|
||||||
selectedHeight:
|
Mp4DownloadResponse:
|
||||||
type: string
|
allOf:
|
||||||
example: '1080'
|
- $ref: '#/components/schemas/BaseDownloadResponse'
|
||||||
customArgs:
|
- type: object
|
||||||
type: string
|
required:
|
||||||
customOutput:
|
- videopathEncoded
|
||||||
type: string
|
properties:
|
||||||
youtubeUsername:
|
videopathEncoded:
|
||||||
type: string
|
type: string
|
||||||
youtubePassword:
|
GetMp3sResponse:
|
||||||
type: string
|
|
||||||
inline_response_200_1:
|
|
||||||
required:
|
|
||||||
- uid
|
|
||||||
- videopathEncoded
|
|
||||||
type: object
|
|
||||||
properties:
|
|
||||||
uid:
|
|
||||||
type: string
|
|
||||||
file_names:
|
|
||||||
type: string
|
|
||||||
videopathEncoded:
|
|
||||||
type: string
|
|
||||||
inline_response_200_2:
|
|
||||||
required:
|
required:
|
||||||
- mp3s
|
- mp3s
|
||||||
- playlists
|
- playlists
|
||||||
@@ -1041,48 +1073,66 @@ components:
|
|||||||
mp3s:
|
mp3s:
|
||||||
type: array
|
type: array
|
||||||
items:
|
items:
|
||||||
$ref: '#/components/schemas/inline_response_200_2_mp3s'
|
$ref: '#/components/schemas/DatabaseFile'
|
||||||
playlists:
|
playlists:
|
||||||
type: array
|
type: array
|
||||||
description: All audio playlists
|
description: All audio playlists
|
||||||
items:
|
items:
|
||||||
$ref: '#/components/schemas/inline_response_200_2_playlists'
|
$ref: '#/components/schemas/Playlist'
|
||||||
inline_response_200_3:
|
GetMp4sResponse:
|
||||||
required:
|
required:
|
||||||
- mp4s
|
- mp4s
|
||||||
|
- playlists
|
||||||
type: object
|
type: object
|
||||||
properties:
|
properties:
|
||||||
mp4s:
|
mp4s:
|
||||||
type: array
|
type: array
|
||||||
items:
|
items:
|
||||||
$ref: '#/components/schemas/inline_response_200_3_mp4s'
|
$ref: '#/components/schemas/DatabaseFile'
|
||||||
playlists:
|
playlists:
|
||||||
type: array
|
type: array
|
||||||
description: All video playlists
|
description: All video playlists
|
||||||
items:
|
items:
|
||||||
type: object
|
$ref: '#/components/schemas/Playlist'
|
||||||
body_2:
|
GetAllFilesResponse:
|
||||||
|
required:
|
||||||
|
- files
|
||||||
|
- playlists
|
||||||
|
type: object
|
||||||
|
properties:
|
||||||
|
files:
|
||||||
|
type: array
|
||||||
|
items:
|
||||||
|
$ref: '#/components/schemas/DatabaseFile'
|
||||||
|
playlists:
|
||||||
|
type: array
|
||||||
|
description: All video playlists
|
||||||
|
items:
|
||||||
|
$ref: '#/components/schemas/Playlist'
|
||||||
|
GetFileRequest:
|
||||||
required:
|
required:
|
||||||
- uid
|
- uid
|
||||||
type: object
|
type: object
|
||||||
properties:
|
properties:
|
||||||
uid:
|
uid:
|
||||||
type: string
|
type: string
|
||||||
|
description: Video UID
|
||||||
type:
|
type:
|
||||||
|
$ref: '#/components/schemas/FileType'
|
||||||
|
uuid:
|
||||||
type: string
|
type: string
|
||||||
inline_response_200_4:
|
description: User UID
|
||||||
|
GetFileResponse:
|
||||||
required:
|
required:
|
||||||
- file
|
|
||||||
- success
|
- success
|
||||||
type: object
|
type: object
|
||||||
properties:
|
properties:
|
||||||
success:
|
success:
|
||||||
type: string
|
type: boolean
|
||||||
file:
|
file:
|
||||||
$ref: '#/components/schemas/inline_response_200_2_mp3s'
|
$ref: '#/components/schemas/DatabaseFile'
|
||||||
body_3:
|
SharingToggle:
|
||||||
required:
|
required:
|
||||||
- is_playlist
|
|
||||||
- type
|
- type
|
||||||
- uid
|
- uid
|
||||||
type: object
|
type: object
|
||||||
@@ -1090,7 +1140,7 @@ components:
|
|||||||
uid:
|
uid:
|
||||||
type: string
|
type: string
|
||||||
type:
|
type:
|
||||||
type: string
|
$ref: '#/components/schemas/FileType'
|
||||||
is_playlist:
|
is_playlist:
|
||||||
type: boolean
|
type: boolean
|
||||||
inline_response_200_5:
|
inline_response_200_5:
|
||||||
@@ -1100,19 +1150,6 @@ components:
|
|||||||
properties:
|
properties:
|
||||||
success:
|
success:
|
||||||
type: boolean
|
type: boolean
|
||||||
body_4:
|
|
||||||
required:
|
|
||||||
- type
|
|
||||||
- uid
|
|
||||||
type: object
|
|
||||||
properties:
|
|
||||||
type:
|
|
||||||
type: string
|
|
||||||
uid:
|
|
||||||
type: string
|
|
||||||
description: uid is either the video uid or the playlist ID
|
|
||||||
is_playlist:
|
|
||||||
type: boolean
|
|
||||||
body_5:
|
body_5:
|
||||||
required:
|
required:
|
||||||
- url
|
- url
|
||||||
@@ -1303,7 +1340,7 @@ components:
|
|||||||
type: object
|
type: object
|
||||||
properties:
|
properties:
|
||||||
playlist:
|
playlist:
|
||||||
$ref: '#/components/schemas/inline_response_200_2_playlists'
|
$ref: '#/components/schemas/Playlist'
|
||||||
type:
|
type:
|
||||||
type: string
|
type: string
|
||||||
success:
|
success:
|
||||||
@@ -1457,7 +1494,7 @@ components:
|
|||||||
properties:
|
properties:
|
||||||
new_config_file:
|
new_config_file:
|
||||||
type: object
|
type: object
|
||||||
inline_response_200_2_mp3s:
|
DatabaseFile:
|
||||||
required:
|
required:
|
||||||
- duration
|
- duration
|
||||||
- id
|
- id
|
||||||
@@ -1497,7 +1534,7 @@ components:
|
|||||||
type: string
|
type: string
|
||||||
sharingEnabled:
|
sharingEnabled:
|
||||||
type: boolean
|
type: boolean
|
||||||
inline_response_200_2_playlists:
|
Playlist:
|
||||||
required:
|
required:
|
||||||
- fileNames
|
- fileNames
|
||||||
- id
|
- id
|
||||||
@@ -1515,45 +1552,6 @@ components:
|
|||||||
type: string
|
type: string
|
||||||
thumbnailURL:
|
thumbnailURL:
|
||||||
type: string
|
type: string
|
||||||
inline_response_200_3_mp4s:
|
|
||||||
required:
|
|
||||||
- duration
|
|
||||||
- id
|
|
||||||
- isAudio
|
|
||||||
- path
|
|
||||||
- size
|
|
||||||
- thumbnailURL
|
|
||||||
- title
|
|
||||||
- uid
|
|
||||||
- upload_date
|
|
||||||
- uploader
|
|
||||||
- url
|
|
||||||
type: object
|
|
||||||
properties:
|
|
||||||
id:
|
|
||||||
type: string
|
|
||||||
title:
|
|
||||||
type: string
|
|
||||||
thumbnailURL:
|
|
||||||
type: string
|
|
||||||
isAudio:
|
|
||||||
type: boolean
|
|
||||||
duration:
|
|
||||||
type: number
|
|
||||||
url:
|
|
||||||
type: string
|
|
||||||
uploader:
|
|
||||||
type: string
|
|
||||||
size:
|
|
||||||
type: number
|
|
||||||
path:
|
|
||||||
type: string
|
|
||||||
upload_date:
|
|
||||||
type: string
|
|
||||||
uid:
|
|
||||||
type: string
|
|
||||||
sharingEnabled:
|
|
||||||
type: boolean
|
|
||||||
inline_response_200_6_new_sub:
|
inline_response_200_6_new_sub:
|
||||||
required:
|
required:
|
||||||
- id
|
- id
|
||||||
@@ -1633,7 +1631,7 @@ components:
|
|||||||
type: string
|
type: string
|
||||||
type:
|
type:
|
||||||
type: string
|
type: string
|
||||||
user:
|
User:
|
||||||
title: user
|
title: user
|
||||||
type: object
|
type: object
|
||||||
properties:
|
properties:
|
||||||
|
|||||||
97
package-lock.json
generated
97
package-lock.json
generated
@@ -9618,6 +9618,76 @@
|
|||||||
"is-wsl": "^2.1.1"
|
"is-wsl": "^2.1.1"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"openapi-typescript-codegen": {
|
||||||
|
"version": "0.4.11",
|
||||||
|
"resolved": "https://registry.npmjs.org/openapi-typescript-codegen/-/openapi-typescript-codegen-0.4.11.tgz",
|
||||||
|
"integrity": "sha512-KWhJE4xlFXDd7sNyEiJeUx7+H1hqQ+WETzwrcXCE+CNR+pmfKkOH87fjPRUPu1TY3hSgDgZ6ex7F3lWLbirvMQ==",
|
||||||
|
"dev": true,
|
||||||
|
"requires": {
|
||||||
|
"camelcase": "6.0.0",
|
||||||
|
"commander": "6.1.0",
|
||||||
|
"handlebars": "4.7.6",
|
||||||
|
"js-yaml": "3.14.0",
|
||||||
|
"mkdirp": "1.0.4",
|
||||||
|
"path": "0.12.7",
|
||||||
|
"rimraf": "3.0.2"
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"camelcase": {
|
||||||
|
"version": "6.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/camelcase/-/camelcase-6.0.0.tgz",
|
||||||
|
"integrity": "sha512-8KMDF1Vz2gzOq54ONPJS65IvTUaB1cHJ2DMM7MbPmLZljDH1qpzzLsWdiN9pHh6qvkRVDTi/07+eNGch/oLU4w==",
|
||||||
|
"dev": true
|
||||||
|
},
|
||||||
|
"commander": {
|
||||||
|
"version": "6.1.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/commander/-/commander-6.1.0.tgz",
|
||||||
|
"integrity": "sha512-wl7PNrYWd2y5mp1OK/LhTlv8Ff4kQJQRXXAvF+uU/TPNiVJUxZLRYGj/B0y/lPGAVcSbJqH2Za/cvHmrPMC8mA==",
|
||||||
|
"dev": true
|
||||||
|
},
|
||||||
|
"handlebars": {
|
||||||
|
"version": "4.7.6",
|
||||||
|
"resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.7.6.tgz",
|
||||||
|
"integrity": "sha512-1f2BACcBfiwAfStCKZNrUCgqNZkGsAT7UM3kkYtXuLo0KnaVfjKOyf7PRzB6++aK9STyT1Pd2ZCPe3EGOXleXA==",
|
||||||
|
"dev": true,
|
||||||
|
"requires": {
|
||||||
|
"minimist": "^1.2.5",
|
||||||
|
"neo-async": "^2.6.0",
|
||||||
|
"source-map": "^0.6.1",
|
||||||
|
"uglify-js": "^3.1.4",
|
||||||
|
"wordwrap": "^1.0.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"js-yaml": {
|
||||||
|
"version": "3.14.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.0.tgz",
|
||||||
|
"integrity": "sha512-/4IbIeHcD9VMHFqDR/gQ7EdZdLimOvW2DdcxFjdyyZ9NsbS+ccrXqVWDtab/lRl5AlUqmpBx8EhPaWR+OtY17A==",
|
||||||
|
"dev": true,
|
||||||
|
"requires": {
|
||||||
|
"argparse": "^1.0.7",
|
||||||
|
"esprima": "^4.0.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"mkdirp": {
|
||||||
|
"version": "1.0.4",
|
||||||
|
"resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz",
|
||||||
|
"integrity": "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==",
|
||||||
|
"dev": true
|
||||||
|
},
|
||||||
|
"source-map": {
|
||||||
|
"version": "0.6.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz",
|
||||||
|
"integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==",
|
||||||
|
"dev": true
|
||||||
|
},
|
||||||
|
"wordwrap": {
|
||||||
|
"version": "1.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-1.0.0.tgz",
|
||||||
|
"integrity": "sha1-J1hIEIkUVqQXHI0CJkQa3pDLyus=",
|
||||||
|
"dev": true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
"opn": {
|
"opn": {
|
||||||
"version": "5.5.0",
|
"version": "5.5.0",
|
||||||
"resolved": "https://registry.npmjs.org/opn/-/opn-5.5.0.tgz",
|
"resolved": "https://registry.npmjs.org/opn/-/opn-5.5.0.tgz",
|
||||||
@@ -10048,6 +10118,33 @@
|
|||||||
"integrity": "sha1-s2PlXoAGym/iF4TS2yK9FdeRfxQ=",
|
"integrity": "sha1-s2PlXoAGym/iF4TS2yK9FdeRfxQ=",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
|
"path": {
|
||||||
|
"version": "0.12.7",
|
||||||
|
"resolved": "https://registry.npmjs.org/path/-/path-0.12.7.tgz",
|
||||||
|
"integrity": "sha1-1NwqUGxM4hl+tIHr/NWzbAFAsQ8=",
|
||||||
|
"dev": true,
|
||||||
|
"requires": {
|
||||||
|
"process": "^0.11.1",
|
||||||
|
"util": "^0.10.3"
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"inherits": {
|
||||||
|
"version": "2.0.3",
|
||||||
|
"resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz",
|
||||||
|
"integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=",
|
||||||
|
"dev": true
|
||||||
|
},
|
||||||
|
"util": {
|
||||||
|
"version": "0.10.4",
|
||||||
|
"resolved": "https://registry.npmjs.org/util/-/util-0.10.4.tgz",
|
||||||
|
"integrity": "sha512-0Pm9hTQ3se5ll1XihRic3FDIku70C+iHUdT/W926rSgHV5QgXsYbKZN8MSC3tJtSkhuROzvsQjAaFENRXr+19A==",
|
||||||
|
"dev": true,
|
||||||
|
"requires": {
|
||||||
|
"inherits": "2.0.3"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
"path-browserify": {
|
"path-browserify": {
|
||||||
"version": "0.0.1",
|
"version": "0.0.1",
|
||||||
"resolved": "https://registry.npmjs.org/path-browserify/-/path-browserify-0.0.1.tgz",
|
"resolved": "https://registry.npmjs.org/path-browserify/-/path-browserify-0.0.1.tgz",
|
||||||
|
|||||||
@@ -10,7 +10,9 @@
|
|||||||
"test": "ng test",
|
"test": "ng test",
|
||||||
"lint": "ng lint",
|
"lint": "ng lint",
|
||||||
"e2e": "ng e2e",
|
"e2e": "ng e2e",
|
||||||
"electron": "ng build --base-href ./ && electron ."
|
"electron": "ng build --base-href ./ && electron .",
|
||||||
|
"generate": "openapi --input ./\"Public API v1.yaml\" --output ./src/api-types --exportCore false --exportServices false --exportModels true",
|
||||||
|
"prepare": "npm run generate"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": "12.3.1",
|
"node": "12.3.1",
|
||||||
@@ -66,6 +68,7 @@
|
|||||||
"karma-coverage-istanbul-reporter": "^1.2.1",
|
"karma-coverage-istanbul-reporter": "^1.2.1",
|
||||||
"karma-jasmine": "~1.1.0",
|
"karma-jasmine": "~1.1.0",
|
||||||
"karma-jasmine-html-reporter": "^0.2.2",
|
"karma-jasmine-html-reporter": "^0.2.2",
|
||||||
|
"openapi-typescript-codegen": "^0.4.11",
|
||||||
"protractor": "~5.1.2",
|
"protractor": "~5.1.2",
|
||||||
"ts-node": "~3.0.4",
|
"ts-node": "~3.0.4",
|
||||||
"tslint": "~5.3.2"
|
"tslint": "~5.3.2"
|
||||||
|
|||||||
@@ -63,7 +63,7 @@ export class MainComponent implements OnInit {
|
|||||||
youtubeUsername = null;
|
youtubeUsername = null;
|
||||||
youtubePassword = null;
|
youtubePassword = null;
|
||||||
urlError = false;
|
urlError = false;
|
||||||
path = '';
|
path: string | string[] = '';
|
||||||
url = '';
|
url = '';
|
||||||
exists = '';
|
exists = '';
|
||||||
percentDownloaded: number;
|
percentDownloaded: number;
|
||||||
|
|||||||
@@ -8,9 +8,9 @@ import { THEMES_CONFIG } from '../themes';
|
|||||||
import { Router, CanActivate } from '@angular/router';
|
import { Router, CanActivate } from '@angular/router';
|
||||||
import { DOCUMENT } from '@angular/common';
|
import { DOCUMENT } from '@angular/common';
|
||||||
import { BehaviorSubject } from 'rxjs';
|
import { BehaviorSubject } from 'rxjs';
|
||||||
import { v4 as uuid } from 'uuid';
|
|
||||||
import { MatSnackBar } from '@angular/material/snack-bar';
|
import { MatSnackBar } from '@angular/material/snack-bar';
|
||||||
import * as Fingerprint2 from 'fingerprintjs2';
|
import * as Fingerprint2 from 'fingerprintjs2';
|
||||||
|
import type { FileType, GetAllFilesResponse, GetFileRequest, GetFileResponse, GetMp3sResponse, GetMp4sResponse, Mp3DownloadRequest, Mp3DownloadResponse, Mp4DownloadRequest, Mp4DownloadResponse } from 'api-types';
|
||||||
|
|
||||||
@Injectable()
|
@Injectable()
|
||||||
export class PostsService implements CanActivate {
|
export class PostsService implements CanActivate {
|
||||||
@@ -25,7 +25,9 @@ export class PostsService implements CanActivate {
|
|||||||
// auth
|
// auth
|
||||||
auth_token = '4241b401-7236-493e-92b5-b72696b9d853';
|
auth_token = '4241b401-7236-493e-92b5-b72696b9d853';
|
||||||
session_id = null;
|
session_id = null;
|
||||||
httpOptions = null;
|
httpOptions: {
|
||||||
|
params: HttpParams
|
||||||
|
};
|
||||||
http_params: string = null;
|
http_params: string = null;
|
||||||
unauthorized = false;
|
unauthorized = false;
|
||||||
|
|
||||||
@@ -155,27 +157,29 @@ export class PostsService implements CanActivate {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// tslint:disable-next-line: max-line-length
|
// tslint:disable-next-line: max-line-length
|
||||||
makeMP3(url: string, selectedQuality: string, customQualityConfiguration: string, customArgs: string = null, customOutput: string = null, youtubeUsername: string = null, youtubePassword: string = null, ui_uid = null) {
|
makeMP3(url: string, selectedQuality: string, customQualityConfiguration: string, customArgs: string = null, customOutput: string = null, youtubeUsername: string = null, youtubePassword: string = null, ui_uid: string = null) {
|
||||||
return this.http.post(this.path + 'tomp3', {url: url,
|
const body: Mp3DownloadRequest = {url: url,
|
||||||
maxBitrate: selectedQuality,
|
maxBitrate: selectedQuality,
|
||||||
customQualityConfiguration: customQualityConfiguration,
|
customQualityConfiguration: customQualityConfiguration,
|
||||||
customArgs: customArgs,
|
customArgs: customArgs,
|
||||||
customOutput: customOutput,
|
customOutput: customOutput,
|
||||||
youtubeUsername: youtubeUsername,
|
youtubeUsername: youtubeUsername,
|
||||||
youtubePassword: youtubePassword,
|
youtubePassword: youtubePassword,
|
||||||
ui_uid: ui_uid}, this.httpOptions);
|
ui_uid: ui_uid}
|
||||||
|
return this.http.post<Mp3DownloadResponse>(this.path + 'tomp3', body, this.httpOptions);
|
||||||
}
|
}
|
||||||
|
|
||||||
// tslint:disable-next-line: max-line-length
|
// tslint:disable-next-line: max-line-length
|
||||||
makeMP4(url: string, selectedQuality: string, customQualityConfiguration: string, customArgs: string = null, customOutput: string = null, youtubeUsername: string = null, youtubePassword: string = null, ui_uid = null) {
|
makeMP4(url: string, selectedQuality: string, customQualityConfiguration: string, customArgs: string = null, customOutput: string = null, youtubeUsername: string = null, youtubePassword: string = null, ui_uid = null) {
|
||||||
return this.http.post(this.path + 'tomp4', {url: url,
|
const body: Mp4DownloadRequest = {url: url,
|
||||||
selectedHeight: selectedQuality,
|
selectedHeight: selectedQuality,
|
||||||
customQualityConfiguration: customQualityConfiguration,
|
customQualityConfiguration: customQualityConfiguration,
|
||||||
customArgs: customArgs,
|
customArgs: customArgs,
|
||||||
customOutput: customOutput,
|
customOutput: customOutput,
|
||||||
youtubeUsername: youtubeUsername,
|
youtubeUsername: youtubeUsername,
|
||||||
youtubePassword: youtubePassword,
|
youtubePassword: youtubePassword,
|
||||||
ui_uid: ui_uid}, this.httpOptions);
|
ui_uid: ui_uid}
|
||||||
|
return this.http.post<Mp4DownloadResponse>(this.path + 'tomp4', body, this.httpOptions);
|
||||||
}
|
}
|
||||||
|
|
||||||
killAllDownloads() {
|
killAllDownloads() {
|
||||||
@@ -207,19 +211,20 @@ export class PostsService implements CanActivate {
|
|||||||
}
|
}
|
||||||
|
|
||||||
getMp3s() {
|
getMp3s() {
|
||||||
return this.http.get(this.path + 'getMp3s', this.httpOptions);
|
return this.http.get<GetMp3sResponse>(this.path + 'getMp3s', this.httpOptions);
|
||||||
}
|
}
|
||||||
|
|
||||||
getMp4s() {
|
getMp4s() {
|
||||||
return this.http.get(this.path + 'getMp4s', this.httpOptions);
|
return this.http.get<GetMp4sResponse>(this.path + 'getMp4s', this.httpOptions);
|
||||||
}
|
}
|
||||||
|
|
||||||
getFile(uid, type, uuid = null) {
|
getFile(uid: string, type: FileType, uuid: string = null) {
|
||||||
return this.http.post(this.path + 'getFile', {uid: uid, type: type, uuid: uuid}, this.httpOptions);
|
const body: GetFileRequest = {uid: uid, type: type, uuid: uuid};
|
||||||
|
return this.http.post<GetFileResponse>(this.path + 'getFile', body, this.httpOptions);
|
||||||
}
|
}
|
||||||
|
|
||||||
getAllFiles() {
|
getAllFiles() {
|
||||||
return this.http.post(this.path + 'getAllFiles', {}, this.httpOptions);
|
return this.http.post<GetAllFilesResponse>(this.path + 'getAllFiles', {}, this.httpOptions);
|
||||||
}
|
}
|
||||||
|
|
||||||
downloadFileFromServer(fileName, type, outputName = null, fullPathProvided = null, subscriptionName = null, subPlaylist = null,
|
downloadFileFromServer(fileName, type, outputName = null, fullPathProvided = null, subscriptionName = null, subPlaylist = null,
|
||||||
|
|||||||
Reference in New Issue
Block a user