class Program { static string regionId = "cn-shanghai"; static string accessKeyId = "accessKeyId"; static string accessKeySecret = "accessKeySecret";
static void Main(string[] args) { DelMediaAliyunUrlByVideoId(); } public static void DelMediaAliyunUrlByVideoId() { IClientProfile profile = DefaultProfile.GetProfile(regionId, accessKeyId, accessKeySecret); DefaultAcsClient client = new DefaultAcsClient(profile); GetVideoListRequest requestZM = new GetVideoListRequest(); requestZM.PageNo = 1; requestZM.PageSize = 100; var videoRespones = client.GetAcsResponse(requestZM);//分页获取视频资源 foreach (var item in videoRespones.VideoList) { if (item.Status== "Uploading") { DeleteVideoRequest requestDE = new DeleteVideoRequest(); requestDE.VideoIds = item.VideoId; var video_DELETE_Respones = client.GetAcsResponse(requestDE);//根据VideoId删除视频资源 if (video_DELETE_Respones.HttpResponse.Status == 200) { } } } } }