Mencari informasi aset media seperti video, file audio, dan gambar yang dihasilkan oleh ApsaraVideo VOD. Anda dapat menggunakan operasi ini dengan protokol pencarian aset media untuk melakukan pencarian multidimensi di ApsaraVideo VOD, termasuk menentukan bidang yang dikembalikan, pencocokan eksak, pencocokan fuzzy, kueri multi-nilai, kueri rentang, dan bidang pengurutan.
Deskripsi operasi
Untuk bidang yang mendukung pencocokan eksak dan pencocokan fuzzy, ketika metode kueri lain digunakan, hasil yang dikembalikan mengikuti metode kueri yang didukung oleh bidang tersebut. Misalnya, jika sebuah bidang hanya mendukung pencocokan fuzzy, hasil yang diperoleh melalui kueri multi-nilai juga didasarkan pada pencocokan fuzzy.
Berikut adalah batasan jumlah data yang dapat diambil:
-
Metode 1: Traversal berhalaman
Untuk hasil pencarian yang cocok, Anda dapat mengatur parameter pagination PageNo (nomor halaman) dan PageSize (jumlah entri per halaman) untuk menelusuri hingga 5.000 entri. Jika hasil pencarian melebihi 5.000 entri, sesuaikan kondisi pencarian untuk mempersempit rentang hasil. Metode ini tidak dapat menelusuri seluruh set data. Untuk menelusuri lebih banyak data, lihat Metode 2.
-
Metode 2: Traversal penuh (hanya untuk pencarian audio dan video)
Metode ini berlaku untuk pencarian konten video dan audio serta mendukung penelusuran hingga 2 juta hasil pencarian. Jika jumlah hasil pencarian melebihi 2 juta, tambahkan lebih banyak kondisi filter untuk mengurangi jumlah hasil. Saat menggunakan metode ini, selain PageNo dan PageSize, Anda harus menggunakan parameter ScrollToken untuk pagination. Setiap permintaan mendukung penelusuran hingga 100 entri ke depan. Menggunakan PageSize sebesar 20 sebagai contoh, logika pagination adalah sebagai berikut:
Jika PageNo adalah 1, Anda dapat mengkueri hingga 5 halaman data berikutnya.
Jika PageNo adalah 2, Anda dapat mengkueri hingga 6 halaman data berikutnya.
Atur parameter pagination dengan benar dan pilih metode traversal yang sesuai berdasarkan ukuran set hasil. Jika Anda perlu melakukan paging melalui lebih dari 1.000 entri, gunakan Metode 2 untuk Pemrosesan data yang lebih cepat dan mudah.
Coba sekarang
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
vod:SearchMedia |
list |
*全部资源
|
None | None |
Parameter permintaan
|
Parameter |
Type |
Required |
Description |
Example |
| SearchType |
string |
No |
Jenis aset media yang akan dicari. Nilai valid:
Catatan
Jika parameter ini diatur ke video atau audio dan Anda perlu menelusuri semua data yang cocok dengan kondisi pencarian, Anda harus mengatur parameter ScrollToken. |
video. |
| Fields |
string |
No |
Bidang aset media yang akan dikembalikan dalam hasil pencarian. Secara default, hanya bidang dasar aset media yang dikembalikan. Anda dapat menentukan bidang aset media tambahan untuk dikembalikan. Untuk informasi selengkapnya, lihat Contoh penggunaan. |
Title,CoverURL. |
| Match |
string |
No |
Kondisi filter. Untuk aturan sintaksis, lihat Sintaksis protokol pencarian. |
bidang = nilai. |
| SortBy |
string |
No |
Bidang pengurutan dan urutan pengurutan. Pisahkan beberapa nilai dengan koma (,). Nilai valid:
Catatan
|
CreationTime:Desc. |
| PageNo |
integer |
No |
Nomor halaman. Nilai default: 1. Catatan
Jika parameter ini melebihi 200, atur juga parameter ScrollToken. |
1 |
| PageSize |
integer |
No |
Jumlah entri per halaman. Nilai default: 10. Nilai maksimum: 100. |
10 |
| ScrollToken |
string |
No |
Token pagination. Nilainya adalah string 32 karakter. Anda tidak perlu mengatur parameter ini untuk permintaan pencarian pertama. Ketika permintaan pencarian cocok dengan data, server mengembalikan nilai parameter ini, yang mencatat posisi saat ini dari data pencarian. Catat nilai yang dikembalikan dan atur parameter ini dalam permintaan pencarian berikutnya berdasarkan persyaratan atau rekomendasi berikut:
|
24e0fba7188fae707e146esa54**** |
Elemen respons
|
Element |
Type |
Description |
Example |
|
object |
Parameter tanggapan. |
||
| RequestId |
string |
ID permintaan. |
3E0CEF83-FB09-4E34-BA1451814B03**** |
| Total |
integer |
Jumlah total aset media yang cocok dengan kondisi pencarian. |
10 |
| ScrollToken |
string |
Token pagination. |
24e0fba7188fae707e146esa54**** |
| MediaList |
array<object> |
Daftar informasi aset media. |
|
|
array<object> |
Detail aset media. |
||
| CreationTime |
string |
Waktu ketika aset media dibuat. Waktu dalam format yyyy-MM-ddTHH:mm:ssZ (UTC). |
2018-07-19T03:45:25Z |
| MediaType |
string |
Tipe media. Nilai valid:
|
video. |
| MediaId |
string |
ID media. |
a82a2cd7d4e147bbed6c1ee372**** |
| Video |
object |
|
|
| Status |
string |
The status. Valid values:
|
UploadSucc |
| CreationTime |
string |
The time when the video information was created. The time is in the yyyy-MM-ddTHH:mm:ssZ format in UTC. |
2018-07-19T03:45:25Z |
| StorageLocation |
string |
The storage region. |
outin-bfefbb90a47c******163e1c7426.oss-cn-shanghai.aliyuncs.com |
| CateId |
integer |
The category ID. |
10000123 |
| Tags |
string |
The video tags. |
tag1 |
| ModificationTime |
string |
The time when the video information was last updated. The time is in the yyyy-MM-ddTHH:mm:ssZ format in UTC. |
2018-07-19T03:48:25Z |
| MediaSource |
string |
The source. Valid values:
|
general |
| Description |
string |
The video description. |
Alibaba Cloud VOD video description |
| AppId |
string |
The application ID. |
app-**** |
| CoverURL |
string |
The thumbnail URL. |
https://example.aliyundoc.com/image01.png |
| VideoId |
string |
The video ID. |
a82a2asdasqadaf3faa0ed6c1ee372**** |
| DownloadSwitch |
string |
The download switch. Offline download is allowed only when the switch is turned on. Valid values:
|
on |
| CateName |
string |
The category name. |
video1 |
| TranscodeMode |
string |
The transcoding mode. Valid values:
|
FastTranscode |
| PreprocessStatus |
string |
The pre-processing status. Valid values:
|
Preprocessing |
| RestoreExpiration |
string |
The expiration time of the restored media asset. |
2023-03-30T10:14:14Z |
| RestoreStatus |
string |
The restored state of the media asset. Valid values:
|
Success |
| StorageClass |
string |
The storage class of the media asset. Valid values:
|
Standard |
| Size |
integer |
The video size. |
123 |
| Duration |
number |
The video duration. Unit: seconds. |
123 |
| Title |
string |
The video title. |
Alibaba Cloud VOD Video Title |
| SpriteSnapshots |
array |
The list of sprites. |
|
|
string |
The list of sprites. |
{“http://example.aliyundoc.com/image02.jpg”} |
|
| Snapshots |
array |
The list of automatically captured snapshots. |
|
|
string |
The list of automatically captured snapshots. |
{“http://example.aliyundoc.com/image03.jpg”} |
|
| ReferenceId |
string |
The custom ID. It can contain lowercase letters, uppercase letters, digits, hyphens (-), and underscores (_). The ID must be 6 to 64 characters in length and unique for each user. |
123-123 |
| Audio |
object |
|
|
| Status |
string |
The status. Valid values:
|
Normal |
| CreationTime |
string |
The time when the audio was created. The time is in the yyyy-MM-ddTHH:mm:ssZ format in UTC. |
2018-07-19T03:45:25Z |
| StorageLocation |
string |
The storage region. |
outin-aaa*****aa.oss-cn-shanghai.aliyuncs.com |
| CateId |
integer |
The category ID. |
10000123 |
| Tags |
string |
The tags. |
tag1,tag2 |
| ModificationTime |
string |
The time when the audio was last updated. The time is in the yyyy-MM-ddTHH:mm:ssZ format in UTC. |
2018-07-19T03:48:25Z |
| MediaSource |
string |
The source. Valid values:
|
general |
| Description |
string |
The description. |
Alibaba Cloud VOD Audio Description |
| AppId |
string |
The application ID. |
app-**** |
| CoverURL |
string |
The thumbnail URL. |
http://example.com/image04.jpg |
| AudioId |
string |
The audio ID. |
a82a2cd7d4e147bbed6c1ee372**** |
| DownloadSwitch |
string |
The download switch. Offline download is allowed only when the switch is turned on. Valid values:
|
on |
| CateName |
string |
The category name. |
cate1 |
| TranscodeMode |
string |
The transcoding mode. Valid values:
|
FastTranscode |
| PreprocessStatus |
string |
The pre-processing status. Only pre-processed audio files can be used for live stream directing. Valid values:
|
UnPreprocess |
| RestoreExpiration |
string |
The expiration time of the restored media asset. |
2023-03-30T10:14:14Z |
| RestoreStatus |
string |
The restored state of the media asset. Valid values:
|
Success |
| StorageClass |
string |
The storage class of the media asset. Valid values:
|
Standard |
| Size |
integer |
The size. |
123 |
| Duration |
number |
The duration. |
123 |
| Title |
string |
The title. |
Alibaba Cloud VOD Audio Title |
| SpriteSnapshots |
array |
The list of sprites. |
|
|
string |
The list of sprites. |
{“http://example.aliyundoc.com/image02.jpg”} |
|
| Snapshots |
array |
The list of automatically captured snapshots. |
|
|
string |
The list of automatically captured snapshots. |
{“http://example.aliyundoc.com/image03.jpg”} |
|
| ReferenceId |
string |
The custom ID. It can contain lowercase letters, uppercase letters, digits, hyphens (-), and underscores (_). The ID must be 6 to 64 characters in length and unique for each user. |
123-123 |
| Image |
object |
|
|
| StorageLocation |
string |
The storage region. |
outin-bfefbb90a47c******163e1c7426.oss-cn-shanghai.aliyuncs.com |
| CreationTime |
string |
The time when the image was created. The time is in the yyyy-MM-ddTHH:mm:ssZ format in UTC. |
2018-07-19T03:45:25Z |
| Status |
string |
The image status.
|
Uploading |
| CateId |
integer |
The category ID. |
1000123 |
| Tags |
string |
The tags. |
tag1 |
| ModificationTime |
string |
The time when the image was last updated. The time is in the yyyy-MM-ddTHH:mm:ssZ format in UTC. |
2018-07-19T03:48:25Z |
| CateName |
string |
The category name. |
cate1 |
| Description |
string |
The description. |
Alibaba Cloud VOD Image Description |
| AppId |
string |
The application ID. |
app-**** |
| URL |
string |
The image URL. |
https://example.com/****.png |
| Title |
string |
The title. |
Alibaba Cloud VOD Image Title |
| ImageId |
string |
The image ID. |
11130843741se99wqmoes**** |
| AttachedMedia |
object |
|
|
| CreationTime |
string |
The time when the asset was created. The time is in the yyyy-MM-ddTHH:mm:ssZ format in UTC. |
2018-07-19T03:45:25Z |
| Status |
string |
The status. Valid values:
|
Normal |
| StorageLocation |
string |
The storage region. |
outin-bfefbb90a47c11*****7426.oss-cn-shanghai.aliyuncs.com |
| Tags |
string |
The tags. |
tag1 |
| ModificationTime |
string |
The time when the asset was last updated. The time is in the yyyy-MM-ddTHH:mm:ssZ format in UTC. |
2018-07-19T03:48:25Z |
| MediaId |
string |
The auxiliary media asset ID. |
a82a2cd7d4e147ba0ed6c1ee372**** |
| BusinessType |
string |
The business type. Valid values:
|
watermark |
| Description |
string |
The description. |
Alibaba Cloud VOD-assisted media asset description |
| AppId |
string |
The application ID. |
app-**** |
| URL |
string |
The URL of the auxiliary media asset. |
https://example.com/****.png |
| Title |
string |
The title. |
Alibaba Cloud VOD-assisted media asset Title |
| Categories |
array<object> |
The list of category IDs. |
|
|
object |
The category details. |
||
| ParentId |
integer |
The parent node ID. |
-1 |
| CateName |
string |
The category name. |
cate1 |
| CateId |
integer |
The category ID. |
10027394 |
| Level |
integer |
The category level. |
1 |
| AiData |
Detail AI. |
||
| AiRoughData |
Data ringkasan AI. |
Contoh
Respons sukses
JSONformat
{
"RequestId": "3E0CEF83-FB09-4E34-BA1451814B03****",
"Total": 10,
"ScrollToken": "24e0fba7188fae707e146esa54****",
"MediaList": [
{
"CreationTime": "2018-07-19T03:45:25Z",
"MediaType": "video",
"MediaId": "a82a2cd7d4e147bbed6c1ee372****",
"Video": {
"Status": "UploadSucc",
"CreationTime": "2018-07-19T03:45:25Z",
"StorageLocation": "outin-bfefbb90a47c******163e1c7426.oss-cn-shanghai.aliyuncs.com",
"CateId": 10000123,
"Tags": "tag1",
"ModificationTime": "2018-07-19T03:48:25Z",
"MediaSource": "general",
"Description": "Alibaba Cloud VOD video description",
"AppId": "app-****",
"CoverURL": "https://example.aliyundoc.com/image01.png",
"VideoId": "a82a2asdasqadaf3faa0ed6c1ee372****",
"DownloadSwitch": "on",
"CateName": "video1",
"TranscodeMode": "FastTranscode",
"PreprocessStatus": "Preprocessing",
"RestoreExpiration": "2023-03-30T10:14:14Z",
"RestoreStatus": "Success",
"StorageClass": "Standard",
"Size": 123,
"Duration": 123,
"Title": "Alibaba Cloud VOD Video Title",
"SpriteSnapshots": [
"{“http://example.aliyundoc.com/image02.jpg”}"
],
"Snapshots": [
"{“http://example.aliyundoc.com/image03.jpg”}"
],
"ReferenceId": "123-123"
},
"Audio": {
"Status": "Normal",
"CreationTime": "2018-07-19T03:45:25Z",
"StorageLocation": "outin-aaa*****aa.oss-cn-shanghai.aliyuncs.com",
"CateId": 10000123,
"Tags": "tag1,tag2",
"ModificationTime": "2018-07-19T03:48:25Z",
"MediaSource": "general",
"Description": "Alibaba Cloud VOD Audio Description",
"AppId": "app-****",
"CoverURL": "http://example.com/image04.jpg",
"AudioId": "a82a2cd7d4e147bbed6c1ee372****",
"DownloadSwitch": "on",
"CateName": "cate1",
"TranscodeMode": "FastTranscode",
"PreprocessStatus": "UnPreprocess",
"RestoreExpiration": "2023-03-30T10:14:14Z",
"RestoreStatus": "Success",
"StorageClass": "Standard",
"Size": 123,
"Duration": 123,
"Title": "Alibaba Cloud VOD Audio Title",
"SpriteSnapshots": [
"{“http://example.aliyundoc.com/image02.jpg”}"
],
"Snapshots": [
"{“http://example.aliyundoc.com/image03.jpg”}"
],
"ReferenceId": "123-123"
},
"Image": {
"StorageLocation": "outin-bfefbb90a47c******163e1c7426.oss-cn-shanghai.aliyuncs.com",
"CreationTime": "2018-07-19T03:45:25Z",
"Status": "Uploading",
"CateId": 1000123,
"Tags": "tag1",
"ModificationTime": "2018-07-19T03:48:25Z",
"CateName": "cate1",
"Description": "Alibaba Cloud VOD Image Description",
"AppId": "app-****",
"URL": "https://example.com/****.png",
"Title": "Alibaba Cloud VOD Image Title",
"ImageId": "11130843741se99wqmoes****"
},
"AttachedMedia": {
"CreationTime": "2018-07-19T03:45:25Z",
"Status": "Normal",
"StorageLocation": "outin-bfefbb90a47c11*****7426.oss-cn-shanghai.aliyuncs.com",
"Tags": "tag1",
"ModificationTime": "2018-07-19T03:48:25Z",
"MediaId": "a82a2cd7d4e147ba0ed6c1ee372****",
"BusinessType": "watermark",
"Description": "Alibaba Cloud VOD-assisted media asset description",
"AppId": "app-****",
"URL": "https://example.com/****.png",
"Title": "Alibaba Cloud VOD-assisted media asset Title",
"Categories": [
{
"ParentId": -1,
"CateName": "cate1",
"CateId": 10027394,
"Level": 1
}
]
}
}
]
}
Kode kesalahan
Lihat Error Codes untuk daftar lengkap.
Catatan rilis
Lihat Release Notes untuk daftar lengkap.