├── Media └── PlayParse │ ├── MediaPlayParse - AliyunDrive.as │ └── MediaPlayParse - AliyunDrive.ico ├── README.md ├── api.txt └── resources ├── 1.png ├── 2.png ├── 3.png └── 4.png /Media/PlayParse/MediaPlayParse - AliyunDrive.as: -------------------------------------------------------------------------------- 1 | /* 2 | Aliyun drive media parse 3 | */ 4 | 5 | // void OnInitialize() 6 | // void OnFinalize() 7 | // string GetTitle() -> get title for UI 8 | // string GetVersion -> get version for manage 9 | // string GetDesc() -> get detail information 10 | // string GetLoginTitle() -> get title for login dialog 11 | // string GetLoginDesc() -> get desc for login dialog 12 | // string GetUserText() -> get user text for login dialog 13 | // string GetPasswordText() -> get password text for login dialog 14 | // string ServerCheck(string User, string Pass) -> server check 15 | // string ServerLogin(string User, string Pass) -> login 16 | // void ServerLogout() -> logout 17 | //------------------------------------------------------------------------------------------------ 18 | // bool PlayitemCheck(const string &in) -> check playitem 19 | // array PlayitemParse(const string &in) -> parse playitem 20 | // bool PlaylistCheck(const string &in) -> check playlist 21 | // array PlaylistParse(const string &in) -> parse playlist 22 | 23 | string GetTitle() 24 | { 25 | return "Aliyun drive"; 26 | } 27 | 28 | string GetVersion() 29 | { 30 | return "1.1"; 31 | } 32 | 33 | string GetDesc() 34 | { 35 | return "https://www.aliyundrive.com/"; 36 | } 37 | 38 | bool PlayitemCheck(const string &in path) { 39 | return HostRegExpParse(path, "bj29.cn-beijing.data.alicloudccp.com/(.+)") != "" 40 | or HostRegExpParse(path, "cn-beijing-data.aliyundrive.net/(.+)") != ""; 41 | } 42 | 43 | string PlayitemParse(const string &in path, dictionary &MetaData, array &QualityList) { 44 | // HostOpenConsole(); 45 | HostPrintUTF8(path); 46 | 47 | string userAgent = 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.55 Safari/537.36 Edg/96.0.1054.34'; 48 | HostSetUrlUserAgentHTTP(path, userAgent); 49 | 50 | string header = 'Referer: https://www.aliyundrive.com/'; 51 | HostSetUrlHeaderHTTP(path, header); 52 | 53 | int index = path.findFirst("filename"); 54 | array substrs = path.substr(index).split("&"); 55 | 56 | if (substrs.length() == 0) { 57 | return path; 58 | } 59 | 60 | string filename = HostUrlDecode(HostUrlDecode(substrs[0]).substr(17)); 61 | 62 | MetaData['title'] = filename; 63 | HostPrintUTF8(filename); 64 | 65 | return path; 66 | } 67 | -------------------------------------------------------------------------------- /Media/PlayParse/MediaPlayParse - AliyunDrive.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gene9831/AliyunDrivePotPlayer/16c9457bf284201fa1d2b255407c678af0741d8c/Media/PlayParse/MediaPlayParse - AliyunDrive.ico -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # AliyunDrive 2 | 3 | ~~PotPlayer 在线播放阿里云盘视频外链(网页提取的阿里云盘外链已无法使用)~~ 4 | 5 | ## 前提 6 | 7 | 在网页上获取外链,点击安装 tampermonkey 脚本 [阿里云盘](https://greasyfork.org/zh-CN/scripts/425955-%E9%98%BF%E9%87%8C%E4%BA%91%E7%9B%98)(支持提取阿里云盘外链的脚本不止一个,这个只是我常用的) 8 | 9 | ## 使用 10 | 11 | - 下载此 repo 12 | - 解压 13 | - 将 Media 文件夹复制到 `c:\Program Files\DAUM\PotPlayer\Extension\` 或 `{PotPlayer_Folder}\Extension\` 14 | 15 | 然后直接使用 PotPlayer 打开链接(`Ctrl + U`)的功能播放外链即可 16 | 17 | ![PotPlayer](./resources/3.png) 18 | ![打开链接](./resources/4.png) 19 | 20 | 目前只支持链接域名 21 | 22 | - `bj29.cn-beijing.data.alicloudccp.com` 23 | - `cn-beijing-data.aliyundrive.net` 24 | 25 | ## TODO 26 | 27 | - [ ] 研究下 Potplayer 是否允许插件添加自己的配置,便于添加其他域名 28 | 29 | ## 如何实现 30 | 31 | 添加如下 http 请求头,使用任意支持添加 http 头的下载工具都可以下载 32 | 33 | ```http 34 | User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/99.0.4844.74 Safari/537.36 Edg/99.0.1150.55 35 | Referer: https://www.aliyundrive.com/ 36 | ``` 37 | -------------------------------------------------------------------------------- /api.txt: -------------------------------------------------------------------------------- 1 | Script engine is AngelScript(http://www.angelcode.com/angelscript/) 2 | 3 | ------------------------PotPlayer's builtin type--------------------------------- 4 | intptr 5 | int pointer 6 | 7 | uintptr 8 | unsigned pointer 9 | 10 | ------------------------PotPlayer's builtin API---------------------------------- 11 | 12 | int HostGetAPIVersion() 13 | Get API version 14 | 15 | void HostOpenConsole() 16 | Open debug console 17 | 18 | void HostPrintUTF8(const string &in) 19 | Print UTF8 string 20 | 21 | void HostPrintUTF16(const string &in) 22 | Print UTF16 string 23 | 24 | string HostGetVersion() 25 | Get PotPlayer's version 26 | 27 | bool HostCheckVersion(int major, int minor, int build) 28 | Check PotPlayer's version 29 | 30 | bool HostIsWin64() 31 | Check PotPlayer is 64bit build or not 32 | 33 | void HostSleep(int ms) 34 | win32 API Sleep() 35 | 36 | uint HostGetTickCount() 37 | win32 API GetTickCount() 38 | 39 | void HostIncTimeOut(int ms) 40 | Increase function timeout time. 41 | 42 | bool HostCheckMediaFile(const string &in filename, bool Video, bool Audio, bool Playlist) 43 | Check filename is Video or Audio or Playlist 44 | 45 | string HostGetTempFolder() 46 | Get temp folder 47 | 48 | string HostGetExtension(const string &in) 49 | Get file extension 50 | 51 | string HostMBCSToUTF8(const string &in) 52 | Convert multibyte to UTF8 53 | 54 | string HostMBCSToUTF16(const string &in) 55 | Convert multibyte to UTF16 56 | 57 | string HostUTF8ToMBCS(const string &in) 58 | Convert UTF8 to multibyte 59 | 60 | string HostUTF16ToMBCS(const string &in) 61 | Convert UTF16 to multibyte 62 | 63 | string HostUTF8ToUTF16(const string &in) 64 | Convert UTF8 to UTF16 65 | 66 | string HostUTF16ToUTF8(const string &in) 67 | Convert UTF16 to UTF8 68 | 69 | string HostUrlGetString(const string &in url, const string &in UserAgent = "", const string &in Header = "", const string &in PostData = "", bool NoCookie = false) 70 | Get or Post HTTP(S) resource 71 | 72 | string HostUrlGetStringWithAPI(const string &in url, const string &in UserAgent = "", const string &in Header = "", const string &in PostData = "", bool NoCookie = false) 73 | Get or Post HTTP(S) resource with API key 74 | 75 | uintptr HostOpenHTTP(const string &in url, const string &in UserAgent = "", const string &in Header = "", const string &in PostData = "", bool NoCookie = false) 76 | Open Get or Post HTTP(S) resource 77 | 78 | uintptr HostOpenHTTPWithAPI(const string &in url, const string &in UserAgent = "", const string &in Header = "", const string &in PostData = "", bool NoCookie = false) 79 | Open Get or Post HTTP(S) resource with API key 80 | 81 | string HostGetContentHTTP(uintptr http) 82 | Get Content data 83 | 84 | string HostGetHeaderHTTP(uintptr http) 85 | Get Header data 86 | 87 | int HostGetStatusHTTP(uintptr http) 88 | Get HTTP status code 89 | 90 | void HostCloseHTTP(uintptr http) 91 | Close http 92 | 93 | uintptr HostFileOpen(const string &in filename) 94 | Open local file 95 | 96 | void HostFileClose(uintptr fp) 97 | Close local file 98 | 99 | int64 HostFileSeek(uintptr fp, int64 offset, int from = 0) 100 | Seek file's position 101 | 102 | int64 HostFileLength(uintptr fp) 103 | Get file length 104 | 105 | uint8 HostFileReadBYTE(uintptr fp) 106 | Read uint8 107 | 108 | uint16 HostFileReadWORD(uintptr fp) 109 | Read uint16 110 | 111 | uint32 HostFileReadDWORD(uintptr fp) 112 | Read uint32 113 | 114 | uint64 HostFileReadQWORD(uintptr fp) 115 | Read uint64 116 | 117 | string HostFileRead(uintptr fp, int len) 118 | Read string by len 119 | 120 | string HostUrlEncode(const string &in url) 121 | Encode Url escape 122 | 123 | string HostUrlDecode(const string &in url) 124 | Decode Url escape 125 | 126 | string HostBase64Enc(const string &in data) 127 | Encode BASE 64 128 | 129 | string HostBase64Dec(const string &in data) 130 | Decode BASE 64 131 | 132 | string HostDecompress(const string &in data) 133 | Decompress data(zip or etc...) 134 | 135 | string HostGzipCompress(const string &in data) 136 | Compress Gzip 137 | 138 | string HostGzipDeflate(const string &in data) 139 | Compress Gzip Deflate 140 | 141 | string HostHashMD5(const string &in data) 142 | Get MD5 143 | 144 | string HostHashSHA(const string &in data) 145 | Get SHA 146 | 147 | string HostHashSHA1(const string &in data) 148 | Get SHA1 149 | 150 | string HostHashSHA256(const string &in data) 151 | Get SHA 256 152 | 153 | string HostHashSHA384(const string &in data) 154 | Get SHA 384 155 | 156 | string HostHashSHA512(const string &in data) 157 | Get SHA 512 158 | 159 | bool HostCompareMovieName(const string &in filename1, const string &in filename2) 160 | Compare filename1 with filename2 161 | 162 | bool HostSaveString(const string &in key, const string &in val) 163 | Save key, value string to temp storage 164 | 165 | string HostLoadString(const string &in key, const string &in def = "") 166 | Load temp key, value string from temp storage 167 | 168 | bool HostSaveInteger(const string &in key, int value) 169 | Save key, value integer to temp storage 170 | 171 | string int HostLoadInteger(const string &in, int def = 0) 172 | Load temp key, value integer from temp storage 173 | 174 | string HostIso639LangName() 175 | Get current ISO639 Language name 176 | 177 | string HostIso3166CtryName() 178 | Get current ISO 3166 country name 179 | 180 | string HostRegExpParse(const string &in str, const string &in pattern) 181 | const std::regex regex(pattern); 182 | std::cmatch match; 183 | 184 | if (std::regex_search(str, match, regex) && match.size() == 2) 185 | { 186 | return std::string(match[1].first, match[1].length()); 187 | } 188 | 189 | return ""; 190 | 191 | bool HostRegExpParse(const string &in str, const string &in pattern, array &dic) 192 | const std::regex regex(pattern); 193 | std::cmatch match; 194 | bool ret = std::regex_search(str, match, regex); 195 | 196 | if (ret) 197 | { 198 | assign match -> dic ... "first" and "second" 199 | } 200 | return ret; 201 | 202 | string HostFixFileName(const string &in filename) 203 | Fix file for create 204 | 205 | uintptr HostLoadLibrary(const string &in filename) 206 | win32 API LoadLibrary() 207 | 208 | uintptr HostGetProcAddress(uintptr dll, const string &in symbol) 209 | win32 API GetProcAddress() 210 | 211 | void HostFreeLibrary(uintptr dll) 212 | win32 API FreeLibrary() 213 | 214 | void HostCallProcAsync(uintptr proc, const string &in paramSig, uint64 param1 = 0, uint64 param2 = 0, uint64 param3 = 0, uint64 param4 = 0, uint64 param5 = 0, uint64 param6 = 0) 215 | int HostCallProcInt(uintptr proc, const string &in paramSig, uint64 param1 = 0, uint64 param2 = 0, uint64 param3 = 0, uint64 param4 = 0, uint64 param5 = 0, uint64 param6 = 0) 216 | uintptr HostCallProcUIntPtr(uintptr proc, const string &in paramSig, uint64 param1 = 0, uint64 param2 = 0, uint64 param3 = 0, uint64 param4 = 0, uint64 param5 = 0, uint64 param6 = 0) 217 | uint64 HostCallProcUInt64(uintptr proc, const string &in paramSig, uint64 param1 = 0, uint64 param2 = 0, uint64 param3 = 0, uint64 param4 = 0, uint64 param5 = 0, uint64 param6 = 0) 218 | call dll's function 219 | paramSig -> P: Pointer, Q: int64, W: int16, B: int8, else int32 etc) "PQWI" -> Function(Pointer, int64, int16, int32); 220 | HostCallProcAsync -> Async call 221 | 222 | uintptr HostInt2UIntPtr(const int &var) 223 | uintptr HostUInt2UIntPtr(const int &var) 224 | uintptr HostString2UIntPtr(const string &in var) 225 | Get var's pointer 226 | 227 | string HostUIntPtr2String(uintptr ptr) 228 | C string(char *) to script string 229 | 230 | void HostSetUrlUserAgentHTTP(const string &url, const string &userAgent) 231 | Set useragent for HTTP url 232 | 233 | void HostSetUrlHeaderHTTP(const string &url, const string &header) 234 | Set http header for HTTP url 235 | 236 | 237 | ------------------------PotPlayer's builtin class---------------------------------- 238 | ------------------------string 239 | int replace(const string &in from, const string &in to) const 240 | string Right(int Count) const 241 | string Left(int Count) const 242 | string TrimRight(const string &in str = "") const 243 | string TrimLeft(const string &in = "") const 244 | string Trim(const string &in = "") const 245 | string MakeLower() const 246 | string MakeUpper() const 247 | 248 | 249 | ------------------------jsoncpp 250 | ------JsonValue 251 | bool isNull() 252 | bool isBool() 253 | bool isInt() 254 | bool isUInt() 255 | bool isInt64() 256 | bool isUInt64() 257 | bool isFloat() 258 | bool isDouble() 259 | bool isNumeric() 260 | bool isString() 261 | bool isArray() 262 | bool isObject() 263 | bool canString() 264 | int asInt() 265 | uint asUInt() 266 | int64 asInt64() 267 | uint64 asUInt64() 268 | float asFloat() 269 | double asDouble() 270 | bool asBool() 271 | string asString() 272 | int size() 273 | array @getKeys() const 274 | [int] 275 | [string] 276 | 277 | ------JsonReader 278 | bool parse(string &in json, JsonValue &out root) 279 | 280 | ------------------------tinyxml2 281 | ------XMLAttribute 282 | bool isValid() 283 | bool isBool() 284 | bool isInt() 285 | bool isUInt() 286 | bool isInt64() 287 | bool isDouble() 288 | bool isFloat() 289 | int asInt(int defaultValue = 0) 290 | uint asUInt(uint defaultValue = 0) 291 | int64 asInt64(int64 defaultValue = 0) 292 | float asFloat(float defaultValue = 0) 293 | double asDouble(double defaultValue = 0) 294 | bool asBool(bool defaultValue = false) 295 | string asString() 296 | string Name() 297 | string Value() 298 | XMLAttribute Next() 299 | 300 | ------XMLElement 301 | bool isValid(const string &in name = "") 302 | bool isBool(const string &in name = "") 303 | bool isInt(const string &in name = "") 304 | bool isUInt(const string &in name = "") 305 | bool isInt64(const string &in name = "") 306 | bool isDouble(const string &in name = "") 307 | bool isFloat(const string &in name = "") 308 | int asInt(const string &in name = "", int defaultValue = 0) 309 | uint asUInt(const string &in name = "", uint defaultValue = 0) 310 | int64 asInt64(const string &in name = "", int64 defaultValue = 0) 311 | float asFloat(const string &in name = "", float defaultValue = 0) 312 | double asDouble(const string &in name = "", double defaultValue = 0) 313 | bool asBool(const string &in name = "", bool defaultValue = false) 314 | string asString(const string &in name = "") 315 | string Name() 316 | string Value() 317 | string Attribute(const string &in name, const string &in value = "") 318 | XMLAttribute FindAttribute(const string &in name) 319 | XMLAttribute FirstAttribute() 320 | XMLElement FirstChildElement(const string &in name = "") 321 | XMLElement NextSiblingElement() 322 | 323 | ------XMLDocument 324 | bool Parse(string &in xml) 325 | XMLElement FirstChildElement(string &in name = "") 326 | XMLElement RootElement() 327 | 328 | ------------------------TimXmlRpc 329 | ------XmlRpcValue 330 | bool isNull() 331 | bool isBool() 332 | bool isInt() 333 | bool isDouble() 334 | bool isString() 335 | bool isArray() 336 | bool isObject() 337 | bool canString() 338 | int asInt() 339 | double asDouble() 340 | bool asBool() 341 | string asString() 342 | int size() 343 | [int] 344 | [string] 345 | 346 | ------XmlRpcClient 347 | bool execute(const string &in cmd, const XmlRpcValue &in param, XmlRpcValue &out result) 348 | 349 | -------------------------------------------------------------------------------- /resources/1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gene9831/AliyunDrivePotPlayer/16c9457bf284201fa1d2b255407c678af0741d8c/resources/1.png -------------------------------------------------------------------------------- /resources/2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gene9831/AliyunDrivePotPlayer/16c9457bf284201fa1d2b255407c678af0741d8c/resources/2.png -------------------------------------------------------------------------------- /resources/3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gene9831/AliyunDrivePotPlayer/16c9457bf284201fa1d2b255407c678af0741d8c/resources/3.png -------------------------------------------------------------------------------- /resources/4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gene9831/AliyunDrivePotPlayer/16c9457bf284201fa1d2b255407c678af0741d8c/resources/4.png --------------------------------------------------------------------------------