imperialwool commited on
Commit
09f5da5
1 Parent(s): 4fe64f3

yaml upd and added jokes

Browse files
.vscode/settings.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ {
2
+ "python.analysis.typeCheckingMode": "off"
3
+ }
app.py CHANGED
@@ -8,7 +8,7 @@ from transformers import AutoTokenizer, AutoModelForSequenceClassification
8
 
9
  #initing
10
  app = Flask(__name__)
11
- VERSION = '1.0 build120'
12
  app.config['JSON_AS_ASCII'] = False
13
 
14
  #error pages
@@ -43,7 +43,7 @@ def favicon(): return send_from_directory(os.path.join(app.root_path, 'static'),
43
  #SITE ROUTES
44
  @app.route('/')
45
  def index(): return render_template('index.html')
46
- @app.route('/signatures/api/v1/get', methods=['POST'])
47
  def systemInfo(): return siteRoutes.systemInfo()
48
 
49
  ###############
@@ -77,12 +77,8 @@ tc_t, tc_m = AutoTokenizer.from_pretrained("EIStakovskii/xlm_roberta_base_multil
77
  @app.route('/analyzeText/api/v1/sentiment', methods=['POST'])
78
  def sentimentAnalys():
79
  try:
80
- text = request.form.get('text') or request.args.get('text') or request.values.get('text') or ""
81
- if text == "":
82
- try: text = request.json.get('text') or ""
83
- except: pass
84
-
85
- if text == "": return {"status": "error", "details": { "error_code": 101, "error_details": "No text provided" }}
86
 
87
  inputs = sa_t(text, return_tensors="pt")
88
 
@@ -96,12 +92,8 @@ def sentimentAnalys():
96
  @app.route('/analyzeText/api/v1/toxicity', methods=['POST'])
97
  def toxicityAnalys():
98
  try:
99
- text = request.form.get('text') or request.args.get('text') or request.values.get('text') or ""
100
- if text == "":
101
- try: text = request.json.get('text') or ""
102
- except: pass
103
-
104
- if text == "": return {"status": "error", "details": { "error_code": 101, "error_details": "No text provided" }} , 400
105
 
106
  inputs = tc_t(text, return_tensors="pt")
107
 
@@ -115,10 +107,10 @@ def toxicityAnalys():
115
 
116
  if __name__ == "__main__":
117
  config = configFile()
118
- with open(config['config-path'], "w") as outfile:
119
  config['buildVersion'] = VERSION
120
  json.dump(config, outfile)
121
- with open(config['openapi-yaml-path'], "r+") as outfile:
122
  info = outfile.read()
123
  outfile.seek(0)
124
  outfile.write(info.replace('$VERSION_VARIABLE$', VERSION))
 
8
 
9
  #initing
10
  app = Flask(__name__)
11
+ VERSION = '1.0 build121'
12
  app.config['JSON_AS_ASCII'] = False
13
 
14
  #error pages
 
43
  #SITE ROUTES
44
  @app.route('/')
45
  def index(): return render_template('index.html')
46
+ @app.route('/system/api/v1/info', methods=['POST'])
47
  def systemInfo(): return siteRoutes.systemInfo()
48
 
49
  ###############
 
77
  @app.route('/analyzeText/api/v1/sentiment', methods=['POST'])
78
  def sentimentAnalys():
79
  try:
80
+ text = helpers.getFromRequest(request, "text")
81
+ if not text: return {"status": "error", "details": { "error_code": 101, "error_details": "No text provided" }}
 
 
 
 
82
 
83
  inputs = sa_t(text, return_tensors="pt")
84
 
 
92
  @app.route('/analyzeText/api/v1/toxicity', methods=['POST'])
93
  def toxicityAnalys():
94
  try:
95
+ text = helpers.getFromRequest(request, "text")
96
+ if not text: return {"status": "error", "details": { "error_code": 101, "error_details": "No text provided" }} , 400
 
 
 
 
97
 
98
  inputs = tc_t(text, return_tensors="pt")
99
 
 
107
 
108
  if __name__ == "__main__":
109
  config = configFile()
110
+ with open(config['config-path'], "w", encoding="utf-8") as outfile:
111
  config['buildVersion'] = VERSION
112
  json.dump(config, outfile)
113
+ with open(config['openapi-yaml-path'], "r+", encoding="utf-8") as outfile:
114
  info = outfile.read()
115
  outfile.seek(0)
116
  outfile.write(info.replace('$VERSION_VARIABLE$', VERSION))
routes/jokes/__init__.py ADDED
@@ -0,0 +1 @@
 
 
1
+ from .getJoke import *
routes/jokes/getJoke.py ADDED
@@ -0,0 +1,46 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import re
2
+ from .. import helpers
3
+ from random import randint
4
+ from requests import get as reqget
5
+ from random import choice as randchoice
6
+
7
+ def getJoke(request):
8
+ lang = helpers.getFromRequest(request, "lang")
9
+ if not lang: return {"status": "error", "details": { "error_code": 133, "error_details": "No lang provided" }}, 400
10
+ elif lang.lower() not in ['ru']: return {"status": "error", "details": { "error_code": 133, "error_details": "Lang not supported" }}, 400
11
+ else: lang = lang.lower()
12
+
13
+ source = helpers.getFromRequest(request, "source")
14
+ availableSources = {
15
+ "ru": ["nekdo", "baneks", "anekdot", "shytok", "anekdotytoday", "4tob", "anepedia"]
16
+ }
17
+ if not source or source not in availableSources[lang]: source = randchoice(availableSources[lang])
18
+
19
+ try:
20
+ if source == "nekdo":
21
+ site = reqget("https://nekdo.ru/random/").text
22
+ joke = randchoice(re.findall('<div class=\"text\"(.*)</div>', site)).replace('</div>', '').replace('</a>', '').replace('<br>', '\n')
23
+ joke = re.sub('(<a href="/(\S*)/">| id="(\d*)">)','', joke).strip()
24
+ elif source == "baneks":
25
+ site = reqget("https://baneks.ru/random").text
26
+ joke = site.partition('<p>')[2].partition('</p>')[0].replace('<br />', '').strip()
27
+ elif source == "anekdot":
28
+ links = ["https://www.anekdot.ru/random/anekdot/", "https://www.anekdot.ru/random/story/", "https://www.anekdot.ru/random/aphorism/"]
29
+ site = reqget(randchoice(links)).text
30
+ joke = site.partition('<div class=\"text\">')[2].partition('</div>')[0].replace('<br>', '\n').strip()
31
+ elif source == "shytok":
32
+ site = reqget("https://shytok.net/sluchainye-anekdoty.html").text
33
+ joke = site.partition('<div class="text2">')[2].partition('<div class="star">')[0].partition('<br>')[2].replace('</div>', '').replace('<br>', '').replace('<br />', '\n').strip()
34
+ elif source == "anekdotytoday":
35
+ site = reqget(f"https://anekdotytoday.net/poisk/getanekdot_poisk.php?teg=new&fteg={randint(0,4952)}").text
36
+ joke = site.partition('<p>')[2].partition('</p>')[0].replace('<br/>', '').strip()
37
+ elif source == "4tob":
38
+ site = reqget("https://4tob.ru/anekdots/{}".format(randint(1,3628))).content
39
+ joke = site.decode().partition('<div class="text">')[2].partition("</div>")[0].replace("<br>", "\n").replace("<br />", "\n").replace("<p>", "").replace("</p>", "").strip()
40
+ elif source == "anepedia":
41
+ site = reqget("https://www.anepedia.mobi/%D0%A1%D0%BB%D1%83%D1%87%D0%B0%D0%B9%D0%BD%D1%8B%D0%B9_%D0%B0%D0%BD%D0%B5%D0%BA%D0%B4%D0%BE%D1%82").content.decode()
42
+ joke = re.sub(r'<a\b[^>]*>', '', site.partition('<div align="left" class="bodytext">')[2].partition("<img src")[0]).replace("</a>", "").replace("<br />", "\n").replace("<br/>", "\n").replace("<br>", "\n").strip()
43
+
44
+ return {"status": "pass", "details": {"code": 200, "result": joke}}
45
+ except Exception as e:
46
+ return {"status": "error", "details": {"error_code": 500, "error_details": str(e)}}, 500
routes/ytApi/get.py CHANGED
@@ -9,9 +9,9 @@ def get(request, check = "huh"):
9
  bitrate = helpers.getFromRequest(request, "bitrate")
10
  if not bitrate: bitrate = "64k"
11
 
12
- quality = helpers.getFromRequest(request, "quality").lower()
13
- if quality.lower() not in ['best', 'worst']: quality = 'worst'
14
- else: bitrate = str(bitrate)
15
 
16
  urlcode = url.partition('?v=')[2]
17
  if not urlcode: urlcode = "NPRNRQh2fAo"
 
9
  bitrate = helpers.getFromRequest(request, "bitrate")
10
  if not bitrate: bitrate = "64k"
11
 
12
+ quality = helpers.getFromRequest(request, "quality")
13
+ if not quality or quality.lower() not in ['best', 'worst']: quality = 'worst'
14
+ else: quality = quality.lower()
15
 
16
  urlcode = url.partition('?v=')[2]
17
  if not urlcode: urlcode = "NPRNRQh2fAo"
static/api.yaml CHANGED
@@ -1,476 +1,529 @@
1
  openapi: 3.0.0
2
  info:
3
- title: woolbot's FunAPI
4
- description: Big API for bots, developers or just fun by @podvaljoey.
5
- version: $VERSION_VARIABLE$
6
  servers:
7
  - url: 'https://imperialwool-funapi.hf.space/'
8
  description: 'You are here! ^o^'
9
  paths:
10
- /signatures/api/v1/get:
11
- post:
12
- tags:
13
- - "Authentication"
14
- parameters:
15
- - name: 'key'
16
- description: Key to generate signature.
17
- in: 'query'
18
- schema:
19
- type: 'string'
20
- example: rickroll
21
- summary: "Generating auth key with small TTL."
22
- responses:
23
- 200:
24
- description: OK
25
- content:
26
- application/json:
27
  schema:
28
- $ref: "#/components/schemas/AuthSuccessObject"
29
- 400:
30
- description: Bad Request
31
- content:
32
- application/json:
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
33
  schema:
34
- $ref: "#/components/schemas/AuthErrorObject"
35
- /osu/api/v1/find-song:
36
- post:
37
- tags:
38
- - "osu! API"
39
- parameters:
40
- - name: 'query'
41
- description: Query to find beatmap.
42
- in: 'query'
43
- schema:
44
- type: 'string'
45
- example: rickroll
46
- summary: "Finding beatmap by query."
47
- responses:
48
- 200:
49
- description: OK
50
- content:
51
- application/json:
 
 
 
 
 
 
52
  schema:
53
- $ref: "#/components/schemas/FindBeatmapsObject"
54
- 400:
55
- description: Bad Request
56
- content:
57
- application/json:
58
  schema:
59
- $ref: "#/components/schemas/ErrorObject"
60
- /osu/api/v1/get-full:
61
- post:
62
- tags:
63
- - "osu! API"
64
- parameters:
65
- - name: 'query'
66
- description: Query to find beatmap and download full song.
67
- in: 'query'
68
- schema:
69
- type: 'string'
70
- example: rickroll
71
- - name: 'beatmapId'
72
- description: Beatset id. Not map, set.
73
- in: 'query'
74
- schema:
75
- type: 'integer'
76
- example: 1
77
- summary: "Get beatmap's full song."
78
- responses:
79
- 200:
80
- description: OK
81
- content:
82
- application/json:
83
  schema:
84
- $ref: "#/components/schemas/SongFullObject"
85
- 400:
86
- description: Bad Request
87
- content:
88
- application/json:
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
89
  schema:
90
- $ref: "#/components/schemas/ErrorObject"
91
- /osu/api/v1/get-preview:
92
- post:
93
- tags:
94
- - "osu! API"
95
- parameters:
96
- - name: 'query'
97
- description: Query to find beatmap and download full song.
98
- in: 'query'
99
- schema:
100
- type: 'string'
101
- example: rickroll
102
- - name: 'beatmapId'
103
- description: Beatset id. Not map, set.
104
- in: 'query'
105
- schema:
106
- type: 'integer'
107
- example: 1
108
- summary: "Get beatmap's song preview."
109
- responses:
110
- 200:
111
- description: OK
112
- content:
113
- application/json:
114
  schema:
115
- $ref: "#/components/schemas/SongPreviewObject"
116
- 400:
117
- description: Bad Request
118
- content:
119
- application/json:
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
120
  schema:
121
- $ref: "#/components/schemas/ErrorObject"
122
- /system-info/api/v1/get:
123
- post:
124
- tags:
125
- - "System information"
126
- summary: "Information about server."
127
- responses:
128
- 200:
129
- description: OK
130
- content:
131
- application/json:
132
  schema:
133
- $ref: "#/components/schemas/SysinfoObject"
134
- 400:
135
- description: Bad Request
136
- content:
137
- application/json:
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
138
  schema:
139
- $ref: "#/components/schemas/ErrorObject"
140
- /yt/api/v1/search:
141
- post:
142
- tags:
143
- - "Youtube: Becoming Music Platform"
144
- parameters:
145
- - name: 'query'
146
- description: Query for YouTube to find videos.
147
- in: 'query'
148
- schema:
149
- type: 'string'
150
- example: never gonna give you up
151
-
152
- summary: "This method can help with searching videos on YouTube."
153
- responses:
154
- 200:
155
- description: OK
156
- content:
157
- application/json:
 
 
 
 
 
 
158
  schema:
159
- $ref: "#/components/schemas/YTSearchObject"
160
- 400:
161
- description: Bad Request
162
- content:
163
- application/json:
164
  schema:
165
- $ref: "#/components/schemas/ErrorObject"
166
- /yt/api/v1/get-full:
167
- post:
168
- tags:
169
- - "Youtube: Becoming Music Platform"
170
- parameters:
171
- - name: 'url'
172
- description: Url to video from YouTube. (TikTok also works sometimes.)
173
- in: 'query'
174
- schema:
175
- type: 'string'
176
- - name: 'bitrate'
177
- description: Bitrate of final audio.
178
- in: 'query'
179
- schema:
180
- type: 'string'
181
- example: "64k"
182
- - name: 'quality'
183
- description: Quality of final audio. Only 'worst' or 'best'.
184
- in: 'query'
185
- schema:
186
- type: 'string'
187
- example: "worst"
188
-
189
- summary: "Download video as audio and providing link for you."
190
- responses:
191
- 200:
192
- description: OK
193
- content:
194
- application/json:
195
  schema:
196
- $ref: "#/components/schemas/YTFullObject"
197
- 400:
198
- description: Bad Request
199
- content:
200
- application/json:
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
201
  schema:
202
- $ref: "#/components/schemas/ErrorObject"
203
- /yt/api/v1/get-preview:
204
- post:
205
- tags:
206
- - "Youtube: Becoming Music Platform"
207
- parameters:
208
- - name: 'url'
209
- description: Url to video from YouTube. (TikTok also works sometimes.)
210
- in: 'query'
211
- schema:
212
- type: 'string'
213
- - name: 'bitrate'
214
- description: Bitrate of final audio.
215
- in: 'query'
216
- schema:
217
- type: 'string'
218
- example: "64k"
219
- - name: 'quality'
220
- description: Quality of final audio. Only 'worst' or 'best'.
221
- in: 'query'
222
- schema:
223
- type: 'string'
224
- example: "worst"
225
- - name: 'duration'
226
- description: Duration of preview. Maximum 60 seconds.
227
- in: 'query'
228
- schema:
229
- type: 'integer'
230
- example: 30
231
- summary: "Download video as cutted audio and providing link for you."
232
- responses:
233
- 200:
234
- description: OK
235
- content:
236
- application/json:
237
  schema:
238
- $ref: "#/components/schemas/YTPreviewResult"
239
- 400:
240
- description: Bad Request
241
- content:
242
- application/json:
243
  schema:
244
- $ref: "#/components/schemas/ErrorObject"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
245
  components:
246
  schemas:
247
  SongFullObject:
248
- type: object
249
- properties:
250
- status:
251
- type: string
252
- example: pass
253
- details:
254
- type: object
255
- properties:
256
- code:
257
- type: integer
258
- example: 200
259
- name:
260
- type: string
261
- example: "1592415.ogg"
262
- result:
263
- type: string
264
- example: "https://imperialwool-funapi.hf.space/static/full/1592415.ogg"
265
  SongPreviewObject:
266
- type: object
267
- properties:
268
- status:
269
- type: string
270
- example: pass
271
- details:
272
- type: object
273
- properties:
274
- code:
275
- type: integer
276
- example: 200
277
- name:
278
- type: string
279
- example: "1244874.mp3"
280
- result:
281
- type: string
282
- example: "https://b.ppy.sh/preview/1244874.mp3"
283
  BeatmapObject:
284
- type: object
285
- properties:
286
- "artist":
287
- type: string
288
- example: "never gonna give you up remix"
289
- "beatmapId":
290
- type: integer
291
- example: 1542795
292
- "creator":
293
- type: string
294
- example: "CrisFloppa"
295
- "source":
296
- type: string
297
- example: ""
298
- "tags":
299
- type: string
300
- example: "never gonna gie you up rick roll"
301
- "title":
302
- type: string
303
- example: "rick astley"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
304
  FindBeatmapsObject:
305
- type: object
306
- properties:
307
- status:
308
- type: string
309
- example: pass
310
- details:
311
- type: object
312
- properties:
313
- "code":
314
- type: integer
315
- example: 200
316
- "result":
317
- type: array
318
- items:
319
- $ref: "#/components/schemas/BeatmapObject"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
320
  SysinfoObject:
321
- type: object
322
- properties:
323
- "API_VERSION":
324
- type: string
325
- example: "1.0 build62"
326
- "CPU_INFO":
327
- type: object
328
- properties:
329
- "cpu_brand":
330
- type: string
331
- example: "AMD EPYC 7R13 Processor"
332
- "cpu_count":
333
- type: object
334
- properties:
335
- "all":
336
- type: integer
337
- example: 16
338
- "exclude_virtual":
339
- type: integer
340
- example: 8
341
- "cpu_freq":
342
- type: object
343
- properties:
344
- "current":
345
- type: number
346
- format: float
347
- example: 3522.9323125
348
- "min":
349
- type: number
350
- format: float
351
- example: 0.0
352
- "max":
353
- type: number
354
- format: float
355
- example: 3600.0
356
- "cpu_load":
357
- type: number
358
- format: float
359
- example: 16.2
360
- "MEM_INFO":
361
- type: object
362
- properties:
363
- "mem_total":
364
- type: integer
365
- example: 126125
366
- "mem_used":
367
- type: integer
368
- example: 87497
369
- AuthSuccessObject:
370
- type: object
371
- properties:
372
- status:
373
- type: string
374
- example: pass
375
- endtime:
376
- type: integer
377
- example: 1672602259
378
- result:
379
- type: string
380
- example: B46AAB1A3F1E33625C1B6BD9507453B928DE69BA638E7098DB533A2184ED288EFB899D563EF8AB5487DACBCAD909A801E4C81FD6D34B639F6591295CD1D10A5B
381
- AuthErrorObject:
382
- type: object
383
- properties:
384
- status:
385
- type: string
386
- example: error
387
- details:
388
- type: object
389
- properties:
390
- error_code:
391
- type: integer
392
- example: -1
393
- error_details:
394
- type: string
395
- example: This key already got signature
396
  ErrorObject:
397
- type: object
398
- properties:
399
- status:
400
- type: string
401
- example: error
402
- details:
403
- type: object
404
- properties:
405
- error_code:
406
- type: integer
407
- example: 103
408
- error_details:
409
- type: string
410
- example: No signature
411
- RecognizeObject:
412
- type: object
413
- properties:
414
- status:
415
- type: string
416
- example: pass
417
- result:
418
- type: string
419
- example: "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean condimentum neque quis enim bibendum, ut molestie magna gravida. Donec et felis eget lacus sodales convallis. Quisque vitae erat et leo lobortis iaculis. Maecenas a lectus vitae metus fringilla luctus. Morbi sed pellentesque elit. Phasellus bibendum et urna sed elementum. Orci varius natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus."
420
  YTSearchObject:
421
- type: object
422
- properties:
423
- status:
424
- type: string
425
- example: ok
426
- query:
427
- type: string
428
- example: never gonna give you up
429
- videoIds:
430
- type: object
431
- properties:
432
- "0":
433
- type: string
434
- example: dQw4w9WgXcQ
435
- "1":
436
- type: string
437
- example: GtL1huin9EE
438
- "2":
439
- type: string
440
- example: uXV-IaR_vNE
441
  YTFullObject:
442
- type: object
443
- properties:
444
- status:
445
- type: string
446
- example: pass
447
- details:
448
- type: object
449
- properties:
450
- code:
451
- type: integer
452
- example: 0
453
- name:
454
- type: string
455
- example: "R8YprjS6ztg.ogg"
456
- result:
457
- type: string
458
- example: "https://imperialwool-funapi.hf.space/static/full/R8YprjS6ztg.ogg"
459
  YTPreviewResult:
460
- type: object
461
- properties:
462
- status:
463
- type: string
464
- example: pass
465
- details:
466
- type: object
467
- properties:
468
- code:
469
- type: integer
470
- example: 0
471
- name:
472
- type: string
473
- example: "R8YprjS6ztg.ogg"
474
- result:
475
- type: string
476
- example: "https://imperialwool-funapi.hf.space/static/previews/R8YprjS6ztg.ogg"
 
1
  openapi: 3.0.0
2
  info:
3
+ title: imperialwool's FunAPI
4
+ description: Big API for bots, developers or just fun by @podvaljoey (telegram).
5
+ version: $VERSION_VARIABLE$
6
  servers:
7
  - url: 'https://imperialwool-funapi.hf.space/'
8
  description: 'You are here! ^o^'
9
  paths:
10
+ /analyzeText/api/v1/toxicity:
11
+ post:
12
+ tags:
13
+ - "Analyze text API"
14
+ parameters:
15
+ - name: 'text'
16
+ description: Text to analyze
17
+ in: 'lang'
 
 
 
 
 
 
 
 
 
18
  schema:
19
+ type: 'string'
20
+ example: ru
21
+ summary: "Classifying a text as toxic or not toxic"
22
+ responses:
23
+ 200:
24
+ description: OK
25
+ content:
26
+ application/json:
27
+ schema:
28
+ $ref: "#/components/schemas/PredictedToxicityObject"
29
+ 400:
30
+ description: Bad Request
31
+ content:
32
+ application/json:
33
+ schema:
34
+ $ref: "#/components/schemas/ErrorObject"
35
+ /analyzeText/api/v1/sentiment:
36
+ post:
37
+ tags:
38
+ - "Analyze text API"
39
+ parameters:
40
+ - name: 'text'
41
+ description: Text to analyze
42
+ in: 'lang'
43
  schema:
44
+ type: 'string'
45
+ example: ru
46
+ summary: "Classifying a text as negative, positive or neutral"
47
+ responses:
48
+ 200:
49
+ description: OK
50
+ content:
51
+ application/json:
52
+ schema:
53
+ $ref: "#/components/schemas/PredictedSentimentObject"
54
+ 400:
55
+ description: Bad Request
56
+ content:
57
+ application/json:
58
+ schema:
59
+ $ref: "#/components/schemas/ErrorObject"
60
+ /jokes/api/v1/get:
61
+ post:
62
+ tags:
63
+ - "Jokes API"
64
+ parameters:
65
+ - name: 'lang'
66
+ description: Language in which to look for a joke. (Now supported only ru, sorry.)
67
+ in: 'lang'
68
  schema:
69
+ type: 'string'
70
+ example: ru
71
+ - name: 'source'
72
+ description: You can get sources and use one of them, if you like.
73
+ in: 'source'
74
  schema:
75
+ type: 'string'
76
+ example: chucknorris
77
+ summary: "Finding joke by language."
78
+ responses:
79
+ 200:
80
+ description: OK
81
+ content:
82
+ application/json:
83
+ schema:
84
+ $ref: "#/components/schemas/JokeObject"
85
+ 400:
86
+ description: Bad Request
87
+ content:
88
+ application/json:
89
+ schema:
90
+ $ref: "#/components/schemas/ErrorObject"
91
+ /osu/api/v1/find-song:
92
+ post:
93
+ tags:
94
+ - "osu! API"
95
+ parameters:
96
+ - name: 'query'
97
+ description: Query to find beatmap.
98
+ in: 'query'
99
  schema:
100
+ type: 'string'
101
+ example: rickroll
102
+ summary: "Finding beatmap by query."
103
+ responses:
104
+ 200:
105
+ description: OK
106
+ content:
107
+ application/json:
108
+ schema:
109
+ $ref: "#/components/schemas/FindBeatmapsObject"
110
+ 400:
111
+ description: Bad Request
112
+ content:
113
+ application/json:
114
+ schema:
115
+ $ref: "#/components/schemas/ErrorObject"
116
+ /osu/api/v1/get-full:
117
+ post:
118
+ tags:
119
+ - "osu! API"
120
+ parameters:
121
+ - name: 'query'
122
+ description: Query to find beatmap and download full song.
123
+ in: 'query'
124
  schema:
125
+ type: 'string'
126
+ example: rickroll
127
+ - name: 'beatmapId'
128
+ description: Beatset id. Not map, set.
129
+ in: 'query'
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
130
  schema:
131
+ type: 'integer'
132
+ example: 1
133
+ summary: "Get beatmap's full song."
134
+ responses:
135
+ 200:
136
+ description: OK
137
+ content:
138
+ application/json:
139
+ schema:
140
+ $ref: "#/components/schemas/SongFullObject"
141
+ 400:
142
+ description: Bad Request
143
+ content:
144
+ application/json:
145
+ schema:
146
+ $ref: "#/components/schemas/ErrorObject"
147
+ /osu/api/v1/get-preview:
148
+ post:
149
+ tags:
150
+ - "osu! API"
151
+ parameters:
152
+ - name: 'query'
153
+ description: Query to find beatmap and download full song.
154
+ in: 'query'
155
  schema:
156
+ type: 'string'
157
+ example: rickroll
158
+ - name: 'beatmapId'
159
+ description: Beatset id. Not map, set.
160
+ in: 'query'
 
 
 
 
 
 
161
  schema:
162
+ type: 'integer'
163
+ example: 1
164
+ summary: "Get beatmap's song preview."
165
+ responses:
166
+ 200:
167
+ description: OK
168
+ content:
169
+ application/json:
170
+ schema:
171
+ $ref: "#/components/schemas/SongPreviewObject"
172
+ 400:
173
+ description: Bad Request
174
+ content:
175
+ application/json:
176
+ schema:
177
+ $ref: "#/components/schemas/ErrorObject"
178
+ /system/api/v1/info:
179
+ post:
180
+ tags:
181
+ - "System information"
182
+ summary: "Information about server."
183
+ responses:
184
+ 200:
185
+ description: OK
186
+ content:
187
+ application/json:
188
+ schema:
189
+ $ref: "#/components/schemas/SysinfoObject"
190
+ 400:
191
+ description: Bad Request
192
+ content:
193
+ application/json:
194
+ schema:
195
+ $ref: "#/components/schemas/ErrorObject"
196
+ /yt/api/v1/search:
197
+ post:
198
+ tags:
199
+ - "Youtube: Becoming Music Platform"
200
+ parameters:
201
+ - name: 'query'
202
+ description: Query for YouTube to find videos.
203
+ in: 'query'
204
  schema:
205
+ type: 'string'
206
+ example: never gonna give you up
207
+
208
+ summary: "This method can help with searching videos on YouTube."
209
+ responses:
210
+ 200:
211
+ description: OK
212
+ content:
213
+ application/json:
214
+ schema:
215
+ $ref: "#/components/schemas/YTSearchObject"
216
+ 400:
217
+ description: Bad Request
218
+ content:
219
+ application/json:
220
+ schema:
221
+ $ref: "#/components/schemas/ErrorObject"
222
+ /yt/api/v1/get-full:
223
+ post:
224
+ tags:
225
+ - "Youtube: Becoming Music Platform"
226
+ parameters:
227
+ - name: 'url'
228
+ description: Url to video from YouTube. (TikTok also works sometimes.)
229
+ in: 'query'
230
  schema:
231
+ type: 'string'
232
+ - name: 'bitrate'
233
+ description: Bitrate of final audio.
234
+ in: 'query'
 
235
  schema:
236
+ type: 'string'
237
+ example: "64k"
238
+ - name: 'quality'
239
+ description: Quality of final audio. Only 'worst' or 'best'.
240
+ in: 'query'
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
241
  schema:
242
+ type: 'string'
243
+ example: "worst"
244
+
245
+ summary: "Download video as audio and providing link for you."
246
+ responses:
247
+ 200:
248
+ description: OK
249
+ content:
250
+ application/json:
251
+ schema:
252
+ $ref: "#/components/schemas/YTFullObject"
253
+ 400:
254
+ description: Bad Request
255
+ content:
256
+ application/json:
257
+ schema:
258
+ $ref: "#/components/schemas/ErrorObject"
259
+ /yt/api/v1/get-preview:
260
+ post:
261
+ tags:
262
+ - "Youtube: Becoming Music Platform"
263
+ parameters:
264
+ - name: 'url'
265
+ description: Url to video from YouTube. (TikTok also works sometimes.)
266
+ in: 'query'
267
  schema:
268
+ type: 'string'
269
+ - name: 'bitrate'
270
+ description: Bitrate of final audio.
271
+ in: 'query'
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
272
  schema:
273
+ type: 'string'
274
+ example: "64k"
275
+ - name: 'quality'
276
+ description: Quality of final audio. Only 'worst' or 'best'.
277
+ in: 'query'
278
  schema:
279
+ type: 'string'
280
+ example: "worst"
281
+ - name: 'duration'
282
+ description: Duration of preview. Maximum 60 seconds.
283
+ in: 'query'
284
+ schema:
285
+ type: 'integer'
286
+ example: 45
287
+ summary: "Download video as cutted audio and providing link for you."
288
+ responses:
289
+ 200:
290
+ description: OK
291
+ content:
292
+ application/json:
293
+ schema:
294
+ $ref: "#/components/schemas/YTPreviewResult"
295
+ 400:
296
+ description: Bad Request
297
+ content:
298
+ application/json:
299
+ schema:
300
+ $ref: "#/components/schemas/ErrorObject"
301
  components:
302
  schemas:
303
  SongFullObject:
304
+ type: object
305
+ properties:
306
+ status:
307
+ type: string
308
+ example: pass
309
+ details:
310
+ type: object
311
+ properties:
312
+ code:
313
+ type: integer
314
+ example: 200
315
+ name:
316
+ type: string
317
+ example: "1592415.ogg"
318
+ result:
319
+ type: string
320
+ example: "https://imperialwool-funapi.hf.space/static/full/1592415.ogg"
321
  SongPreviewObject:
322
+ type: object
323
+ properties:
324
+ status:
325
+ type: string
326
+ example: pass
327
+ details:
328
+ type: object
329
+ properties:
330
+ code:
331
+ type: integer
332
+ example: 200
333
+ name:
334
+ type: string
335
+ example: "1244874.mp3"
336
+ result:
337
+ type: string
338
+ example: "https://b.ppy.sh/preview/1244874.mp3"
339
  BeatmapObject:
340
+ type: object
341
+ properties:
342
+ "artist":
343
+ type: string
344
+ example: "never gonna give you up remix"
345
+ "beatmapId":
346
+ type: integer
347
+ example: 1542795
348
+ "creator":
349
+ type: string
350
+ example: "CrisFloppa"
351
+ "source":
352
+ type: string
353
+ example: ""
354
+ "tags":
355
+ type: string
356
+ example: "never gonna gie you up rick roll"
357
+ "title":
358
+ type: string
359
+ example: "rick astley"
360
+ PredictedSentimentObject:
361
+ type: object
362
+ properties:
363
+ status:
364
+ type: string
365
+ example: pass
366
+ predicted_sentiment:
367
+ type: string
368
+ example: Positive
369
+ PredictedToxicityObject:
370
+ type: object
371
+ properties:
372
+ status:
373
+ type: string
374
+ example: pass
375
+ toxicity:
376
+ type: bool
377
+ example: False
378
  FindBeatmapsObject:
379
+ type: object
380
+ properties:
381
+ status:
382
+ type: string
383
+ example: pass
384
+ details:
385
+ type: object
386
+ properties:
387
+ "code":
388
+ type: integer
389
+ example: 200
390
+ "result":
391
+ type: array
392
+ items:
393
+ $ref: "#/components/schemas/BeatmapObject"
394
+ JokeObject:
395
+ type: object
396
+ properties:
397
+ status:
398
+ type: string
399
+ example: pass
400
+ details:
401
+ type: object
402
+ properties:
403
+ "code":
404
+ type: integer
405
+ example: 200
406
+ "result":
407
+ type: string
408
+ example: ".NET developers are picky when it comes to food.\nThey only like chicken NuGet."
409
  SysinfoObject:
410
+ type: object
411
+ properties:
412
+ "API_VERSION":
413
+ type: string
414
+ example: "$VERSION_VARIABLE$"
415
+ "CPU_INFO":
416
+ type: object
417
+ properties:
418
+ "cpu_brand":
419
+ type: string
420
+ example: "AMD EPYC 7R13 Processor"
421
+ "cpu_count":
422
+ type: object
423
+ properties:
424
+ "all":
425
+ type: integer
426
+ example: 16
427
+ "exclude_virtual":
428
+ type: integer
429
+ example: 8
430
+ "cpu_freq":
431
+ type: object
432
+ properties:
433
+ "current":
434
+ type: number
435
+ format: float
436
+ example: 3522.9323125
437
+ "min":
438
+ type: number
439
+ format: float
440
+ example: 0.0
441
+ "max":
442
+ type: number
443
+ format: float
444
+ example: 3600.0
445
+ "cpu_load":
446
+ type: number
447
+ format: float
448
+ example: 16.2
449
+ "MEM_INFO":
450
+ type: object
451
+ properties:
452
+ "mem_total":
453
+ type: integer
454
+ example: 126125
455
+ "mem_used":
456
+ type: integer
457
+ example: 87497
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
458
  ErrorObject:
459
+ type: object
460
+ properties:
461
+ status:
462
+ type: string
463
+ example: error
464
+ details:
465
+ type: object
466
+ properties:
467
+ error_code:
468
+ type: integer
469
+ example: 1337
470
+ error_details:
471
+ type: string
472
+ example: Some error
 
 
 
 
 
 
 
 
 
473
  YTSearchObject:
474
+ type: object
475
+ properties:
476
+ status:
477
+ type: string
478
+ example: ok
479
+ query:
480
+ type: string
481
+ example: never gonna give you up
482
+ videoIds:
483
+ type: object
484
+ properties:
485
+ "0":
486
+ type: string
487
+ example: dQw4w9WgXcQ
488
+ "1":
489
+ type: string
490
+ example: GtL1huin9EE
491
+ "2":
492
+ type: string
493
+ example: uXV-IaR_vNE
494
  YTFullObject:
495
+ type: object
496
+ properties:
497
+ status:
498
+ type: string
499
+ example: pass
500
+ details:
501
+ type: object
502
+ properties:
503
+ code:
504
+ type: integer
505
+ example: 0
506
+ name:
507
+ type: string
508
+ example: "R8YprjS6ztg.ogg"
509
+ result:
510
+ type: string
511
+ example: "https://imperialwool-funapi.hf.space/static/full/R8YprjS6ztg.ogg"
512
  YTPreviewResult:
513
+ type: object
514
+ properties:
515
+ status:
516
+ type: string
517
+ example: pass
518
+ details:
519
+ type: object
520
+ properties:
521
+ code:
522
+ type: integer
523
+ example: 0
524
+ name:
525
+ type: string
526
+ example: "R8YprjS6ztg.ogg"
527
+ result:
528
+ type: string
529
+ example: "https://imperialwool-funapi.hf.space/static/previews/R8YprjS6ztg.ogg"