All Products
Search
Document Center

ApsaraVideo VOD:Download media files

Last Updated:May 27, 2026

Download audio, video, and image files from VOD for media asset management, content delivery, or offline playback. Obtain download URLs through the console, API/SDK, or mobile player SDK.

Scenarios

  • Download from the console: Suitable for quick validation or temporary export of a small number of files.

  • Download using an API: Suitable for automated batch processing of files.

  • Download offline using a player SDK: Suitable for custom application scenarios.

Scenario 1: Download from the console

Download a single file

The console is ideal for downloading a few files for quick validation or testing.

  1. Log on to the ApsaraVideo VOD console.

  2. In the left navigation pane, choose Media Files > Audio/Video.

  3. Find the target file, click Manage in the Actions column, select the Video URL or Audio URL tab, then click Copy for the desired definition.

  4. Paste the copied URL into a browser or download tool to start the download.

Download multiple files

Use the batch export feature to export media asset information for multiple files.

  1. Log on to the ApsaraVideo VOD console.

  2. In the left navigation pane, choose Media Files, then select Audio/Video or Image.

  3. Use the filter or search feature to locate and select the files to export.

  4. Click the image icon in the upper-right corner to export the media asset information.

  5. Paste the URLs for the media assets into a browser or download tool to start the download.

Scenario 2: Download using an API

Obtain download URLs

Use the following APIs to obtain download URLs for source files, transcoded files, and thumbnails.

Media asset type

API

Address field

Description

Source file

Obtaining source file information

Mezzanine.FileURL

The original audio or video file that was uploaded.

Transcoded file

Obtain the audio and video (playback) URL

PlayInfoList.PlayInfo.PlayURL

The URL of the transcoded stream.

Video thumbnail

Retrieve single audio/video information

Video.CoverURL

The thumbnail image of the video.

Video snapshot

Retrieve metadata for a single audio or video file

Video.Snapshots

An array of snapshot URLs for the video.

Image file

GetImageInfo

ImageInfo.URL

The URL of the image.

Obtain download URLs in batches

Address Type

Obtain API

Address field

Description

Batch search

Search for media information

MediaList.Video/Audio/Image

Searches across multiple media types. Returns all URL types listed above.

Note

Use a server-side SDK to call APIs to retrieve and update media asset information. VOD SDK usage guide.

Perform the download operation

The following Python SDK example automates the download. Additional examples are available in the OpenAPI Portal.

  1. Prepare the environment.

    Install the VOD Python SDK.

    pip install aliyun-python-sdk-vod
  2. Obtain the download URL.

    Call the GetMezzanineInfo operation to retrieve the source file information.

    import json
    from aliyunsdkcore.client import AcsClient
    from aliyunsdkvod.request.v20170321 import GetMezzanineInfoRequest
    
    # Initialize the client
    # Replace with your AccessKey ID, AccessKey secret, and region ID
    client = AcsClient('YOUR_ACCESS_KEY_ID', 'YOUR_ACCESS_KEY_SECRET', 'cn-shanghai')
    
    # 1. Create a request
    request = GetMezzanineInfoRequest()
    request.set_accept_format('json')
    request.set_VideoId("YOUR_VIDEO_ID") # Replace with your video ID
    request.set_OutputType("oss")  # Recommended: Returns the OSS storage address for lower cost
    request.set_AuthTimeout(3600)  # Set the URL validity period to 1 hour (3600 seconds)
    
    # 2. Send the request and get the response
    response = client.do_action_with_exception(request)
    result = json.loads(response)
    
    # 3. Parse the download URL
    download_url = result['Mezzanine']['FileURL']
    print(f"Source file download URL: {download_url}")
    
    # (Optional) Use the requests library to download the file
    import requests
    print("Starting file download...")
    file_response = requests.get(download_url, stream=True)
    if file_response.status_code == 200:
        with open('downloaded_video.mp4', 'wb') as f:
            for chunk in file_response.iter_content(chunk_size=8192):
                f.write(chunk)
        print("File downloaded successfully: downloaded_video.mp4")
    else:
        print(f"Download failed, status code: {file_response.status_code}")
        print(f"Error message: {file_response.text}")

Scenario 3: Download offline using a player SDK

VOD supports caching videos locally on mobile devices for offline viewing in two modes: standard download and secure download.

  • Standard download: The video is not encrypted and can be copied and played by any player. Suitable for public content or low-copyright scenarios.

  • Secure download: The video is encrypted and can only be played by an ApsaraVideo Player SDK integrated with the matching key. Suitable for paid courses and copyright-sensitive content.

Steps

  1. Configure the download mode.

    1. Log on to the ApsaraVideo VOD console. Go to Configuration Management > CDN Configuration > Download Settings.

    2. Select standard or secure download. For secure download, generate and securely store the encryption key on this page.

  2. Integrate the player SDK.

    Integrate the ApsaraVideo Player SDK into your Android or iOS project: Integrate the Android SDK, Integrate the iOS SDK.

  3. Complete the video download.

    Integrate the video download module into your Android or iOS project: Video download for Android, Video download for iOS.

Billing

Download URLs fall into two categories:

FAQ

Why can't I play the downloaded video?

If the transcoded output uses encryption (such as HLS encryption), the downloaded file remains encrypted. Use the ApsaraVideo Player SDK to decrypt and play it. Video encryption.

How do I download many media files?

Use SearchMedia - Search Media Information with paging to retrieve file URLs, then follow Scenario 2: Download via API to download.