(self,id)
| 68 | } |
| 69 | return result |
| 70 | def subtitleContent(self,id): |
| 71 | ids = id.split('+') |
| 72 | shareId = ids[0] |
| 73 | shareToken = ids[1] |
| 74 | fileId = ids[2] |
| 75 | category = ids[3] |
| 76 | subtitle = ids[4] |
| 77 | if len(subtitle) == 0: |
| 78 | return "" |
| 79 | |
| 80 | customHeader = self.header.copy() |
| 81 | customHeader['x-share-token'] = shareToken |
| 82 | customHeader['authorization'] = self.authorization |
| 83 | |
| 84 | jo = { |
| 85 | "expire_sec": 600, |
| 86 | "share_id": shareId, |
| 87 | "file_id": subtitle, |
| 88 | "image_url_process": "image/resize,w_1920/format,jpeg", |
| 89 | "image_thumbnail_process": "image/resize,w_1920/format,jpeg", |
| 90 | "get_streams_url": True |
| 91 | # , |
| 92 | # "drive_id": "183237630" |
| 93 | } |
| 94 | |
| 95 | downloadUrl = 'https://api.aliyundrive.com/v2/file/get_share_link_download_url' |
| 96 | resultJo = requests.post(downloadUrl,json = jo,headers=customHeader).json() |
| 97 | print(resultJo) |
| 98 | noRsp = requests.get(resultJo['download_url'],headers=self.header, allow_redirects=False,verify = False) |
| 99 | realUrl = '' |
| 100 | if 'Location' in noRsp.headers: |
| 101 | realUrl = noRsp.headers['Location'] |
| 102 | if 'location' in noRsp.headers and len(realUrl) == 0 : |
| 103 | realUrl = noRsp.headers['location'] |
| 104 | return realUrl |
| 105 | |
| 106 | def originContent(self,flag,id,vipFlags): |
| 107 | if not self.login(): |
no test coverage detected