| 96 | return result |
| 97 | |
| 98 | def detailContent(self,array): |
| 99 | tid = array[0] |
| 100 | # shareId = self.regStr(href,'www.aliyundrive.com\\/s\\/([^\\/]+)(\\/folder\\/([^\\/]+))?') |
| 101 | # todo ========================================================================================= |
| 102 | m = re.search('www.aliyundrive.com\\/s\\/([^\\/]+)(\\/folder\\/([^\\/]+))?', tid) |
| 103 | col = m.groups() |
| 104 | shareId = col[0] |
| 105 | fileId = col[2] |
| 106 | |
| 107 | infoUrl = 'https://api.aliyundrive.com/adrive/v3/share_link/get_share_by_anonymous' |
| 108 | |
| 109 | infoForm = {'share_id':shareId} |
| 110 | infoRsp = requests.post(infoUrl,json = infoForm,headers=self.header) |
| 111 | infoJo = json.loads(infoRsp.text) |
| 112 | |
| 113 | infoJa = [] |
| 114 | if 'file_infos' in infoJo: |
| 115 | infoJa = infoJo['file_infos'] |
| 116 | if len(infoJa) <= 0 : |
| 117 | return '' |
| 118 | fileInfo = {} |
| 119 | # todo |
| 120 | fileInfo = infoJa[0] |
| 121 | print(fileId) |
| 122 | if fileId == None or len(fileId) <= 0: |
| 123 | fileId = fileInfo['file_id'] |
| 124 | |
| 125 | vodList = { |
| 126 | 'vod_id':tid, |
| 127 | 'vod_name':infoJo['share_name'], |
| 128 | 'vod_pic':infoJo['avatar'], |
| 129 | 'vod_content':tid, |
| 130 | 'vod_play_from':'AliYun$$$AliYun原画' |
| 131 | } |
| 132 | fileType = fileInfo['type'] |
| 133 | if fileType != 'folder': |
| 134 | if fileType != 'file' or fileInfo['category'] != video: |
| 135 | return '' |
| 136 | fileId = 'root' |
| 137 | |
| 138 | shareToken = self.getToken(shareId,'') |
| 139 | hashMap = {} |
| 140 | self.listFiles(hashMap,shareId,shareToken,fileId) |
| 141 | |
| 142 | sortedMap = sorted(hashMap.items(), key=lambda x: x[0]) |
| 143 | arrayList = [] |
| 144 | playList = [] |
| 145 | |
| 146 | for sm in sortedMap: |
| 147 | arrayList.append(sm[0]+'$'+sm[1]) |
| 148 | playList.append('#'.join(arrayList)) |
| 149 | playList.append('#'.join(arrayList)) |
| 150 | vodList['vod_play_url'] = '$$$'.join(playList) |
| 151 | |
| 152 | result = { |
| 153 | 'list':[vodList] |
| 154 | } |
| 155 | return result |