コード例 #1
0
        public async static Task <OneOneFiveFileListModel> GetMixedOneOneFileInFolder(string folder, int page = 0, int pageSize = 1150)
        {
            OneOneFiveFileListModel ret = new OneOneFiveFileListModel();

            var url = $"https://aps.115.com/natsort/files.php?aid=1&cid={folder}&o=file_name&asc=1&offset={page}&show_dir=1&limit={pageSize}&code=&scid=&snap=0&natsort=1&record_open_time=1&source=&format=json&fc_mix=0";

            var res = await GetOneOneFiveContent(url);

            if (!string.IsNullOrEmpty(res))
            {
                ret = JsonConvert.DeserializeObject <OneOneFiveFileListModel>(res);
            }

            return(ret);
        }
コード例 #2
0
        public async static Task <List <OneOneFiveFileItemModel> > Get115SearchFileResult(string content, string folder, bool searchAccurate, int offset = 0, int limit = 1050, OneOneFiveSearchType searchType = OneOneFiveSearchType.All)
        {
            OneOneFiveFileListModel temp = new OneOneFiveFileListModel();

            string resContent = "";

            var url = string.Format(string.Format($"https://webapi.115.com/files/search?search_value={content}&format=json&offset={offset}&limit={limit}&cid={folder}&type={(int)searchType}"));

            resContent = await GetOneOneFiveContent(url);

            if (!string.IsNullOrEmpty(resContent))
            {
                temp = JsonConvert.DeserializeObject <OneOneFiveFileListModel>(resContent);
            }


            return((temp == null || temp.data == null) ? null : searchAccurate?temp.data.Where(x => !string.IsNullOrEmpty(x.fid) && x.n.Contains(content, StringComparison.OrdinalIgnoreCase)).ToList() : temp.data);
        }