File size: 1,916 Bytes
803629f
 
cadd5e9
 
803629f
cadd5e9
 
803629f
cadd5e9
803629f
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
openapi: "3.0.3"
info:
  title: Asset Extractor API
  version: "2.0.0"
  description: |
    FastAPI service that extracts assets (image, video, audio, svg/icon, font)
    from any URL.
  contact:
    name: Asset Extractor API
    url: https://huggingface.co/spaces/lljz66/api
  license:
    name: MIT

servers:
  - url: https://lljz66-api.hf.space
    description: Production

tags:
  - name: Assets
    description: Asset extraction (image, video, audio, svg/icon, font)

paths:
  /assets:
    post:
      tags: [Assets]
      summary: Extract assets from a URL
      operationId: extractAssets
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/AssetExtractRequest"
      responses:
        "200":
          description: Assets extracted and grouped
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/AssetExtractResponse"
        "502":
          description: Asset extraction failed

components:
  schemas:
    AssetExtractRequest:
      type: object
      required: [url]
      properties:
        url: { type: string, format: uri }
        include_data_uris: { type: boolean, default: false }
        groups:
          type: array
          items: { type: string, enum: [image, video, audio, svg_icon, font] }

    AssetExtractResponse:
      type: object
      properties:
        url: { type: string }
        title: { type: string, nullable: true }
        total: { type: integer }
        assets:
          type: object
          properties:
            image: { type: array, items: { type: string } }
            video: { type: array, items: { type: string } }
            audio: { type: array, items: { type: string } }
            svg_icon: { type: array, items: { type: string } }
            font: { type: array, items: { type: string } }