| 127 | return result |
| 128 | |
| 129 | def detailContent(self,array): |
| 130 | tid = array[0] |
| 131 | m = re.search('www.aliyundrive.com\\/s\\/([^\\/]+)(\\/folder\\/([^\\/]+))?', tid) |
| 132 | col = m.groups() |
| 133 | shareId = col[0] |
| 134 | fileId = col[2] |
| 135 | |
| 136 | infoUrl = 'https://api.aliyundrive.com/adrive/v3/share_link/get_share_by_anonymous' |
| 137 | |
| 138 | infoForm = {'share_id':shareId} |
| 139 | infoRsp = requests.post(infoUrl,json = infoForm,headers=self.header) |
| 140 | infoJo = json.loads(infoRsp.text) |
| 141 | |
| 142 | infoJa = [] |
| 143 | if 'file_infos' in infoJo: |
| 144 | infoJa = infoJo['file_infos'] |
| 145 | if len(infoJa) <= 0 : |
| 146 | return '' |
| 147 | fileInfo = {} |
| 148 | |
| 149 | fileInfo = infoJa[0] |
| 150 | |
| 151 | if fileId == None or len(fileId) <= 0: |
| 152 | fileId = fileInfo['file_id'] |
| 153 | |
| 154 | vodList = { |
| 155 | 'vod_id':tid, |
| 156 | 'vod_name':infoJo['share_name'], |
| 157 | 'vod_pic':infoJo['avatar'], |
| 158 | 'vod_content':tid, |
| 159 | 'vod_play_from':'AliYun$$$AliYun原画' |
| 160 | } |
| 161 | fileType = fileInfo['type'] |
| 162 | if fileType != 'folder': |
| 163 | if fileType != 'file' or fileInfo['category'] != video: |
| 164 | return '' |
| 165 | fileId = 'root' |
| 166 | |
| 167 | shareToken = self.getToken(shareId,'') |
| 168 | hashMap = {} |
| 169 | self.listFiles(hashMap,shareId,shareToken,fileId) |
| 170 | |
| 171 | sortedMap = sorted(hashMap.items(), key=lambda x: x[0]) |
| 172 | arrayList = [] |
| 173 | playList = [] |
| 174 | |
| 175 | for sm in sortedMap: |
| 176 | arrayList.append(sm[0]+'$'+sm[1]) |
| 177 | playList.append('#'.join(arrayList)) |
| 178 | playList.append('#'.join(arrayList)) |
| 179 | vodList['vod_play_url'] = '$$$'.join(playList) |
| 180 | |
| 181 | result = { |
| 182 | 'list':[vodList] |
| 183 | } |
| 184 | return result |
| 185 | |
| 186 | authorization = '' |