├── .DS_Store ├── Aria2 ├── AUTHORS ├── COPYING ├── ChangeLog ├── HideRun.vbs ├── LICENSE.OpenSSL ├── NEWS ├── README.html ├── README.md ├── README.mingw ├── aria2.conf ├── aria2c.exe └── start.bat ├── BaiduExporter-master ├── .DS_Store ├── .circleci │ ├── config.yml │ └── pack ├── .github │ ├── CONTRIBUTING.md │ └── issue_template.md ├── BaiduExporter.crx ├── LICENSE ├── README.md ├── aria2c │ ├── HideRun.vbs │ ├── README.md │ ├── aria2.conf │ └── start.bat └── chrome │ ├── .eslintrc.json │ ├── .gitignore │ ├── .stylelintrc.json │ ├── _locales │ ├── en │ │ └── messages.json │ └── zh_CN │ │ └── messages.json │ ├── background.js │ ├── gulpfile.js │ ├── manifest.json │ ├── package-lock.json │ ├── package.json │ ├── release │ ├── _locales │ │ ├── en │ │ │ └── messages.json │ │ └── zh_CN │ │ │ └── messages.json │ ├── background.js │ ├── css │ │ └── style.css │ ├── img │ │ ├── BaiduExplorerIcon.svg │ │ ├── logo128.png │ │ ├── logo16.png │ │ ├── logo32.png │ │ ├── logo48.png │ │ └── logo64.png │ ├── js │ │ ├── baidu.js │ │ ├── home.js │ │ ├── share.js │ │ └── start.js │ └── manifest.json │ ├── src │ ├── css │ │ ├── captcha.scss │ │ ├── export.scss │ │ ├── lib │ │ │ └── share.scss │ │ ├── modal.scss │ │ └── setting.scss │ ├── img │ │ ├── BaiduExplorerIcon.svg │ │ ├── icon.jpg │ │ ├── logo128.png │ │ ├── logo16.png │ │ ├── logo32.png │ │ ├── logo48.png │ │ └── logo64.png │ └── js │ │ ├── baidu.js │ │ ├── home.js │ │ ├── lib │ │ ├── EventEmitter.js │ │ ├── core.js │ │ ├── downloader.js │ │ ├── store.js │ │ └── ui.js │ │ ├── share.js │ │ └── start.js │ └── updates.xml ├── README.md ├── Tampermonkey.crx └── wechat.jpg /.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itgoyo/Aria2/0a6ce51d65c8d290ca20e06d1ca761cb49bb27b6/.DS_Store -------------------------------------------------------------------------------- /Aria2/AUTHORS: -------------------------------------------------------------------------------- 1 | Tatsuhiro Tsujikawa 2 | Ross Smith II (Windows port) 3 | Nils Maier 4 | -------------------------------------------------------------------------------- /Aria2/COPYING: -------------------------------------------------------------------------------- 1 | GNU GENERAL PUBLIC LICENSE 2 | Version 2, June 1991 3 | 4 | Copyright (C) 1989, 1991 Free Software Foundation, Inc. 5 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 6 | Everyone is permitted to copy and distribute verbatim copies 7 | of this license document, but changing it is not allowed. 8 | 9 | Preamble 10 | 11 | The licenses for most software are designed to take away your 12 | freedom to share and change it. By contrast, the GNU General Public 13 | License is intended to guarantee your freedom to share and change free 14 | software--to make sure the software is free for all its users. This 15 | General Public License applies to most of the Free Software 16 | Foundation's software and to any other program whose authors commit to 17 | using it. (Some other Free Software Foundation software is covered by 18 | the GNU Library General Public License instead.) You can apply it to 19 | your programs, too. 20 | 21 | When we speak of free software, we are referring to freedom, not 22 | price. Our General Public Licenses are designed to make sure that you 23 | have the freedom to distribute copies of free software (and charge for 24 | this service if you wish), that you receive source code or can get it 25 | if you want it, that you can change the software or use pieces of it 26 | in new free programs; and that you know you can do these things. 27 | 28 | To protect your rights, we need to make restrictions that forbid 29 | anyone to deny you these rights or to ask you to surrender the rights. 30 | These restrictions translate to certain responsibilities for you if you 31 | distribute copies of the software, or if you modify it. 32 | 33 | For example, if you distribute copies of such a program, whether 34 | gratis or for a fee, you must give the recipients all the rights that 35 | you have. You must make sure that they, too, receive or can get the 36 | source code. And you must show them these terms so they know their 37 | rights. 38 | 39 | We protect your rights with two steps: (1) copyright the software, and 40 | (2) offer you this license which gives you legal permission to copy, 41 | distribute and/or modify the software. 42 | 43 | Also, for each author's protection and ours, we want to make certain 44 | that everyone understands that there is no warranty for this free 45 | software. If the software is modified by someone else and passed on, we 46 | want its recipients to know that what they have is not the original, so 47 | that any problems introduced by others will not reflect on the original 48 | authors' reputations. 49 | 50 | Finally, any free program is threatened constantly by software 51 | patents. We wish to avoid the danger that redistributors of a free 52 | program will individually obtain patent licenses, in effect making the 53 | program proprietary. To prevent this, we have made it clear that any 54 | patent must be licensed for everyone's free use or not licensed at all. 55 | 56 | The precise terms and conditions for copying, distribution and 57 | modification follow. 58 | 59 | GNU GENERAL PUBLIC LICENSE 60 | TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 61 | 62 | 0. This License applies to any program or other work which contains 63 | a notice placed by the copyright holder saying it may be distributed 64 | under the terms of this General Public License. The "Program", below, 65 | refers to any such program or work, and a "work based on the Program" 66 | means either the Program or any derivative work under copyright law: 67 | that is to say, a work containing the Program or a portion of it, 68 | either verbatim or with modifications and/or translated into another 69 | language. (Hereinafter, translation is included without limitation in 70 | the term "modification".) Each licensee is addressed as "you". 71 | 72 | Activities other than copying, distribution and modification are not 73 | covered by this License; they are outside its scope. The act of 74 | running the Program is not restricted, and the output from the Program 75 | is covered only if its contents constitute a work based on the 76 | Program (independent of having been made by running the Program). 77 | Whether that is true depends on what the Program does. 78 | 79 | 1. You may copy and distribute verbatim copies of the Program's 80 | source code as you receive it, in any medium, provided that you 81 | conspicuously and appropriately publish on each copy an appropriate 82 | copyright notice and disclaimer of warranty; keep intact all the 83 | notices that refer to this License and to the absence of any warranty; 84 | and give any other recipients of the Program a copy of this License 85 | along with the Program. 86 | 87 | You may charge a fee for the physical act of transferring a copy, and 88 | you may at your option offer warranty protection in exchange for a fee. 89 | 90 | 2. You may modify your copy or copies of the Program or any portion 91 | of it, thus forming a work based on the Program, and copy and 92 | distribute such modifications or work under the terms of Section 1 93 | above, provided that you also meet all of these conditions: 94 | 95 | a) You must cause the modified files to carry prominent notices 96 | stating that you changed the files and the date of any change. 97 | 98 | b) You must cause any work that you distribute or publish, that in 99 | whole or in part contains or is derived from the Program or any 100 | part thereof, to be licensed as a whole at no charge to all third 101 | parties under the terms of this License. 102 | 103 | c) If the modified program normally reads commands interactively 104 | when run, you must cause it, when started running for such 105 | interactive use in the most ordinary way, to print or display an 106 | announcement including an appropriate copyright notice and a 107 | notice that there is no warranty (or else, saying that you provide 108 | a warranty) and that users may redistribute the program under 109 | these conditions, and telling the user how to view a copy of this 110 | License. (Exception: if the Program itself is interactive but 111 | does not normally print such an announcement, your work based on 112 | the Program is not required to print an announcement.) 113 | 114 | These requirements apply to the modified work as a whole. If 115 | identifiable sections of that work are not derived from the Program, 116 | and can be reasonably considered independent and separate works in 117 | themselves, then this License, and its terms, do not apply to those 118 | sections when you distribute them as separate works. But when you 119 | distribute the same sections as part of a whole which is a work based 120 | on the Program, the distribution of the whole must be on the terms of 121 | this License, whose permissions for other licensees extend to the 122 | entire whole, and thus to each and every part regardless of who wrote it. 123 | 124 | Thus, it is not the intent of this section to claim rights or contest 125 | your rights to work written entirely by you; rather, the intent is to 126 | exercise the right to control the distribution of derivative or 127 | collective works based on the Program. 128 | 129 | In addition, mere aggregation of another work not based on the Program 130 | with the Program (or with a work based on the Program) on a volume of 131 | a storage or distribution medium does not bring the other work under 132 | the scope of this License. 133 | 134 | 3. You may copy and distribute the Program (or a work based on it, 135 | under Section 2) in object code or executable form under the terms of 136 | Sections 1 and 2 above provided that you also do one of the following: 137 | 138 | a) Accompany it with the complete corresponding machine-readable 139 | source code, which must be distributed under the terms of Sections 140 | 1 and 2 above on a medium customarily used for software interchange; or, 141 | 142 | b) Accompany it with a written offer, valid for at least three 143 | years, to give any third party, for a charge no more than your 144 | cost of physically performing source distribution, a complete 145 | machine-readable copy of the corresponding source code, to be 146 | distributed under the terms of Sections 1 and 2 above on a medium 147 | customarily used for software interchange; or, 148 | 149 | c) Accompany it with the information you received as to the offer 150 | to distribute corresponding source code. (This alternative is 151 | allowed only for noncommercial distribution and only if you 152 | received the program in object code or executable form with such 153 | an offer, in accord with Subsection b above.) 154 | 155 | The source code for a work means the preferred form of the work for 156 | making modifications to it. For an executable work, complete source 157 | code means all the source code for all modules it contains, plus any 158 | associated interface definition files, plus the scripts used to 159 | control compilation and installation of the executable. However, as a 160 | special exception, the source code distributed need not include 161 | anything that is normally distributed (in either source or binary 162 | form) with the major components (compiler, kernel, and so on) of the 163 | operating system on which the executable runs, unless that component 164 | itself accompanies the executable. 165 | 166 | If distribution of executable or object code is made by offering 167 | access to copy from a designated place, then offering equivalent 168 | access to copy the source code from the same place counts as 169 | distribution of the source code, even though third parties are not 170 | compelled to copy the source along with the object code. 171 | 172 | 4. You may not copy, modify, sublicense, or distribute the Program 173 | except as expressly provided under this License. Any attempt 174 | otherwise to copy, modify, sublicense or distribute the Program is 175 | void, and will automatically terminate your rights under this License. 176 | However, parties who have received copies, or rights, from you under 177 | this License will not have their licenses terminated so long as such 178 | parties remain in full compliance. 179 | 180 | 5. You are not required to accept this License, since you have not 181 | signed it. However, nothing else grants you permission to modify or 182 | distribute the Program or its derivative works. These actions are 183 | prohibited by law if you do not accept this License. Therefore, by 184 | modifying or distributing the Program (or any work based on the 185 | Program), you indicate your acceptance of this License to do so, and 186 | all its terms and conditions for copying, distributing or modifying 187 | the Program or works based on it. 188 | 189 | 6. Each time you redistribute the Program (or any work based on the 190 | Program), the recipient automatically receives a license from the 191 | original licensor to copy, distribute or modify the Program subject to 192 | these terms and conditions. You may not impose any further 193 | restrictions on the recipients' exercise of the rights granted herein. 194 | You are not responsible for enforcing compliance by third parties to 195 | this License. 196 | 197 | 7. If, as a consequence of a court judgment or allegation of patent 198 | infringement or for any other reason (not limited to patent issues), 199 | conditions are imposed on you (whether by court order, agreement or 200 | otherwise) that contradict the conditions of this License, they do not 201 | excuse you from the conditions of this License. If you cannot 202 | distribute so as to satisfy simultaneously your obligations under this 203 | License and any other pertinent obligations, then as a consequence you 204 | may not distribute the Program at all. For example, if a patent 205 | license would not permit royalty-free redistribution of the Program by 206 | all those who receive copies directly or indirectly through you, then 207 | the only way you could satisfy both it and this License would be to 208 | refrain entirely from distribution of the Program. 209 | 210 | If any portion of this section is held invalid or unenforceable under 211 | any particular circumstance, the balance of the section is intended to 212 | apply and the section as a whole is intended to apply in other 213 | circumstances. 214 | 215 | It is not the purpose of this section to induce you to infringe any 216 | patents or other property right claims or to contest validity of any 217 | such claims; this section has the sole purpose of protecting the 218 | integrity of the free software distribution system, which is 219 | implemented by public license practices. Many people have made 220 | generous contributions to the wide range of software distributed 221 | through that system in reliance on consistent application of that 222 | system; it is up to the author/donor to decide if he or she is willing 223 | to distribute software through any other system and a licensee cannot 224 | impose that choice. 225 | 226 | This section is intended to make thoroughly clear what is believed to 227 | be a consequence of the rest of this License. 228 | 229 | 8. If the distribution and/or use of the Program is restricted in 230 | certain countries either by patents or by copyrighted interfaces, the 231 | original copyright holder who places the Program under this License 232 | may add an explicit geographical distribution limitation excluding 233 | those countries, so that distribution is permitted only in or among 234 | countries not thus excluded. In such case, this License incorporates 235 | the limitation as if written in the body of this License. 236 | 237 | 9. The Free Software Foundation may publish revised and/or new versions 238 | of the General Public License from time to time. Such new versions will 239 | be similar in spirit to the present version, but may differ in detail to 240 | address new problems or concerns. 241 | 242 | Each version is given a distinguishing version number. If the Program 243 | specifies a version number of this License which applies to it and "any 244 | later version", you have the option of following the terms and conditions 245 | either of that version or of any later version published by the Free 246 | Software Foundation. If the Program does not specify a version number of 247 | this License, you may choose any version ever published by the Free Software 248 | Foundation. 249 | 250 | 10. If you wish to incorporate parts of the Program into other free 251 | programs whose distribution conditions are different, write to the author 252 | to ask for permission. For software which is copyrighted by the Free 253 | Software Foundation, write to the Free Software Foundation; we sometimes 254 | make exceptions for this. Our decision will be guided by the two goals 255 | of preserving the free status of all derivatives of our free software and 256 | of promoting the sharing and reuse of software generally. 257 | 258 | NO WARRANTY 259 | 260 | 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY 261 | FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN 262 | OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES 263 | PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED 264 | OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 265 | MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS 266 | TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE 267 | PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, 268 | REPAIR OR CORRECTION. 269 | 270 | 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 271 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR 272 | REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, 273 | INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING 274 | OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED 275 | TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY 276 | YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER 277 | PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE 278 | POSSIBILITY OF SUCH DAMAGES. 279 | 280 | END OF TERMS AND CONDITIONS 281 | 282 | How to Apply These Terms to Your New Programs 283 | 284 | If you develop a new program, and you want it to be of the greatest 285 | possible use to the public, the best way to achieve this is to make it 286 | free software which everyone can redistribute and change under these terms. 287 | 288 | To do so, attach the following notices to the program. It is safest 289 | to attach them to the start of each source file to most effectively 290 | convey the exclusion of warranty; and each file should have at least 291 | the "copyright" line and a pointer to where the full notice is found. 292 | 293 | 294 | Copyright (C) 295 | 296 | This program is free software; you can redistribute it and/or modify 297 | it under the terms of the GNU General Public License as published by 298 | the Free Software Foundation; either version 2 of the License, or 299 | (at your option) any later version. 300 | 301 | This program is distributed in the hope that it will be useful, 302 | but WITHOUT ANY WARRANTY; without even the implied warranty of 303 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 304 | GNU General Public License for more details. 305 | 306 | You should have received a copy of the GNU General Public License 307 | along with this program; if not, write to the Free Software 308 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 309 | 310 | 311 | Also add information on how to contact you by electronic and paper mail. 312 | 313 | If the program is interactive, make it output a short notice like this 314 | when it starts in an interactive mode: 315 | 316 | Gnomovision version 69, Copyright (C) year name of author 317 | Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 318 | This is free software, and you are welcome to redistribute it 319 | under certain conditions; type `show c' for details. 320 | 321 | The hypothetical commands `show w' and `show c' should show the appropriate 322 | parts of the General Public License. Of course, the commands you use may 323 | be called something other than `show w' and `show c'; they could even be 324 | mouse-clicks or menu items--whatever suits your program. 325 | 326 | You should also get your employer (if you work as a programmer) or your 327 | school, if any, to sign a "copyright disclaimer" for the program, if 328 | necessary. Here is a sample; alter the names: 329 | 330 | Yoyodyne, Inc., hereby disclaims all copyright interest in the program 331 | `Gnomovision' (which makes passes at compilers) written by James Hacker. 332 | 333 | , 1 April 1989 334 | Ty Coon, President of Vice 335 | 336 | This General Public License does not permit incorporating your program into 337 | proprietary programs. If your program is a subroutine library, you may 338 | consider it more useful to permit linking proprietary applications with the 339 | library. If this is what you want to do, use the GNU Library General 340 | Public License instead of this License. 341 | -------------------------------------------------------------------------------- /Aria2/ChangeLog: -------------------------------------------------------------------------------- 1 | commit f0f1b8ef47c391550ff99982f1cad3dd4e1d410d (HEAD, tag: release-1.21.0) 2 | Author: Tatsuhiro Tsujikawa 3 | AuthorDate: 2016-03-15 4 | Commit: Tatsuhiro Tsujikawa 5 | CommitDate: 2016-03-15 6 | 7 | clang-format-3.6 8 | 9 | commit 6e884bea6300bb1110577a87b9512ddd1739b40c 10 | Author: Tatsuhiro Tsujikawa 11 | AuthorDate: 2016-03-15 12 | Commit: Tatsuhiro Tsujikawa 13 | CommitDate: 2016-03-15 14 | 15 | Bump up version number to 1.21.0 16 | 17 | commit 1da03c7b7922ccc7119be32508c8707245eb011d 18 | Author: Tatsuhiro Tsujikawa 19 | AuthorDate: 2016-03-15 20 | Commit: Tatsuhiro Tsujikawa 21 | CommitDate: 2016-03-15 22 | 23 | Update NEWS 24 | 25 | commit 18bda5516eb33a4fbfe191db8191f372620ddb6c 26 | Author: Tatsuhiro Tsujikawa 27 | AuthorDate: 2016-03-13 28 | Commit: Tatsuhiro Tsujikawa 29 | CommitDate: 2016-03-13 30 | 31 | Update third party libraries used in binary distributions 32 | 33 | commit 4595aa75e17884f36982e9ba2d56c24725d30538 34 | Author: Tatsuhiro Tsujikawa 35 | AuthorDate: 2016-03-13 36 | Commit: Tatsuhiro Tsujikawa 37 | CommitDate: 2016-03-13 38 | 39 | SessionSerializer: Fix bug that pause=true is added to wrong item 40 | 41 | This change also defers writing metadata download to the location 42 | where first its follower download is written. 43 | 44 | commit 1a0e5e32f3291e79908edfab584f38cb9bd652c4 45 | Merge: 21754fa e9b94ec 46 | Author: Tatsuhiro Tsujikawa 47 | AuthorDate: 2016-03-06 48 | Commit: Tatsuhiro Tsujikawa 49 | CommitDate: 2016-03-06 50 | 51 | Merge pull request #586 from ITriskTI/patch-1 52 | 53 | Update aria2c.rst 54 | 55 | commit e9b94ecffd1b1cd656025e3f7c7f5a9d2543633e 56 | Author: ITriskTI 57 | AuthorDate: 2016-03-06 58 | Commit: ITriskTI 59 | CommitDate: 2016-03-06 60 | 61 | Update aria2c.rst 62 | 63 | commit 21754fa103647395b3eeb100506ce1b12aaed60a 64 | Author: Tatsuhiro Tsujikawa 65 | AuthorDate: 2016-03-05 66 | Commit: Tatsuhiro Tsujikawa 67 | CommitDate: 2016-03-05 68 | 69 | Add following to aria2.tellStatus response key as reverse link for followedBy 70 | 71 | commit 74811ddaff123e331368f69d93de4c9741f82fee 72 | Author: Tatsuhiro Tsujikawa 73 | AuthorDate: 2016-03-03 74 | Commit: Tatsuhiro Tsujikawa 75 | CommitDate: 2016-03-03 76 | 77 | mingw: Add warning for falloc 78 | 79 | commit e6e3cd2e325d24137eb3bc328768d2f4377e89af 80 | Author: Nils Maier 81 | AuthorDate: 2016-03-03 82 | Commit: Nils Maier 83 | CommitDate: 2016-03-03 84 | 85 | Allow to run clang-format with external build dir 86 | 87 | commit fc490ac05cc575113bfcdd154af5b01e9398999a 88 | Author: Nils Maier 89 | AuthorDate: 2016-01-12 90 | Commit: Nils Maier 91 | CommitDate: 2016-03-03 92 | 93 | Update ciphers in AppleTLS 94 | 95 | Also enable fast start while at it 96 | 97 | commit ba7315b76da2229246456bb8419c812014a4f48c 98 | Author: Nils Maier 99 | AuthorDate: 2016-03-03 100 | Commit: Nils Maier 101 | CommitDate: 2016-03-03 102 | 103 | Remove universal build 104 | 105 | It's kinda broken and interfering with libssh2 106 | 107 | commit c1dbd9f6a53304c0d0c17fdc9e1ce0da9cb743cc 108 | Author: Nils Maier 109 | AuthorDate: 2016-03-03 110 | Commit: Nils Maier 111 | CommitDate: 2016-03-03 112 | 113 | Enable libssh2 and sftp 114 | 115 | Closes GH-468 116 | 117 | commit 7d88ef6606d5a75e47034f879f60198101c99b0e 118 | Author: Nils Maier 119 | AuthorDate: 2016-03-03 120 | Commit: Nils Maier 121 | CommitDate: 2016-03-03 122 | 123 | Update OSX dependencies 124 | 125 | Closes GH-466 126 | 127 | commit 981597bc544f7cce6db53747311a8e62f11dd30a 128 | Author: Nils Maier 129 | AuthorDate: 2016-03-03 130 | Commit: Nils Maier 131 | CommitDate: 2016-03-03 132 | 133 | Force libc++ 134 | 135 | commit 99e7d981935b40330786d47e769cc49c061ccec9 136 | Author: Tatsuhiro Tsujikawa 137 | AuthorDate: 2016-03-02 138 | Commit: Tatsuhiro Tsujikawa 139 | CommitDate: 2016-03-02 140 | 141 | Fix sqlite3 download URI 142 | 143 | commit 8985d66e71f980e7d2765753800078f47761f1ba 144 | Author: Tatsuhiro Tsujikawa 145 | AuthorDate: 2016-02-23 146 | Commit: Tatsuhiro Tsujikawa 147 | CommitDate: 2016-02-23 148 | 149 | Fix compile error without TLS support 150 | 151 | commit a82db8e4626a1551e0c89301ac1d47db2bbcfa03 152 | Merge: b090946 c275b6f 153 | Author: Tatsuhiro Tsujikawa 154 | AuthorDate: 2016-02-18 155 | Commit: Tatsuhiro Tsujikawa 156 | CommitDate: 2016-02-18 157 | 158 | Merge branch 'athmane-master' 159 | 160 | commit c275b6f297a50801cb4cc7b343d1a7b3d8871262 161 | Author: Athmane Madjoudj 162 | AuthorDate: 2016-02-17 163 | Commit: Athmane Madjoudj 164 | CommitDate: 2016-02-17 165 | 166 | Remove trailing spaces 167 | 168 | commit 1849ccfbba57038f1fa57fd0621b80e77a198a4c 169 | Author: Athmane Madjoudj 170 | AuthorDate: 2016-02-17 171 | Commit: Athmane Madjoudj 172 | CommitDate: 2016-02-17 173 | 174 | Add support for using gnutls system wide crypto policy 175 | -------------------------------------------------------------------------------- /Aria2/HideRun.vbs: -------------------------------------------------------------------------------- 1 | CreateObject("WScript.Shell").Run "aria2c.exe --conf-path=aria2.conf",0 -------------------------------------------------------------------------------- /Aria2/LICENSE.OpenSSL: -------------------------------------------------------------------------------- 1 | Certain source files in this program permit linking with the OpenSSL 2 | library (http://www.openssl.org), which otherwise wouldn't be allowed 3 | under the GPL. For purposes of identifying OpenSSL, most source files 4 | giving this permission limit it to versions of OpenSSL having a license 5 | identical to that listed in this file (LICENSE.OpenSSL). It is not 6 | necessary for the copyright years to match between this file and the 7 | OpenSSL version in question. However, note that because this file is 8 | an extension of the license statements of these source files, this file 9 | may not be changed except with permission from all copyright holders 10 | of source files in this program which reference this file. 11 | 12 | 13 | LICENSE ISSUES 14 | ============== 15 | 16 | The OpenSSL toolkit stays under a dual license, i.e. both the conditions of 17 | the OpenSSL License and the original SSLeay license apply to the toolkit. 18 | See below for the actual license texts. Actually both licenses are BSD-style 19 | Open Source licenses. In case of any license issues related to OpenSSL 20 | please contact openssl-core@openssl.org. 21 | 22 | OpenSSL License 23 | --------------- 24 | 25 | /* ==================================================================== 26 | * Copyright (c) 1998-2001 The OpenSSL Project. All rights reserved. 27 | * 28 | * Redistribution and use in source and binary forms, with or without 29 | * modification, are permitted provided that the following conditions 30 | * are met: 31 | * 32 | * 1. Redistributions of source code must retain the above copyright 33 | * notice, this list of conditions and the following disclaimer. 34 | * 35 | * 2. Redistributions in binary form must reproduce the above copyright 36 | * notice, this list of conditions and the following disclaimer in 37 | * the documentation and/or other materials provided with the 38 | * distribution. 39 | * 40 | * 3. All advertising materials mentioning features or use of this 41 | * software must display the following acknowledgment: 42 | * "This product includes software developed by the OpenSSL Project 43 | * for use in the OpenSSL Toolkit. (http://www.openssl.org/)" 44 | * 45 | * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to 46 | * endorse or promote products derived from this software without 47 | * prior written permission. For written permission, please contact 48 | * openssl-core@openssl.org. 49 | * 50 | * 5. Products derived from this software may not be called "OpenSSL" 51 | * nor may "OpenSSL" appear in their names without prior written 52 | * permission of the OpenSSL Project. 53 | * 54 | * 6. Redistributions of any form whatsoever must retain the following 55 | * acknowledgment: 56 | * "This product includes software developed by the OpenSSL Project 57 | * for use in the OpenSSL Toolkit (http://www.openssl.org/)" 58 | * 59 | * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY 60 | * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 61 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 62 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR 63 | * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 64 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 65 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 66 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 67 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 68 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 69 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED 70 | * OF THE POSSIBILITY OF SUCH DAMAGE. 71 | * ==================================================================== 72 | * 73 | * This product includes cryptographic software written by Eric Young 74 | * (eay@cryptsoft.com). This product includes software written by Tim 75 | * Hudson (tjh@cryptsoft.com). 76 | * 77 | */ 78 | 79 | Original SSLeay License 80 | ----------------------- 81 | 82 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 83 | * All rights reserved. 84 | * 85 | * This package is an SSL implementation written 86 | * by Eric Young (eay@cryptsoft.com). 87 | * The implementation was written so as to conform with Netscapes SSL. 88 | * 89 | * This library is free for commercial and non-commercial use as long as 90 | * the following conditions are aheared to. The following conditions 91 | * apply to all code found in this distribution, be it the RC4, RSA, 92 | * lhash, DES, etc., code; not just the SSL code. The SSL documentation 93 | * included with this distribution is covered by the same copyright terms 94 | * except that the holder is Tim Hudson (tjh@cryptsoft.com). 95 | * 96 | * Copyright remains Eric Young's, and as such any Copyright notices in 97 | * the code are not to be removed. 98 | * If this package is used in a product, Eric Young should be given attribution 99 | * as the author of the parts of the library used. 100 | * This can be in the form of a textual message at program startup or 101 | * in documentation (online or textual) provided with the package. 102 | * 103 | * Redistribution and use in source and binary forms, with or without 104 | * modification, are permitted provided that the following conditions 105 | * are met: 106 | * 1. Redistributions of source code must retain the copyright 107 | * notice, this list of conditions and the following disclaimer. 108 | * 2. Redistributions in binary form must reproduce the above copyright 109 | * notice, this list of conditions and the following disclaimer in the 110 | * documentation and/or other materials provided with the distribution. 111 | * 3. All advertising materials mentioning features or use of this software 112 | * must display the following acknowledgement: 113 | * "This product includes cryptographic software written by 114 | * Eric Young (eay@cryptsoft.com)" 115 | * The word 'cryptographic' can be left out if the rouines from the library 116 | * being used are not cryptographic related :-). 117 | * 4. If you include any Windows specific code (or a derivative thereof) from 118 | * the apps directory (application code) you must include an acknowledgement: 119 | * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" 120 | * 121 | * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND 122 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 123 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 124 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 125 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 126 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 127 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 128 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 129 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 130 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 131 | * SUCH DAMAGE. 132 | * 133 | * The licence and distribution terms for any publically available version or 134 | * derivative of this code cannot be changed. i.e. this code cannot simply be 135 | * copied and put under another distribution licence 136 | * [including the GNU Public Licence.] 137 | */ 138 | -------------------------------------------------------------------------------- /Aria2/NEWS: -------------------------------------------------------------------------------- 1 | aria2 1.21.0 2 | ============ 3 | 4 | Release Note 5 | ------------ 6 | 7 | This release fixes several bugs, see the Changes for details. We 8 | added "following" key to the response of aria2.tellStatus RPC method 9 | as reverse link for followedBy. 10 | 11 | Changes 12 | ------- 13 | 14 | * SessionSerializer: Fix bug that pause=true is added to wrong item 15 | 16 | This change also defers writing metadata download to the location 17 | where first its follower download is written. 18 | 19 | * Add "following" to aria2.tellStatus response key as reverse link for 20 | followedBy 21 | 22 | * mingw: Add warning for falloc 23 | 24 | * Update ciphers in AppleTLS 25 | 26 | Also enable fast start while at it 27 | 28 | * OSX: Enable libssh2 and sftp 29 | 30 | Closes GH-468 31 | 32 | * Update OSX dependencies 33 | 34 | Closes GH-466 35 | 36 | * Fix compile error without TLS support 37 | 38 | * Add support for using gnutls system wide crypto policy 39 | 40 | Patch from Athmane Madjoudj 41 | -------------------------------------------------------------------------------- /Aria2/README.md: -------------------------------------------------------------------------------- 1 | # Aria2 for windows 2 | 3 | 关于aria2在Windows下的配置大家一直很有疑问,所以我还是写点东西方便大家使用比较好 4 | 5 | ## Download 6 | - 目前下载已经转移到Github上进行版本发布了,大家可以在[Release](https://github.com/tatsuhiro-t/aria2/releases/)下下载自己电脑对应的版本. 7 | 8 | ## Usage 9 | - 直接运行exe只会闪现一个黑框消失,无法正常使用的,必须使用脚本进行启动. 10 | - 拷贝这个目录下的配置文件和脚本文件,和下载解压缩的aria2c.exe放在同一个目录下. 11 | - 点击 `start.bat`可以直接运行,但是会有一个命令行窗口,不能关闭,关闭也就意味着程序的退出 12 | - 点击 `HideRun.vbs`也会直接运行,但是没有任何反应,因为隐藏窗口了,可以在任务管理器的进程窗口里看到程序的运行 13 | 14 | 15 | ##配置 16 | 17 | - 默认配置已经够用了,不过方便大家,还是讲解下常用的几个参数吧. 18 | - 配置文件里面的 `#`符号代表注释,如果使用这个符号那么那一行的设置就不会生效,想启用设置必须先把前面的`#`号删除 19 | - 一般情况下要根据自己的需求设置下载路径也就是`dir`这个参数,注意这里一定得写绝对路径 20 | - 首先是 `rpc-user`和`rpc-passwd`很明显这个需要一起使用,这是旧的加密方式.如果启用的话RPC路径就变成 `http://username:passwd@hostname:port/jsonrpc` 这种格式了(不推荐使用这个格式) 21 | - 其次是`rpc-secret`,使用这个设置加密路径的话,RPC格式就是`http://token:secret@hostname:port/jsonrpc`这样 22 | - 如果只是在自己电脑上使用的话,没必要启用任何加密方式,默认的就行.这样RPC路径就是`http://localhost:6800/jsonrpc` -------------------------------------------------------------------------------- /Aria2/README.mingw: -------------------------------------------------------------------------------- 1 | aria2 Windows build 2 | =================== 3 | 4 | aria2 Windows build is provided in 2 flavors: 32bit version and 64bit 5 | version. The executable was compiled using mingw-w64 cross compiler on 6 | Debian Linux. 7 | 8 | * gcc-mingw-w64 5.2.1-26+16 9 | * binutils-mingw-w64-i686 2.25.90.20151209-1+6.5+b1 10 | * binutils-mingw-w64-x86-64 2.25.90.20151209-1+6.5+b1 11 | 12 | The executable is statically linked, so no extra DLLs are 13 | necessary. The linked libraries are: 14 | 15 | * gmp 6.1.0 16 | * expat 2.1.0 17 | * sqlite 3.10.2 18 | * zlib 1.2.8 19 | * c-ares 1.11.0 20 | * libssh2 1.7.0 21 | 22 | This build has the following difference from the original release: 23 | 24 | * 32bit version only: ``--disable-ipv6`` is enabled by default. (In 25 | other words, IPv6 support is disabled by default). 26 | 27 | Known Issues 28 | ------------ 29 | 30 | * --file-allocation=falloc uses SetFileValidData function to allocate 31 | disk space without filling zero. But it has security 32 | implications. Refer to 33 | https://msdn.microsoft.com/en-us/library/windows/desktop/aa365544%28v=vs.85%29.aspx 34 | for more details. 35 | 36 | * When Ctrl-C is pressed, aria2 shows "Shutdown sequence 37 | commencing... Press Ctrl-C again for emergency shutdown." But 38 | mingw32 build cannot handle second Ctrl-C properly. The second 39 | Ctrl-C just kills aria2 instantly without proper shutdown sequence 40 | and you may lose data. So don't press Ctrl-C twice. 41 | 42 | * --daemon option doesn't work. 43 | 44 | * 32bit version only: When ``--disable-ipv6=false`` is given, 45 | BitTorrent DHT may not work properly. 46 | 47 | * 32bit version only: Most of the IPv6 functionality does not work 48 | even if ``--disable-ipv6=false`` is given. 49 | 50 | References 51 | ---------- 52 | 53 | * http://smithii.com/aria2 54 | * http://kemovitra.blogspot.com/2009/12/download-aria2-163.html 55 | -------------------------------------------------------------------------------- /Aria2/aria2.conf: -------------------------------------------------------------------------------- 1 | #用户名 2 | #rpc-user=user 3 | #密码 4 | #rpc-passwd=passwd 5 | #设置加密的密钥 6 | #rpc-secret=secret 7 | #允许rpc 8 | enable-rpc=true 9 | #允许所有来源, web界面跨域权限需要 10 | rpc-allow-origin-all=true 11 | #是否启用https加密,启用之后要设置公钥,私钥的文件路径 12 | #rpc-secure=true 13 | #启用加密设置公钥 14 | #rpc-certificate=/home/name/.config/aria2/example.crt 15 | #启用加密设置私钥 16 | #rpc-private-key=/home/name/.config/aria2/example.key 17 | #允许外部访问,false的话只监听本地端口 18 | rpc-listen-all=true 19 | #RPC端口, 仅当默认端口被占用时修改 20 | #rpc-listen-port=6800 21 | #最大同时下载数(任务数), 路由建议值: 3 22 | max-concurrent-downloads=5 23 | #断点续传 24 | continue=true 25 | #同服务器连接数 26 | max-connection-per-server=5 27 | #最小文件分片大小, 下载线程数上限取决于能分出多少片, 对于小文件重要 28 | min-split-size=10M 29 | #单文件最大线程数, 路由建议值: 5 30 | split=10 31 | #下载速度限制 32 | max-overall-download-limit=0 33 | #单文件速度限制 34 | max-download-limit=0 35 | #上传速度限制 36 | max-overall-upload-limit=0 37 | #单文件速度限制 38 | max-upload-limit=0 39 | #断开速度过慢的连接 40 | #lowest-speed-limit=0 41 | #验证用,需要1.16.1之后的release版本 42 | #referer=* 43 | #文件保存路径, 默认为当前启动位置 44 | dir=D:\Downloads 45 | #文件缓存, 使用内置的文件缓存, 如果你不相信Linux内核文件缓存和磁盘内置缓存时使用, 需要1.16及以上版本 46 | #disk-cache=0 47 | #另一种Linux文件缓存方式, 使用前确保您使用的内核支持此选项, 需要1.15及以上版本(?) 48 | #enable-mmap=true 49 | #文件预分配, 能有效降低文件碎片, 提高磁盘性能. 缺点是预分配时间较长 50 | #所需时间 none < falloc ? trunc << prealloc, falloc和trunc需要文件系统和内核支持 51 | file-allocation=prealloc 52 | #不进行证书校验 53 | check-certificate=false -------------------------------------------------------------------------------- /Aria2/aria2c.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itgoyo/Aria2/0a6ce51d65c8d290ca20e06d1ca761cb49bb27b6/Aria2/aria2c.exe -------------------------------------------------------------------------------- /Aria2/start.bat: -------------------------------------------------------------------------------- 1 | aria2c.exe --conf=aria2.conf -------------------------------------------------------------------------------- /BaiduExporter-master/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itgoyo/Aria2/0a6ce51d65c8d290ca20e06d1ca761cb49bb27b6/BaiduExporter-master/.DS_Store -------------------------------------------------------------------------------- /BaiduExporter-master/.circleci/config.yml: -------------------------------------------------------------------------------- 1 | version: 2 2 | 3 | defaults: &defaults 4 | working_directory: ~/project/BaiduExporter 5 | docker: 6 | - image: circleci/node:6-browsers 7 | 8 | jobs: 9 | install: 10 | <<: *defaults 11 | steps: 12 | - checkout 13 | - restore_cache: 14 | keys: 15 | - node-chache-{{ .Branch }}-{{ checksum "chrome/package-lock.json" }} 16 | - run: npm --prefix chrome/ install 17 | - save_cache: 18 | key: node-chache-{{ .Branch }}-{{ checksum "chrome/package-lock.json" }} 19 | paths: 20 | - chrome/node_modules/ 21 | - persist_to_workspace: 22 | root: ~/project 23 | paths: 24 | - BaiduExporter 25 | 26 | build: 27 | <<: *defaults 28 | steps: 29 | - attach_workspace: 30 | at: ~/project 31 | 32 | - run: 33 | name: install dependency 34 | command: | 35 | sudo apt-get update 36 | sudo apt-get install -y vim-common 37 | sudo apt-get install -y libpng-dev 38 | - run: npm --prefix chrome/ run build 39 | - run: echo -e $KEY > /tmp/key.pem 40 | - run: .circleci/pack chrome/dist/ /tmp/key.pem 41 | - run: rm -rf chrome/release/ 42 | - run: mv chrome/dist/ chrome/release/ 43 | - run: 44 | name: Avoid hosts unknown for github 45 | command: mkdir ~/.ssh/ && echo -e "Host github.com\n\tStrictHostKeyChecking no\n" > ~/.ssh/config 46 | - run: | 47 | git config --global user.email "acgotaku311@gmail.com" 48 | git config --global user.name "acgotaku311" 49 | git add BaiduExporter.crx 50 | git add chrome/release/ 51 | git commit -m "[ci skip] update chrome.crx and release" 52 | git push -u origin master 53 | 54 | test: 55 | <<: *defaults 56 | steps: 57 | - attach_workspace: 58 | at: ~/project 59 | - run: 60 | name: check PR 61 | command: | 62 | if [[ ! -z $CIRCLE_PULL_REQUEST ]]; then 63 | npm --prefix chrome/ run test 64 | fi 65 | 66 | workflows: 67 | version: 2 68 | install_and_test: 69 | jobs: 70 | - install 71 | - build: 72 | requires: 73 | - install 74 | filters: 75 | branches: 76 | only: 77 | - master 78 | - test: 79 | requires: 80 | - install 81 | -------------------------------------------------------------------------------- /BaiduExporter-master/.circleci/pack: -------------------------------------------------------------------------------- 1 | #!/bin/bash -e 2 | 3 | if test $# -ne 2; then 4 | echo "Usage: crxmake.sh " 5 | exit 1 6 | fi 7 | 8 | dir=$1 9 | key=$2 10 | name="BaiduExporter" 11 | crx="$name.crx" 12 | pub="$name.pub" 13 | sig="$name.sig" 14 | zip="$name.zip" 15 | trap 'rm -f "$pub" "$sig" "$zip"' EXIT 16 | 17 | # zip up the crx dir 18 | cwd=$(pwd -P) 19 | (cd "$dir" && zip -qr -9 -X "$cwd/$zip" .) 20 | 21 | # signature 22 | openssl sha1 -sha1 -binary -sign "$key" < "$zip" > "$sig" 23 | 24 | # public key 25 | openssl rsa -pubout -outform DER < "$key" > "$pub" 2>/dev/null 26 | 27 | byte_swap () { 28 | # Take "abcdefgh" and return it as "ghefcdab" 29 | echo "${1:6:2}${1:4:2}${1:2:2}${1:0:2}" 30 | } 31 | 32 | crmagic_hex="4372 3234" # Cr24 33 | version_hex="0200 0000" # 2 34 | pub_len_hex=$(byte_swap $(printf '%08x\n' $(ls -l "$pub" | awk '{print $5}'))) 35 | sig_len_hex=$(byte_swap $(printf '%08x\n' $(ls -l "$sig" | awk '{print $5}'))) 36 | ( 37 | echo "$crmagic_hex $version_hex $pub_len_hex $sig_len_hex" | xxd -r -p 38 | cat "$pub" "$sig" "$zip" 39 | ) > "$crx" 40 | echo "Wrote $crx" 41 | -------------------------------------------------------------------------------- /BaiduExporter-master/.github/CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # BaiduExporter Contributing Guide 2 | 3 | Before contributing to BaiduExporter, please make sure to take a moment and read through the following guidelines. 4 | 5 | - [JavaScript Standard Style](https://standardjs.com/) 6 | - [Sass Guidelines](https://sass-guidelin.es/) 7 | 8 | 9 | ## Development Setup 10 | 11 | Please make sure your [Node.js](http://nodejs.org) **version 6+**. 12 | 13 | After cloning the repo, run: 14 | 15 | ``` bash 16 | $ cd chrome 17 | $ npm install 18 | $ npm run dev 19 | ``` 20 | 21 | Now, you can load extension from `dist` fold. Gulp will watch and re-build the project. 22 | 23 | If you want to package the extension. run: 24 | 25 | ``` bash 26 | $ npm run build 27 | ``` 28 | 29 | Gulp will generate compressed file in `dist` fold. 30 | -------------------------------------------------------------------------------- /BaiduExporter-master/.github/issue_template.md: -------------------------------------------------------------------------------- 1 | 请确保以下几点: 2 | 3 | 1. 已经阅读过README 4 | 2. 尝试安装最新版本插件 5 | 3. 尝试清空浏览器缓存 6 | 4. 尝试卸载插件后重新安装 7 | 8 | 发起 Issue 时,请提供: 9 | 10 | 1. 您下载的内容地址 11 | 2. 插件版本号,浏览器版本号,系统版本号 12 | 3. 列举出现问题的详细步骤 13 | 4. 描述能否复现问题 14 | 15 | ---------- 16 | 17 | **不符合上述条件的Issue将被无理由关闭** 18 | -------------------------------------------------------------------------------- /BaiduExporter-master/BaiduExporter.crx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itgoyo/Aria2/0a6ce51d65c8d290ca20e06d1ca761cb49bb27b6/BaiduExporter-master/BaiduExporter.crx -------------------------------------------------------------------------------- /BaiduExporter-master/README.md: -------------------------------------------------------------------------------- 1 | # BaiduExporter [![Build Status](https://img.shields.io/circleci/project/acgotaku/BaiduExporter/master.svg)](https://circleci.com/gh/acgotaku/BaiduExporter/tree/master) 2 | 3 | 可以方便的把百度网盘的下载地址导出到 aria2/aria2-rpc,支持 YAAW。 4 | 5 | ## Usage 6 | 7 | - 非SVIP用户下载分享文件须先将文件保存到自己网盘以获得较快的下载速度。 8 | - 插件的设置必须保存之后才会生效。 9 | - 推荐设置: 10 | - Set `--rpc-secret=` if you are using aria2 1.18.4(or higher) with 'JSON-RPC PATH' like http://token:secret@hostname:port/jsonrpc 11 | - Set `--rpc-user= --rpc-passwd=` if you are using aria2 1.15.2(or higher) with 'JSON-RPC PATH' like http://username:passwd@hostname:port/jsonrpc 12 | - Use `http://localhost:6800/jsonrpc#max-connection-per-server=5&split=10` set download options for specific file. 13 | - 已上传 Aria2 配置文件方便大家使用:[aria2.conf](https://raw.githubusercontent.com/acgotaku/BaiduExporter/master/aria2c/aria2.conf) 14 | - Aria2 配置参考我的博客:[使用 Aria2 下载百度网盘和 115 的资源](https://blog.icehoney.me/posts/2015-01-31-Aria2-download)。 15 | 16 | ## Install 17 | 18 | * Chrome : Click **Settings** -> **Extensions**, drag `BaiduExporter.crx` file to the page, install it, or check **Developer mode** -> **Load unpacked extension**, navigate to the `chrome/release` folder. 19 | * Firefox : Open **about:debugging** in Firefox, click "Load Temporary Add-on" and navigate to the `chrome/release` folder, select `manifest.json`, click OK. 20 | ## Contribution 21 | 22 | Please make sure to read the [Contributing Guide](https://github.com/acgotaku/BaiduExporter/blob/master/.github/CONTRIBUTING.md) before making a pull request. 23 | 24 | ## Issue 须知 25 | 26 | 请先阅读[这里](https://github.com/acgotaku/BaiduExporter/issues/128) 27 | 28 | ## Thanks 29 | 30 | - Icon by [Losses Don](https://github.com/Losses) 31 | 32 | ## Tips 33 | 34 | 不想每次开启Chrome都提示禁用请看这个帖子:[Guide on Packaging and Import Baidu Exporter to Chrome](https://hencolle.com/2016/10/16/baidu_exporter/) 35 | 36 | ## License 37 | 38 | ![GPLv3](https://www.gnu.org/graphics/gplv3-127x51.png) 39 | 40 | BaiduExporter is licensed under [GNU General Public License](https://www.gnu.org/licenses/gpl.html) Version 3 or later. 41 | 42 | BaiduExporter is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. 43 | 44 | BaiduExporter is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. 45 | 46 | You should have received a copy of the GNU General Public License along with BaiduExporter. If not, see . 47 | -------------------------------------------------------------------------------- /BaiduExporter-master/aria2c/HideRun.vbs: -------------------------------------------------------------------------------- 1 | CreateObject("WScript.Shell").Run "aria2c.exe --conf-path=aria2.conf",0 -------------------------------------------------------------------------------- /BaiduExporter-master/aria2c/README.md: -------------------------------------------------------------------------------- 1 | # Aria2 for windows 2 | 3 | 关于aria2在Windows下的配置大家一直很有疑问,所以我还是写点东西方便大家使用比较好 4 | 5 | ## Download 6 | - 目前下载已经转移到Github上进行版本发布了,大家可以在[Release](https://github.com/tatsuhiro-t/aria2/releases/)下下载自己电脑对应的版本. 7 | 8 | ## Usage 9 | - 直接运行exe只会闪现一个黑框消失,无法正常使用的,必须使用脚本进行启动. 10 | - 拷贝这个目录下的配置文件和脚本文件,和下载解压缩的aria2c.exe放在同一个目录下. 11 | - 点击 `start.bat`可以直接运行,但是会有一个命令行窗口,不能关闭,关闭也就意味着程序的退出 12 | - 点击 `HideRun.vbs`也会直接运行,但是没有任何反应,因为隐藏窗口了,可以在任务管理器的进程窗口里看到程序的运行 13 | 14 | 15 | ## 配置 16 | 17 | - 默认配置已经够用了,不过方便大家,还是讲解下常用的几个参数吧. 18 | - 配置文件里面的 `#`符号代表注释,如果使用这个符号那么那一行的设置就不会生效,想启用设置必须先把前面的`#`号删除 19 | - 一般情况下要根据自己的需求设置下载路径也就是`dir`这个参数,注意这里一定得写绝对路径 20 | - 首先是 `rpc-user`和`rpc-passwd`很明显这个需要一起使用,这是旧的加密方式.如果启用的话RPC路径就变成 `http://username:passwd@hostname:port/jsonrpc` 这种格式了(不推荐使用这个格式) 21 | - 其次是`rpc-secret`,使用这个设置加密路径的话,RPC格式就是`http://token:secret@hostname:port/jsonrpc`这样 22 | - 如果只是在自己电脑上使用的话,没必要启用任何加密方式,默认的就行.这样RPC路径就是`http://localhost:6800/jsonrpc` 23 | -------------------------------------------------------------------------------- /BaiduExporter-master/aria2c/aria2.conf: -------------------------------------------------------------------------------- 1 | #用户名 2 | #rpc-user=user 3 | #密码 4 | #rpc-passwd=passwd 5 | #设置加密的密钥 6 | #rpc-secret=secret 7 | #允许rpc 8 | enable-rpc=true 9 | #允许所有来源, web界面跨域权限需要 10 | rpc-allow-origin-all=true 11 | #是否启用https加密,启用之后要设置公钥,私钥的文件路径 12 | #rpc-secure=true 13 | #启用加密设置公钥 14 | #rpc-certificate=/home/name/.config/aria2/example.crt 15 | #启用加密设置私钥 16 | #rpc-private-key=/home/name/.config/aria2/example.key 17 | #允许外部访问,false的话只监听本地端口 18 | rpc-listen-all=true 19 | #RPC端口, 仅当默认端口被占用时修改 20 | #rpc-listen-port=6800 21 | #最大同时下载数(任务数), 路由建议值: 3 22 | max-concurrent-downloads=5 23 | #断点续传 24 | continue=true 25 | #同服务器连接数 26 | max-connection-per-server=5 27 | #最小文件分片大小, 下载线程数上限取决于能分出多少片, 对于小文件重要 28 | min-split-size=10M 29 | #单文件最大线程数, 路由建议值: 5 30 | split=10 31 | #下载速度限制 32 | max-overall-download-limit=0 33 | #单文件速度限制 34 | max-download-limit=0 35 | #上传速度限制 36 | max-overall-upload-limit=0 37 | #单文件速度限制 38 | max-upload-limit=0 39 | #断开速度过慢的连接 40 | #lowest-speed-limit=0 41 | #验证用,需要1.16.1之后的release版本 42 | #referer=* 43 | #文件保存路径, 默认为当前启动位置 44 | dir=D:\Downloads 45 | #文件缓存, 使用内置的文件缓存, 如果你不相信Linux内核文件缓存和磁盘内置缓存时使用, 需要1.16及以上版本 46 | #disk-cache=0 47 | #另一种Linux文件缓存方式, 使用前确保您使用的内核支持此选项, 需要1.15及以上版本(?) 48 | #enable-mmap=true 49 | #文件预分配, 能有效降低文件碎片, 提高磁盘性能. 缺点是预分配时间较长 50 | #所需时间 none < falloc ? trunc << prealloc, falloc和trunc需要文件系统和内核支持 51 | file-allocation=prealloc 52 | #不进行证书校验 53 | check-certificate=false -------------------------------------------------------------------------------- /BaiduExporter-master/aria2c/start.bat: -------------------------------------------------------------------------------- 1 | aria2c.exe --conf=aria2.conf -------------------------------------------------------------------------------- /BaiduExporter-master/chrome/.eslintrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "standard", 3 | "env": { 4 | "browser": true 5 | }, 6 | "globals": { 7 | "chrome": true, 8 | "browser": true 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /BaiduExporter-master/chrome/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules/ 2 | dist/ 3 | -------------------------------------------------------------------------------- /BaiduExporter-master/chrome/.stylelintrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "stylelint-config-sass-guidelines", 3 | "rules": { 4 | "max-nesting-depth": 4 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /BaiduExporter-master/chrome/_locales/en/messages.json: -------------------------------------------------------------------------------- 1 | { 2 | "appName": { 3 | "message": "BaiduExporter" 4 | }, 5 | "description": { 6 | "message": "Assistant to export download links to aria2/aria2-rpc" 7 | }, 8 | "openContextMenuTitle": { 9 | "message": "Export to aria2-rpc" 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /BaiduExporter-master/chrome/_locales/zh_CN/messages.json: -------------------------------------------------------------------------------- 1 | { 2 | "appName": { 3 | "message": "百度网盘助手" 4 | }, 5 | "description": { 6 | "message": "可以方便的把网盘的下载地址导出到aria2/aria2-rpc,支持YAAW。" 7 | }, 8 | "openContextMenuTitle": { 9 | "message": "导出到aria2-rpc" 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /BaiduExporter-master/chrome/background.js: -------------------------------------------------------------------------------- 1 | if (typeof browser !== 'undefined') { 2 | chrome = browser 3 | } 4 | 5 | const httpSend = ({url, options}, resolve, reject) => { 6 | fetch(url, options).then((response) => { 7 | if (response.ok) { 8 | response.json().then((data) => { 9 | resolve(data) 10 | }) 11 | } else { 12 | reject(response) 13 | } 14 | }).catch((err) => { 15 | reject(err) 16 | }) 17 | } 18 | // https://developer.chrome.com/apps/runtime#event-onMessage 19 | chrome.runtime.onMessage.addListener(function (request, sender, sendResponse) { 20 | switch (request.method) { 21 | case 'addScript': 22 | chrome.tabs.executeScript(sender.tab.id, { file: request.data }) 23 | break 24 | case 'rpcData': 25 | httpSend(request.data, (data) => { 26 | sendResponse(true) 27 | }, (err) => { 28 | console.log(err) 29 | sendResponse(false) 30 | }) 31 | return true 32 | case 'configData': 33 | for (let key in request.data) { 34 | localStorage.setItem(key, request.data[key]) 35 | } 36 | break 37 | case 'rpcVersion': 38 | httpSend(request.data, (data) => { 39 | sendResponse(data.result.version) 40 | }, (err) => { 41 | console.log(err) 42 | sendResponse(false) 43 | }) 44 | return true 45 | case 'getCookies': 46 | getCookies(request.data).then(value => sendResponse(value)) 47 | return true 48 | } 49 | }) 50 | 51 | // Promise style `chrome.cookies.get()` 52 | const getCookie = (detail) => { 53 | return new Promise(function (resolve) { 54 | chrome.cookies.get(detail, resolve) 55 | }) 56 | } 57 | 58 | const getCookies = (details) => { 59 | return new Promise(function (resolve) { 60 | const list = details.map(item => getCookie(item)) 61 | Promise.all(list).then(function (cookies) { 62 | let obj = {} 63 | for (let item of cookies) { 64 | if (item !== null) { 65 | obj[item.name] = item.value 66 | } 67 | } 68 | resolve(obj) 69 | }) 70 | }) 71 | } 72 | 73 | const showNotification = (id, opt) => { 74 | if (!chrome.notifications) { 75 | return 76 | } 77 | chrome.notifications.create(id, opt, () => {}) 78 | setTimeout(() => { 79 | chrome.notifications.clear(id, () => {}) 80 | }, 5000) 81 | } 82 | // 软件版本更新提示 83 | const manifest = chrome.runtime.getManifest() 84 | const previousVersion = localStorage.getItem('version') 85 | if (previousVersion === '' || previousVersion !== manifest.version) { 86 | var opt = { 87 | type: 'basic', 88 | title: '更新', 89 | message: '百度网盘助手更新到' + manifest.version + '版本啦~\n此次更新恢复自定义文件夹层数功能~', 90 | iconUrl: 'img/icon.jpg' 91 | } 92 | const id = new Date().getTime().toString() 93 | showNotification(id, opt) 94 | localStorage.setItem('version', manifest.version) 95 | } 96 | -------------------------------------------------------------------------------- /BaiduExporter-master/chrome/gulpfile.js: -------------------------------------------------------------------------------- 1 | const gulp = require('gulp') 2 | const babelify = require('babelify') 3 | const browserify = require('browserify') 4 | const tap = require('gulp-tap') 5 | const buffer = require('gulp-buffer') 6 | 7 | const del = require('del') 8 | const gulpIf = require('gulp-if') 9 | const runSequence = require('run-sequence') 10 | 11 | const eslint = require('gulp-eslint') 12 | const stylelint = require('gulp-stylelint') 13 | 14 | const postcss = require('gulp-postcss') 15 | const sass = require('gulp-sass') 16 | const autoprefixer = require('autoprefixer') 17 | const concat = require('gulp-concat') 18 | const cssmin = require('gulp-cssmin') 19 | 20 | const imagemin = require('gulp-imagemin') 21 | const mozjpeg = require('imagemin-mozjpeg') 22 | const pngquant = require('imagemin-pngquant') 23 | 24 | const plumber = require('gulp-plumber') 25 | const sourcemaps = require('gulp-sourcemaps') 26 | const uglify = require('gulp-uglify') 27 | const jsTargets = ['./src/js/**/*.js'] 28 | const jsEntries = ['./src/js/*.js'] 29 | const cssTargets = ['./src/css/**/*.scss'] 30 | const imageTargets = ['./src/img/**/*'] 31 | const copyTarget = ['./_locales/**/*', 'background.js', 'manifest.json'] 32 | const config = { 33 | errorHandler: function (err) { 34 | console.log(err.toString()) 35 | this.emit('end') 36 | }, 37 | env: { 38 | dev: process.env.NODE_ENV === 'development', 39 | prod: process.env.NODE_ENV === 'production' 40 | } 41 | } 42 | 43 | gulp.task('lint:js', function () { 44 | return gulp.src(jsTargets) 45 | .pipe(eslint()) 46 | .pipe(eslint.format()) 47 | .pipe(eslint.failAfterError()) 48 | }) 49 | 50 | gulp.task('lint:css', function () { 51 | return gulp.src(cssTargets) 52 | .pipe(stylelint({ 53 | reporters: [ 54 | {formatter: 'string', console: true} 55 | ] 56 | })) 57 | }) 58 | 59 | gulp.task('js', function () { 60 | return gulp.src(jsEntries) 61 | .pipe(plumber(config.plumberConfig)) 62 | .pipe(eslint()) 63 | .pipe(eslint.format()) 64 | .pipe(tap(function (file) { 65 | console.log('bundling ' + file.path) 66 | // replace file contents with browserify's bundle stream 67 | file.contents = browserify(file.path, {debug: config.env.dev}).transform(babelify, {presets: ['env']}).bundle().on('error', config.errorHandler) 68 | })) 69 | .pipe(buffer()) 70 | .pipe(gulpIf(config.env.dev, sourcemaps.init({loadMaps: true}))) 71 | // write sourcemaps 72 | .pipe(gulpIf(config.env.dev, sourcemaps.write())) 73 | .pipe(gulpIf(config.env.prod, uglify())) 74 | 75 | .pipe(gulp.dest('dist/js/')) 76 | }) 77 | 78 | gulp.task('css', function () { 79 | return gulp.src(cssTargets) 80 | .pipe(plumber(config.plumberConfig)) 81 | .pipe(stylelint({ 82 | reporters: [ 83 | {formatter: 'string', console: true} 84 | ] 85 | })) 86 | .pipe(gulpIf(config.env.dev, sourcemaps.init())) 87 | .pipe(sass({ 88 | outputStyle: 'nested', 89 | precision: 3, 90 | includePaths: ['.'] 91 | })) 92 | .pipe(postcss([ 93 | autoprefixer({ 94 | browsers: ['last 1 versions'] 95 | }) 96 | ])) 97 | .pipe(concat('style.css')) 98 | .pipe(gulpIf(config.env.dev, sourcemaps.write())) 99 | .pipe(gulpIf(config.env.prod, cssmin())) 100 | .pipe(gulp.dest('dist/css/')) 101 | }) 102 | 103 | gulp.task('img', function () { 104 | return gulp.src(imageTargets) 105 | .pipe(plumber(config.plumberConfig)) 106 | .pipe(imagemin([ 107 | pngquant(), 108 | mozjpeg(), 109 | imagemin.svgo()], { 110 | verbose: true 111 | })) 112 | .pipe(gulp.dest('dist/img/')) 113 | }) 114 | gulp.task('copy', function () { 115 | return gulp.src(copyTarget, { base: '.' }) 116 | .pipe(gulp.dest('dist/')) 117 | }) 118 | gulp.task('build', ['js', 'css', 'img', 'copy']) 119 | 120 | gulp.task('clean', function () { 121 | return del([ 122 | 'dist/**/*' 123 | ]) 124 | }) 125 | gulp.task('serve', ['clean'], function () { 126 | runSequence(['build'], function () { 127 | gulp.watch(copyTarget, ['copy']) 128 | gulp.watch(jsTargets, ['js']) 129 | gulp.watch(cssTargets, ['css']) 130 | }) 131 | }) 132 | 133 | gulp.task('public', ['clean'], function () { 134 | runSequence(['build']) 135 | }) 136 | 137 | gulp.task('default', function () { 138 | console.info('You should use npm run dev to start development mode.') 139 | }) 140 | -------------------------------------------------------------------------------- /BaiduExporter-master/chrome/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "background": { 3 | "scripts": [ "background.js" ], 4 | "persistent": false 5 | }, 6 | "content_scripts": [ 7 | { 8 | "js": ["js/start.js" ], 9 | "css": [ "css/style.css" ], 10 | "matches": [ "*://pan.baidu.com/s/*", "*://yun.baidu.com/s/*", "*://pan.baidu.com/disk/home*", "*://yun.baidu.com/share/link*", "*://pan.baidu.com/share/link*", "*://yun.baidu.com/disk/home*", "*://pan.baidu.com/pcloud/album/*", "*://yun.baidu.com/pcloud/album/*" ], 11 | "run_at": "document_idle" 12 | } 13 | ], 14 | "default_locale": "en", 15 | "description": "__MSG_description__", 16 | "icons": { 17 | "32": "img/logo32.png", 18 | "16": "img/logo16.png", 19 | "48": "img/logo48.png", 20 | "128": "img/logo128.png" 21 | }, 22 | "web_accessible_resources": [ "js/baidu.js" ], 23 | "manifest_version": 2, 24 | "permissions": [ "cookies", "notifications", "*://pan.baidu.com/", "*://yun.baidu.com/", "*://pcs.baidu.com/", "activeTab", "contextMenus", "storage" ], 25 | "name": "__MSG_appName__", 26 | "update_url": "https://raw.githubusercontent.com/acgotaku/BaiduExporter/master/chrome/updates.xml", 27 | "author": "acgotaku", 28 | "version": "1.0.2" 29 | } 30 | -------------------------------------------------------------------------------- /BaiduExporter-master/chrome/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "baiduexporter", 3 | "version": "1.0.1", 4 | "description": "Assistant for Baidu to export download links to aria2/aria2-rpc", 5 | "main": "background.js", 6 | "scripts": { 7 | "start": "npm run dev", 8 | "dev": "NODE_ENV=development gulp serve", 9 | "build": "NODE_ENV=production gulp public", 10 | "clean": "gulp clean", 11 | "lint:js": "gulp lint:js", 12 | "lint:css": "gulp lint:css", 13 | "test": "npm run lint:js && npm run lint:css" 14 | }, 15 | "repository": { 16 | "type": "git", 17 | "url": "git+https://github.com/acgotaku/BaiduExporter.git" 18 | }, 19 | "keywords": [ 20 | "BaiduExporter", 21 | "aria2" 22 | ], 23 | "author": "acgotaku311", 24 | "license": "GPL-3.0", 25 | "bugs": { 26 | "url": "https://github.com/acgotaku/BaiduExporter/issues" 27 | }, 28 | "homepage": "https://github.com/acgotaku/BaiduExporter#readme", 29 | "devDependencies": { 30 | "autoprefixer": "^8.0.0", 31 | "babel-core": "^6.26.0", 32 | "babel-preset-env": "^1.6.0", 33 | "babelify": "^8.0.0", 34 | "browserify": "^16.0.0", 35 | "eslint-config-standard": "^10.2.1", 36 | "eslint-plugin-import": "^2.7.0", 37 | "eslint-plugin-node": "^6.0.0", 38 | "eslint-plugin-promise": "^3.5.0", 39 | "eslint-plugin-standard": "^3.0.1", 40 | "gulp": "^4.0.2", 41 | "gulp-buffer": "0.0.2", 42 | "gulp-concat": "^2.6.1", 43 | "gulp-cssmin": "^0.2.0", 44 | "gulp-eslint": "^4.0.0", 45 | "gulp-if": "^2.0.2", 46 | "gulp-imagemin": "^4.1.0", 47 | "gulp-plumber": "^1.1.0", 48 | "gulp-postcss": "^7.0.0", 49 | "gulp-sass": "^3.1.0", 50 | "gulp-sourcemaps": "^2.6.0", 51 | "gulp-stylelint": "^6.0.0", 52 | "gulp-tap": "^1.0.1", 53 | "gulp-uglify": "^3.0.0", 54 | "imagemin-mozjpeg": "^7.0.0", 55 | "imagemin-pngquant": "^5.0.1", 56 | "run-sequence": "^2.2.0", 57 | "stylelint": "^9.0.0", 58 | "stylelint-config-sass-guidelines": "^4.1.0", 59 | "stylelint-order": "^0.8.0", 60 | "stylelint-scss": "^2.3.0" 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /BaiduExporter-master/chrome/release/_locales/en/messages.json: -------------------------------------------------------------------------------- 1 | { 2 | "appName": { 3 | "message": "BaiduExporter" 4 | }, 5 | "description": { 6 | "message": "Assistant to export download links to aria2/aria2-rpc" 7 | }, 8 | "openContextMenuTitle": { 9 | "message": "Export to aria2-rpc" 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /BaiduExporter-master/chrome/release/_locales/zh_CN/messages.json: -------------------------------------------------------------------------------- 1 | { 2 | "appName": { 3 | "message": "百度网盘助手" 4 | }, 5 | "description": { 6 | "message": "可以方便的把网盘的下载地址导出到aria2/aria2-rpc,支持YAAW。" 7 | }, 8 | "openContextMenuTitle": { 9 | "message": "导出到aria2-rpc" 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /BaiduExporter-master/chrome/release/background.js: -------------------------------------------------------------------------------- 1 | if (typeof browser !== 'undefined') { 2 | chrome = browser 3 | } 4 | 5 | const httpSend = ({url, options}, resolve, reject) => { 6 | fetch(url, options).then((response) => { 7 | if (response.ok) { 8 | response.json().then((data) => { 9 | resolve(data) 10 | }) 11 | } else { 12 | reject(response) 13 | } 14 | }).catch((err) => { 15 | reject(err) 16 | }) 17 | } 18 | // https://developer.chrome.com/apps/runtime#event-onMessage 19 | chrome.runtime.onMessage.addListener(function (request, sender, sendResponse) { 20 | switch (request.method) { 21 | case 'addScript': 22 | chrome.tabs.executeScript(sender.tab.id, { file: request.data }) 23 | break 24 | case 'rpcData': 25 | httpSend(request.data, (data) => { 26 | sendResponse(true) 27 | }, (err) => { 28 | console.log(err) 29 | sendResponse(false) 30 | }) 31 | return true 32 | case 'configData': 33 | for (let key in request.data) { 34 | localStorage.setItem(key, request.data[key]) 35 | } 36 | break 37 | case 'rpcVersion': 38 | httpSend(request.data, (data) => { 39 | sendResponse(data.result.version) 40 | }, (err) => { 41 | console.log(err) 42 | sendResponse(false) 43 | }) 44 | return true 45 | case 'getCookies': 46 | getCookies(request.data).then(value => sendResponse(value)) 47 | return true 48 | } 49 | }) 50 | 51 | // Promise style `chrome.cookies.get()` 52 | const getCookie = (detail) => { 53 | return new Promise(function (resolve) { 54 | chrome.cookies.get(detail, resolve) 55 | }) 56 | } 57 | 58 | const getCookies = (details) => { 59 | return new Promise(function (resolve) { 60 | const list = details.map(item => getCookie(item)) 61 | Promise.all(list).then(function (cookies) { 62 | let obj = {} 63 | for (let item of cookies) { 64 | if (item !== null) { 65 | obj[item.name] = item.value 66 | } 67 | } 68 | resolve(obj) 69 | }) 70 | }) 71 | } 72 | 73 | const showNotification = (id, opt) => { 74 | if (!chrome.notifications) { 75 | return 76 | } 77 | chrome.notifications.create(id, opt, () => {}) 78 | setTimeout(() => { 79 | chrome.notifications.clear(id, () => {}) 80 | }, 5000) 81 | } 82 | // 软件版本更新提示 83 | const manifest = chrome.runtime.getManifest() 84 | const previousVersion = localStorage.getItem('version') 85 | if (previousVersion === '' || previousVersion !== manifest.version) { 86 | var opt = { 87 | type: 'basic', 88 | title: '更新', 89 | message: '百度网盘助手更新到' + manifest.version + '版本啦~\n此次更新恢复自定义文件夹层数功能~', 90 | iconUrl: 'img/icon.jpg' 91 | } 92 | const id = new Date().getTime().toString() 93 | showNotification(id, opt) 94 | localStorage.setItem('version', manifest.version) 95 | } 96 | -------------------------------------------------------------------------------- /BaiduExporter-master/chrome/release/css/style.css: -------------------------------------------------------------------------------- 1 | .modal-close,.setting-menu-checkbox{cursor:pointer}.captcha-menu .modal-inner{width:520px}.captcha-menu-row{align-items:flex-start;box-sizing:border-box;display:flex;justify-content:center;line-height:30px;padding:30px}.captcha-menu-img,.captcha-menu-label{padding:0 10px}.captcha-menu-box{display:flex;flex-direction:column}.captcha-menu-label.warn-o{color:#f8645c}.captcha-menu-input{border:1px solid rgba(0,0,0,.15);border-radius:4px;height:28px;padding:0 10px;width:100px}.captcha-menu-input:focus{border-color:#5cb3fd}.captcha-menu-operate{display:flex;justify-content:center;padding:10px;width:100%}.captcha-menu-operate .captcha-menu-button{width:100px}.captcha-menu-button{border:1px solid rgba(0,0,0,.15);border-radius:4px;color:#666;height:30px;line-height:30px;padding:0 10px;text-align:center}.captcha-menu-button:focus,.captcha-menu-button:hover{border-color:#5cb3fd;color:#666;text-decoration:none}.captcha-menu-button.blue-o{background-color:#3b8cff;color:#fff;margin:0 20px}.captcha-menu-button.blue-o:hover{background-color:#77afff}.export-menu-row{box-sizing:border-box;display:flex;justify-content:space-between;padding:10px 0 5px}.export-menu-row:last-child{height:200px;padding-bottom:10px}.export-menu-button{border:1px solid rgba(0,0,0,.15);border-radius:4px;color:#666;height:38px;line-height:38px;padding:0 30px;text-align:center}.export-menu-button:focus,.export-menu-button:hover{border-color:#5cb3fd;color:#666;text-decoration:none}.export-menu-textarea{border:1px solid rgba(0,0,0,.15);border-radius:4px;padding:5px 10px;resize:none;width:100%}.modal{align-items:center;background-color:rgba(0,0,0,.5);display:none;height:100%;justify-content:center;margin:auto;position:fixed;top:0;width:100%;z-index:99}.modal.open-o{display:flex}.modal-inner{background-color:#fafafa;border-radius:4px;margin:auto;width:650px}.modal-header{border-bottom:1px solid #dadada;display:flex;height:40px;line-height:40px}.modal-title{flex:1;font-weight:700;padding-left:10px}.modal-body,.modal-close{padding:0 10px}.modal-close{font-size:30px}.modal-footer{border-top:1px solid #dadada;display:flex;padding-bottom:10px}.setting-menu-message{align-items:center;display:flex;height:20px}.setting-menu-row{box-sizing:border-box;display:flex;height:40px;padding:5px 0}.setting-menu-row:last-child{height:100px}.setting-menu-row:hover{background-color:#eff4f8}.setting-menu-input{border:1px solid rgba(0,0,0,.15);border-radius:4px;height:28px;padding:0 10px;width:70%}.setting-menu-input.small-o{width:30%}.setting-menu-input.textarea-o{height:80px;padding:5px 10px}.setting-menu-input:focus{border-color:#5cb3fd}.setting-menu-button{border:1px solid rgba(0,0,0,.15);border-radius:4px;color:#666;height:28px;line-height:28px;margin-left:10px;padding:0 10px;text-align:center}.setting-menu-button:focus,.setting-menu-button:hover{border-color:#5cb3fd;color:#666;text-decoration:none}.setting-menu-button.large-o{height:40px;line-height:40px;width:120px}.setting-menu-button.blue-o{background-color:#3b8cff;color:#fff}.setting-menu-button.blue-o:hover{background-color:#77afff}.setting-menu .version-s{margin-left:auto;margin-right:10px}.setting-menu-label{padding-left:10px}.setting-menu-label.orange-o{color:#e15f00}.setting-menu-name{align-items:center;display:flex;width:20%}.setting-menu-value{align-items:center;display:flex;padding-left:20px;width:80%}.setting-menu-copyright,.setting-menu-operate{width:50%}.setting-menu-item{align-items:center;display:flex;height:40px}.setting-menu-link{padding-left:10px}.setting-menu-operate{align-items:flex-end;display:flex;padding:10px} -------------------------------------------------------------------------------- /BaiduExporter-master/chrome/release/img/BaiduExplorerIcon.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /BaiduExporter-master/chrome/release/img/logo128.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itgoyo/Aria2/0a6ce51d65c8d290ca20e06d1ca761cb49bb27b6/BaiduExporter-master/chrome/release/img/logo128.png -------------------------------------------------------------------------------- /BaiduExporter-master/chrome/release/img/logo16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itgoyo/Aria2/0a6ce51d65c8d290ca20e06d1ca761cb49bb27b6/BaiduExporter-master/chrome/release/img/logo16.png -------------------------------------------------------------------------------- /BaiduExporter-master/chrome/release/img/logo32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itgoyo/Aria2/0a6ce51d65c8d290ca20e06d1ca761cb49bb27b6/BaiduExporter-master/chrome/release/img/logo32.png -------------------------------------------------------------------------------- /BaiduExporter-master/chrome/release/img/logo48.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itgoyo/Aria2/0a6ce51d65c8d290ca20e06d1ca761cb49bb27b6/BaiduExporter-master/chrome/release/img/logo48.png -------------------------------------------------------------------------------- /BaiduExporter-master/chrome/release/img/logo64.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itgoyo/Aria2/0a6ce51d65c8d290ca20e06d1ca761cb49bb27b6/BaiduExporter-master/chrome/release/img/logo64.png -------------------------------------------------------------------------------- /BaiduExporter-master/chrome/release/js/baidu.js: -------------------------------------------------------------------------------- 1 | !function(){return function t(e,n,o){function a(r,s){if(!n[r]){if(!e[r]){var u="function"==typeof require&&require;if(!s&&u)return u(r,!0);if(i)return i(r,!0);var c=new Error("Cannot find module '"+r+"'");throw c.code="MODULE_NOT_FOUND",c}var f=n[r]={exports:{}};e[r][0].call(f.exports,function(t){var n=e[r][1][t];return a(n||t)},f,f.exports,t,e,n,o)}return n[r].exports}for(var i="function"==typeof require&&require,r=0;r0&&void 0!==arguments[0]?arguments[0]:null;return o.default.getConfigData(e)}},{key:"objectToQueryString",value:function(e){return Object.keys(e).map(function(t){return encodeURIComponent(t)+"="+encodeURIComponent(e[t])}).join("&")}},{key:"sendToBackground",value:function(e,t,n){chrome.runtime.sendMessage({method:e,data:t},n)}},{key:"showToast",value:function(e,t){window.postMessage({type:"showToast",data:{message:e,type:t}},location.origin)}},{key:"getHashParameter",value:function(e){var t=window.location.hash.substr(1);return new URLSearchParams(t).get(e)}},{key:"formatCookies",value:function(){var e=[];for(var t in this.cookies)e.push(t+"="+this.cookies[t]);return e.join("; ")}},{key:"getHeader",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"RPC",t=[];t.push("User-Agent: "+this.getConfigData("userAgent")),t.push("Referer: "+this.getConfigData("referer")),Object.keys(this.cookies).length>0&&t.push("Cookie: "+this.formatCookies());var n=this.getConfigData("headers");return n&&n.split("\n").forEach(function(e){t.push(e)}),"RPC"===e?t:"aria2Cmd"===e?t.map(function(e){return"--header "+JSON.stringify(e)}).join(" "):"aria2c"===e?t.map(function(e){return" header="+e}).join("\n"):"idm"===e?t.map(function(e){var t=e.split(": ");return t[0].toLowerCase()+": "+t[1]}).join("\r\n"):void 0}},{key:"parseURL",value:function(e){var t=new URL(e),n=t.username?t.username+":"+decodeURI(t.password):null;n&&(n.includes("token:")||(n="Basic "+btoa(n)));var a=t.hash.substr(1),r={},i=new URLSearchParams(a),o=!0,s=!1,l=void 0;try{for(var u,c=i[Symbol.iterator]();!(o=(u=c.next()).done);o=!0){var d=u.value;r[d[0]]=2===d.length?d[1]:"enabled"}}catch(e){s=!0,l=e}finally{try{!o&&c.return&&c.return()}finally{if(s)throw l}}return{authStr:n,path:t.origin+t.pathname,options:r}}},{key:"generateParameter",value:function(e,t,n){e&&e.startsWith("token")&&n.params.unshift(e);var a={url:t,options:{method:"POST",headers:{"Content-type":"application/x-www-form-urlencoded; charset=UTF-8"},body:JSON.stringify(n)}};return e&&e.startsWith("Basic")&&(a.options.headers.Authorization=e),a}},{key:"getVersion",value:function(e,t){var n=this.parseURL(e),a=n.authStr,r=n.path;this.sendToBackground("rpcVersion",this.generateParameter(a,r,{jsonrpc:"2.0",method:"aria2.getVersion",id:1,params:[]}),function(e){t.innerText=e?"Aria2版本为: "+e:"错误,请查看是否开启Aria2"})}},{key:"copyText",value:function(e){var t=document.createElement("textarea");document.body.appendChild(t),t.value=e,t.focus(),t.select();var n=document.execCommand("copy");t.remove(),n?this.showToast("拷贝成功~","success"):this.showToast("拷贝失败 QAQ","failure")}},{key:"requestCookies",value:function(e){var t=this;this.sendToBackground("getCookies",e,function(e){t.cookies=e})}},{key:"aria2RPCMode",value:function(e,t){var n=this,a=this.parseURL(e),r=a.authStr,i=a.path,o=a.options;t.forEach(function(e){var t={jsonrpc:"2.0",method:"aria2.addUri",id:(new Date).getTime(),params:[[e.link],{out:e.name,header:n.getHeader()}]},a=n.getConfigData("md5Check"),s=t.params[1],l=n.getConfigData("downloadPath");if(l&&(s.dir=l),a&&(s.checksum="md5="+e.md5),o)for(var u in o)s[u]=o[u];n.sendToBackground("rpcData",n.generateParameter(r,i,t),function(e){e?n.showToast("下载成功!赶紧去看看吧~","success"):n.showToast("下载失败!是不是没有开启Aria2?","failure")})})}},{key:"aria2TXTMode",value:function(e){var t=this,n=[],a=[],r=[],i=[],o="data:text/plain;charset=utf-8,";e.forEach(function(e){var o="aria2c -c -s10 -k1M -x16 --enable-rpc=false -o "+JSON.stringify(e.name)+" "+t.getHeader("aria2Cmd")+" "+JSON.stringify(e.link),s=[e.link,t.getHeader("aria2c")," out="+e.name].join("\n");t.getConfigData("md5Check")&&(o+=" --checksum=md5="+e.md5,s+=" checksum=md5="+e.md5),n.push(o),a.push(s);var l=["<",e.link,t.getHeader("idm"),">"].join("\r\n");r.push(l),i.push(e.link)}),document.querySelector("#aria2CmdTxt").value=""+n.join("\n"),document.querySelector("#aria2Txt").href=""+o+encodeURIComponent(a.join("\n")),document.querySelector("#idmTxt").href=""+o+encodeURIComponent(r.join("\r\n")+"\r\n"),document.querySelector("#downloadLinkTxt").href=""+o+encodeURIComponent(i.join("\n")),document.querySelector("#copyDownloadLinkTxt").dataset.link=i.join("\n")}}]),e}();n.default=new s},{"./store":5}],4:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var a,r=function(){function e(e,t){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:300,t=arguments[1];this.interval=e,this.done=t,this.currentTaskId=(new Date).getTime(),this.getNextFile(this.currentTaskId)}},{key:"reset",value:function(){this.fileDownloadInfo=[],this.currentTaskId=0,this.folders=[],this.files={},this.completedCount=0}},{key:"addFolder",value:function(e){this.folders.push(e)}},{key:"addFile",value:function(e){this.files[e.fs_id]=e}},{key:"getNextFile",value:function(e){var t=this;if(e===this.currentTaskId)if(0!==this.folders.length){this.completedCount++,o.default.showToast("正在获取文件列表... "+this.completedCount+"/"+(this.completedCount+this.folders.length-1),"success");var n=this.folders.pop();this.listParameter.search.dir=n,fetch(""+window.location.origin+this.listParameter.url+o.default.objectToQueryString(this.listParameter.search),this.listParameter.options).then(function(n){n.ok?n.json().then(function(n){if(setTimeout(function(){return t.getNextFile(e)},t.interval),0!==n.errno)return o.default.showToast("未知错误","failure"),void console.log(n);n.list.forEach(function(e){e.isdir?t.folders.push(e.path):t.files[e.fs_id]=e})}):console.log(n)}).catch(function(n){o.default.showToast("网络请求失败","failure"),console.log(n),setTimeout(function(){return t.getNextFile(e)},t.interval)})}else 0!==this.files.length?(o.default.showToast("正在获取下载地址...","success"),this.getFiles(this.files).then(function(){t.done(t.fileDownloadInfo)})):(o.default.showToast("一个文件都没有哦...","caution"),this.reset())}},{key:"getFiles",value:function(e){throw new Error("subclass should implement this method!")}}]),e}();n.default=s},{"./core":3}],5:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var a,r=function(){function e(e,t){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:null;return e?this.configData[e]:this.configData}},{key:"set",value:function(e){this.configData=e,this.save(e),this.trigger("updateView",e)}},{key:"save",value:function(e){var t=function(t){chrome.storage.local.set(s({},t,e[t]),function(){console.log("chrome local set: %s, %s",t,e[t])}),!0===e.configSync&&chrome.storage.sync.set(s({},t,e[t]),function(){console.log("chrome sync set: %s, %s",t,e[t])})};for(var n in e)t(n)}},{key:"clear",value:function(){chrome.storage.sync.clear(),chrome.storage.local.clear(),this.configData=this.defaultConfigData,this.trigger("updateView",this.configData)}}]),t}();n.default=new l},{"./EventEmitter":2}],6:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var a=function(){function e(e,t){for(var n=0;n\n \n \n \n 导出下载\n \n \n \n ');var n=document.querySelector("#exportMenu");n.addEventListener("mouseenter",function(){n.classList.add("button-open")}),n.addEventListener("mouseleave",function(){n.classList.remove("button-open")});var a=document.querySelector("#settingButton"),r=document.querySelector("#settingMenu");a.addEventListener("click",function(){r.classList.add("open-o")})}},{key:"resetMenu",value:function(){Array.from(document.querySelectorAll(".rpc-button")).forEach(function(e){e.remove()})}},{key:"updateMenu",value:function(e){this.resetMenu();var t=e.rpcList,n="";t.forEach(function(e){var t='\n \n ');var t=document.querySelector("#textMenu"),n=t.querySelector(".modal-close"),a=t.querySelector("#copyDownloadLinkTxt");a.addEventListener("click",function(){r.default.copyText(a.dataset.link)}),n.addEventListener("click",function(){t.classList.remove("open-o"),e.resetTextExport()})}},{key:"resetTextExport",value:function(){var e=document.querySelector("#textMenu");e.querySelector("#aria2Txt").href="",e.querySelector("#idmTxt").href="",e.querySelector("#downloadLinkTxt").href="",e.querySelector("#aria2CmdTxt").value="",e.querySelector("#copyDownloadLinkTxt").dataset.link=""}},{key:"addSettingUI",value:function(){var e=this,t='\n ';document.body.insertAdjacentHTML("beforeend",t);var n=document.querySelector("#settingMenu");n.querySelector(".modal-close").addEventListener("click",function(){n.classList.remove("open-o"),e.resetSetting()}),document.querySelector("#addRPC").addEventListener("click",function(){var e=document.querySelectorAll(".rpc-s");Array.from(e).pop().insertAdjacentHTML("afterend",'\n
\n
\n \n
\n
\n \n
\n
\x3c!-- /.setting-menu-row --\x3e')});var a=document.querySelector("#apply"),o=document.querySelector("#message");a.addEventListener("click",function(){e.saveSetting(),o.innerText="设置已保存"}),document.querySelector("#reset").addEventListener("click",function(){i.default.trigger("clearConfigData"),o.innerText="设置已重置"});var s=document.querySelector("#testAria2");s.addEventListener("click",function(){r.default.getVersion(i.default.getConfigData("rpcList")[0].url,s)})}},{key:"resetSetting",value:function(){document.querySelector("#message").innerText="",document.querySelector("#testAria2").innerText="测试连接,成功显示版本号"}},{key:"updateSetting",value:function(e){var t=e.rpcList,n=e.configSync,a=e.md5Check,r=e.fold,i=e.interval,o=e.downloadPath,s=e.userAgent,l=e.referer,u=e.headers;Array.from(document.querySelectorAll(".rpc-s")).forEach(function(e,t){0!==t&&e.remove()}),t.forEach(function(e,t){var n=document.querySelectorAll(".rpc-s");if(0===t)n[t].querySelector(".name-s").value=e.name,n[t].querySelector(".url-s").value=e.url;else{var a='\n
\n
\n \n
\n
\n \n
\n
\x3c!-- /.setting-menu-row --\x3e';Array.from(n).pop().insertAdjacentHTML("afterend",a)}}),document.querySelector(".configSync-s").checked=n,document.querySelector(".md5Check-s").checked=a,document.querySelector(".fold-s").value=r,document.querySelector(".interval-s").value=i,document.querySelector(".downloadPath-s").value=o,document.querySelector(".userAgent-s").value=s,document.querySelector(".referer-s").value=l,document.querySelector(".headers-s").value=u}},{key:"saveSetting",value:function(){var e=document.querySelectorAll(".rpc-s"),t={rpcList:Array.from(e).map(function(e){var t=e.querySelector(".name-s").value,n=e.querySelector(".url-s").value;if(t&&n)return{name:t,url:n}}).filter(function(e){return e}),configSync:document.querySelector(".configSync-s").checked,md5Check:document.querySelector(".md5Check-s").checked,fold:Number.parseInt(document.querySelector(".fold-s").value),interval:document.querySelector(".interval-s").value,downloadPath:document.querySelector(".downloadPath-s").value,userAgent:document.querySelector(".userAgent-s").value,referer:document.querySelector(".referer-s").value,headers:document.querySelector(".headers-s").value};i.default.trigger("setConfigData",t)}}]),e}();n.default=new s},{"./core":3,"./store":5}]},{},[1]); -------------------------------------------------------------------------------- /BaiduExporter-master/chrome/release/js/share.js: -------------------------------------------------------------------------------- 1 | !function(){return function e(t,n,a){function i(r,s){if(!n[r]){if(!t[r]){var l="function"==typeof require&&require;if(!s&&l)return l(r,!0);if(o)return o(r,!0);var c=new Error("Cannot find module '"+r+"'");throw c.code="MODULE_NOT_FOUND",c}var u=n[r]={exports:{}};t[r][0].call(u.exports,function(e){var n=t[r][1][e];return i(n||e)},u,u.exports,e,t,n,a)}return n[r].exports}for(var o="function"==typeof require&&require,r=0;r0&&void 0!==arguments[0]?arguments[0]:null;return r.default.getConfigData(e)}},{key:"objectToQueryString",value:function(e){return Object.keys(e).map(function(t){return encodeURIComponent(t)+"="+encodeURIComponent(e[t])}).join("&")}},{key:"sendToBackground",value:function(e,t,n){chrome.runtime.sendMessage({method:e,data:t},n)}},{key:"showToast",value:function(e,t){window.postMessage({type:"showToast",data:{message:e,type:t}},location.origin)}},{key:"getHashParameter",value:function(e){var t=window.location.hash.substr(1);return new URLSearchParams(t).get(e)}},{key:"formatCookies",value:function(){var e=[];for(var t in this.cookies)e.push(t+"="+this.cookies[t]);return e.join("; ")}},{key:"getHeader",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"RPC",t=[];t.push("User-Agent: "+this.getConfigData("userAgent")),t.push("Referer: "+this.getConfigData("referer")),Object.keys(this.cookies).length>0&&t.push("Cookie: "+this.formatCookies());var n=this.getConfigData("headers");return n&&n.split("\n").forEach(function(e){t.push(e)}),"RPC"===e?t:"aria2Cmd"===e?t.map(function(e){return"--header "+JSON.stringify(e)}).join(" "):"aria2c"===e?t.map(function(e){return" header="+e}).join("\n"):"idm"===e?t.map(function(e){var t=e.split(": ");return t[0].toLowerCase()+": "+t[1]}).join("\r\n"):void 0}},{key:"parseURL",value:function(e){var t=new URL(e),n=t.username?t.username+":"+decodeURI(t.password):null;n&&(n.includes("token:")||(n="Basic "+btoa(n)));var a=t.hash.substr(1),i={},o=new URLSearchParams(a),r=!0,s=!1,l=void 0;try{for(var c,u=o[Symbol.iterator]();!(r=(c=u.next()).done);r=!0){var d=c.value;i[d[0]]=2===d.length?d[1]:"enabled"}}catch(e){s=!0,l=e}finally{try{!r&&u.return&&u.return()}finally{if(s)throw l}}return{authStr:n,path:t.origin+t.pathname,options:i}}},{key:"generateParameter",value:function(e,t,n){e&&e.startsWith("token")&&n.params.unshift(e);var a={url:t,options:{method:"POST",headers:{"Content-type":"application/x-www-form-urlencoded; charset=UTF-8"},body:JSON.stringify(n)}};return e&&e.startsWith("Basic")&&(a.options.headers.Authorization=e),a}},{key:"getVersion",value:function(e,t){var n=this.parseURL(e),a=n.authStr,i=n.path;this.sendToBackground("rpcVersion",this.generateParameter(a,i,{jsonrpc:"2.0",method:"aria2.getVersion",id:1,params:[]}),function(e){t.innerText=e?"Aria2版本为: "+e:"错误,请查看是否开启Aria2"})}},{key:"copyText",value:function(e){var t=document.createElement("textarea");document.body.appendChild(t),t.value=e,t.focus(),t.select();var n=document.execCommand("copy");t.remove(),n?this.showToast("拷贝成功~","success"):this.showToast("拷贝失败 QAQ","failure")}},{key:"requestCookies",value:function(e){var t=this;this.sendToBackground("getCookies",e,function(e){t.cookies=e})}},{key:"aria2RPCMode",value:function(e,t){var n=this,a=this.parseURL(e),i=a.authStr,o=a.path,r=a.options;t.forEach(function(e){var t={jsonrpc:"2.0",method:"aria2.addUri",id:(new Date).getTime(),params:[[e.link],{out:e.name,header:n.getHeader()}]},a=n.getConfigData("md5Check"),s=t.params[1],l=n.getConfigData("downloadPath");if(l&&(s.dir=l),a&&(s.checksum="md5="+e.md5),r)for(var c in r)s[c]=r[c];n.sendToBackground("rpcData",n.generateParameter(i,o,t),function(e){e?n.showToast("下载成功!赶紧去看看吧~","success"):n.showToast("下载失败!是不是没有开启Aria2?","failure")})})}},{key:"aria2TXTMode",value:function(e){var t=this,n=[],a=[],i=[],o=[],r="data:text/plain;charset=utf-8,";e.forEach(function(e){var r="aria2c -c -s10 -k1M -x16 --enable-rpc=false -o "+JSON.stringify(e.name)+" "+t.getHeader("aria2Cmd")+" "+JSON.stringify(e.link),s=[e.link,t.getHeader("aria2c")," out="+e.name].join("\n");t.getConfigData("md5Check")&&(r+=" --checksum=md5="+e.md5,s+=" checksum=md5="+e.md5),n.push(r),a.push(s);var l=["<",e.link,t.getHeader("idm"),">"].join("\r\n");i.push(l),o.push(e.link)}),document.querySelector("#aria2CmdTxt").value=""+n.join("\n"),document.querySelector("#aria2Txt").href=""+r+encodeURIComponent(a.join("\n")),document.querySelector("#idmTxt").href=""+r+encodeURIComponent(i.join("\r\n")+"\r\n"),document.querySelector("#downloadLinkTxt").href=""+r+encodeURIComponent(o.join("\n")),document.querySelector("#copyDownloadLinkTxt").dataset.link=o.join("\n")}}]),e}();n.default=new s},{"./store":4}],3:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var a,i=function(){function e(e,t){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:300,t=arguments[1];this.interval=e,this.done=t,this.currentTaskId=(new Date).getTime(),this.getNextFile(this.currentTaskId)}},{key:"reset",value:function(){this.fileDownloadInfo=[],this.currentTaskId=0,this.folders=[],this.files={},this.completedCount=0}},{key:"addFolder",value:function(e){this.folders.push(e)}},{key:"addFile",value:function(e){this.files[e.fs_id]=e}},{key:"getNextFile",value:function(e){var t=this;if(e===this.currentTaskId)if(0!==this.folders.length){this.completedCount++,r.default.showToast("正在获取文件列表... "+this.completedCount+"/"+(this.completedCount+this.folders.length-1),"success");var n=this.folders.pop();this.listParameter.search.dir=n,fetch(""+window.location.origin+this.listParameter.url+r.default.objectToQueryString(this.listParameter.search),this.listParameter.options).then(function(n){n.ok?n.json().then(function(n){if(setTimeout(function(){return t.getNextFile(e)},t.interval),0!==n.errno)return r.default.showToast("未知错误","failure"),void console.log(n);n.list.forEach(function(e){e.isdir?t.folders.push(e.path):t.files[e.fs_id]=e})}):console.log(n)}).catch(function(n){r.default.showToast("网络请求失败","failure"),console.log(n),setTimeout(function(){return t.getNextFile(e)},t.interval)})}else 0!==this.files.length?(r.default.showToast("正在获取下载地址...","success"),this.getFiles(this.files).then(function(){t.done(t.fileDownloadInfo)})):(r.default.showToast("一个文件都没有哦...","caution"),this.reset())}},{key:"getFiles",value:function(e){throw new Error("subclass should implement this method!")}}]),e}();n.default=s},{"./core":2}],4:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var a,i=function(){function e(e,t){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:null;return e?this.configData[e]:this.configData}},{key:"set",value:function(e){this.configData=e,this.save(e),this.trigger("updateView",e)}},{key:"save",value:function(e){var t=function(t){chrome.storage.local.set(s({},t,e[t]),function(){console.log("chrome local set: %s, %s",t,e[t])}),!0===e.configSync&&chrome.storage.sync.set(s({},t,e[t]),function(){console.log("chrome sync set: %s, %s",t,e[t])})};for(var n in e)t(n)}},{key:"clear",value:function(){chrome.storage.sync.clear(),chrome.storage.local.clear(),this.configData=this.defaultConfigData,this.trigger("updateView",this.configData)}}]),t}();n.default=new l},{"./EventEmitter":1}],5:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var a=function(){function e(e,t){for(var n=0;n\n \n \n \n 导出下载\n \n \n \n ');var n=document.querySelector("#exportMenu");n.addEventListener("mouseenter",function(){n.classList.add("button-open")}),n.addEventListener("mouseleave",function(){n.classList.remove("button-open")});var a=document.querySelector("#settingButton"),i=document.querySelector("#settingMenu");a.addEventListener("click",function(){i.classList.add("open-o")})}},{key:"resetMenu",value:function(){Array.from(document.querySelectorAll(".rpc-button")).forEach(function(e){e.remove()})}},{key:"updateMenu",value:function(e){this.resetMenu();var t=e.rpcList,n="";t.forEach(function(e){var t='\n \n ');var t=document.querySelector("#textMenu"),n=t.querySelector(".modal-close"),a=t.querySelector("#copyDownloadLinkTxt");a.addEventListener("click",function(){i.default.copyText(a.dataset.link)}),n.addEventListener("click",function(){t.classList.remove("open-o"),e.resetTextExport()})}},{key:"resetTextExport",value:function(){var e=document.querySelector("#textMenu");e.querySelector("#aria2Txt").href="",e.querySelector("#idmTxt").href="",e.querySelector("#downloadLinkTxt").href="",e.querySelector("#aria2CmdTxt").value="",e.querySelector("#copyDownloadLinkTxt").dataset.link=""}},{key:"addSettingUI",value:function(){var e=this,t='\n ';document.body.insertAdjacentHTML("beforeend",t);var n=document.querySelector("#settingMenu");n.querySelector(".modal-close").addEventListener("click",function(){n.classList.remove("open-o"),e.resetSetting()}),document.querySelector("#addRPC").addEventListener("click",function(){var e=document.querySelectorAll(".rpc-s");Array.from(e).pop().insertAdjacentHTML("afterend",'\n
\n
\n \n
\n
\n \n
\n
\x3c!-- /.setting-menu-row --\x3e')});var a=document.querySelector("#apply"),r=document.querySelector("#message");a.addEventListener("click",function(){e.saveSetting(),r.innerText="设置已保存"}),document.querySelector("#reset").addEventListener("click",function(){o.default.trigger("clearConfigData"),r.innerText="设置已重置"});var s=document.querySelector("#testAria2");s.addEventListener("click",function(){i.default.getVersion(o.default.getConfigData("rpcList")[0].url,s)})}},{key:"resetSetting",value:function(){document.querySelector("#message").innerText="",document.querySelector("#testAria2").innerText="测试连接,成功显示版本号"}},{key:"updateSetting",value:function(e){var t=e.rpcList,n=e.configSync,a=e.md5Check,i=e.fold,o=e.interval,r=e.downloadPath,s=e.userAgent,l=e.referer,c=e.headers;Array.from(document.querySelectorAll(".rpc-s")).forEach(function(e,t){0!==t&&e.remove()}),t.forEach(function(e,t){var n=document.querySelectorAll(".rpc-s");if(0===t)n[t].querySelector(".name-s").value=e.name,n[t].querySelector(".url-s").value=e.url;else{var a='\n
\n
\n \n
\n
\n \n
\n
\x3c!-- /.setting-menu-row --\x3e';Array.from(n).pop().insertAdjacentHTML("afterend",a)}}),document.querySelector(".configSync-s").checked=n,document.querySelector(".md5Check-s").checked=a,document.querySelector(".fold-s").value=i,document.querySelector(".interval-s").value=o,document.querySelector(".downloadPath-s").value=r,document.querySelector(".userAgent-s").value=s,document.querySelector(".referer-s").value=l,document.querySelector(".headers-s").value=c}},{key:"saveSetting",value:function(){var e=document.querySelectorAll(".rpc-s"),t={rpcList:Array.from(e).map(function(e){var t=e.querySelector(".name-s").value,n=e.querySelector(".url-s").value;if(t&&n)return{name:t,url:n}}).filter(function(e){return e}),configSync:document.querySelector(".configSync-s").checked,md5Check:document.querySelector(".md5Check-s").checked,fold:Number.parseInt(document.querySelector(".fold-s").value),interval:document.querySelector(".interval-s").value,downloadPath:document.querySelector(".downloadPath-s").value,userAgent:document.querySelector(".userAgent-s").value,referer:document.querySelector(".referer-s").value,headers:document.querySelector(".headers-s").value};o.default.trigger("setConfigData",t)}}]),e}();n.default=new s},{"./core":2,"./store":4}],6:[function(e,t,n){"use strict";var a=function(){function e(e,t){for(var n=0;n\n \n ';document.body.insertAdjacentHTML("beforeend",i);var o=document.querySelector("#captchaMenu");o.querySelector(".modal-close").addEventListener("click",function(){o.remove()}),o.querySelector("#apply").addEventListener("click",function(){e.vcode_input=document.querySelector("#vcodeValue").value,a.getFiles(a.files,e).then(function(){t()}),o.remove()}),o.querySelector("#reset").addEventListener("click",function(){o.remove()}),o.querySelector("#change").addEventListener("click",function(){o.querySelector("#vcode").src="//pan.baidu.com/genimage?"+e.vcode_str+"&"+(new Date).getTime()})}},{key:"getCaptcha",value:function(e,t){var n=this,a={search:{prod:"share",bdstoken:window.yunData.MYBDSTOKEN,app_id:250528,channel:"chunlei",clienttype:0,web:1},url:"/api/getcaptcha?",options:{credentials:"include",method:"GET"}};fetch(""+window.location.origin+a.url+i.default.objectToQueryString(a.search),a.options).then(function(a){a.ok?a.json().then(function(a){if(0!==a.errno)return i.default.showToast("未知错误","failure"),void console.log(a);n.showCaptcha(a,e,t)}):console.log(a)}).catch(function(e){i.default.showToast("网络请求失败","failure"),console.log(e)})}},{key:"getPrefixLength",value:function(){var e=i.default.getHashParameter("list/path")||i.default.getHashParameter("path")||"";return e!==window.yunData.PATH?window.yunData.PATH.slice(0,window.yunData.PATH.lastIndexOf("/")).length+1:1===e.length?1:e.length+1}},{key:"getFiles",value:function(e,t){var n=this;this.files=e;var a=[];for(var o in e)a.push(e[o].fs_id);var r={encrypt:"0",product:"share",uk:window.yunData.SHARE_UK,primaryid:window.yunData.SHARE_ID,fid_list:JSON.stringify(a)};window.yunData.SHARE_PUBLIC||(r.extra=JSON.stringify({sekey:this.cookies})),t&&(r.vcode_input=t.vcode_input,r.vcode_str=t.vcode_str);var s={search:{timestamp:window.yunData.TIMESTAMP,sign:window.yunData.SIGN,bdstoken:window.yunData.MYBDSTOKEN,app_id:250528,channel:"chunlei",clienttype:0,web:1},url:"/api/sharedownload?",options:{body:i.default.objectToQueryString(r),credentials:"include",method:"POST",headers:{"Content-type":"application/x-www-form-urlencoded; charset=UTF-8"}}},l=this.getPrefixLength();return new Promise(function(e){fetch(""+window.location.origin+s.url+i.default.objectToQueryString(s.search),s.options).then(function(a){a.ok?a.json().then(function(a){0===a.errno?(a.list.forEach(function(e){n.fileDownloadInfo.push({name:e.path.substr(l),link:e.dlink,md5:e.md5})}),e()):-20===a.errno&&(i.default.showToast("请输入验证码以继续下载","caution"),t?n.getCaptcha(e,!0):n.getCaptcha(e,!1))}):console.log(a)}).catch(function(e){i.default.showToast("网络请求失败","failure"),console.log(e)})})}}]),t}())).startListen()},{"./lib/core":2,"./lib/downloader":3,"./lib/ui":5}]},{},[6]); -------------------------------------------------------------------------------- /BaiduExporter-master/chrome/release/js/start.js: -------------------------------------------------------------------------------- 1 | !function(){return function e(r,t,n){function o(a,d){if(!t[a]){if(!r[a]){var u="function"==typeof require&&require;if(!d&&u)return u(a,!0);if(i)return i(a,!0);var c=new Error("Cannot find module '"+a+"'");throw c.code="MODULE_NOT_FOUND",c}var s=t[a]={exports:{}};r[a][0].call(s.exports,function(e){var t=r[a][1][e];return o(t||e)},s,s.exports,e,r,t,n)}return t[a].exports}for(var i="function"==typeof require&&require,a=0;a 2 | 3 | 4 | 5 | 20 | 22 | 41 | 43 | 44 | 46 | image/svg+xml 47 | 49 | 50 | 51 | 52 | 53 | 59 | 65 | 74 | 80 | 86 | 92 | 98 | 99 | 100 | -------------------------------------------------------------------------------- /BaiduExporter-master/chrome/src/img/icon.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itgoyo/Aria2/0a6ce51d65c8d290ca20e06d1ca761cb49bb27b6/BaiduExporter-master/chrome/src/img/icon.jpg -------------------------------------------------------------------------------- /BaiduExporter-master/chrome/src/img/logo128.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itgoyo/Aria2/0a6ce51d65c8d290ca20e06d1ca761cb49bb27b6/BaiduExporter-master/chrome/src/img/logo128.png -------------------------------------------------------------------------------- /BaiduExporter-master/chrome/src/img/logo16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itgoyo/Aria2/0a6ce51d65c8d290ca20e06d1ca761cb49bb27b6/BaiduExporter-master/chrome/src/img/logo16.png -------------------------------------------------------------------------------- /BaiduExporter-master/chrome/src/img/logo32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itgoyo/Aria2/0a6ce51d65c8d290ca20e06d1ca761cb49bb27b6/BaiduExporter-master/chrome/src/img/logo32.png -------------------------------------------------------------------------------- /BaiduExporter-master/chrome/src/img/logo48.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itgoyo/Aria2/0a6ce51d65c8d290ca20e06d1ca761cb49bb27b6/BaiduExporter-master/chrome/src/img/logo48.png -------------------------------------------------------------------------------- /BaiduExporter-master/chrome/src/img/logo64.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itgoyo/Aria2/0a6ce51d65c8d290ca20e06d1ca761cb49bb27b6/BaiduExporter-master/chrome/src/img/logo64.png -------------------------------------------------------------------------------- /BaiduExporter-master/chrome/src/js/baidu.js: -------------------------------------------------------------------------------- 1 | class Baidu { 2 | constructor () { 3 | this.context = window.require('system-core:context/context.js').instanceForSystem 4 | this.context.log.send = function () {} 5 | } 6 | // 封装的百度的Toast提示消息 7 | // Type类型有 8 | // caution 警告 failure 失败 loading 加载 success 成功 9 | showToast ({message, type}) { 10 | this.context.ui.tip({ 11 | mode: type, 12 | msg: message 13 | }) 14 | } 15 | startListen () { 16 | window.addEventListener('message', (event) => { 17 | if (event.data.type && event.data.type === 'getSelected') { 18 | window.postMessage({ type: 'selected', data: this.context.list.getSelected() }, location.origin) 19 | } 20 | if (event.data.type && event.data.type === 'showToast') { 21 | this.showToast(event.data.data) 22 | } 23 | }) 24 | if (window.yunData) { 25 | // TODO 分析效果 26 | if (window.yunData.sign2) { 27 | const yunData = window.require('disk-system:widget/data/yunData.js').get() 28 | window.postMessage({ type: 'yunData', data: yunData }, location.origin) 29 | } else { 30 | window.postMessage({ type: 'yunData', data: JSON.parse(JSON.stringify(window.yunData)) }, location.origin) 31 | } 32 | } 33 | } 34 | } 35 | 36 | const baidu = new Baidu() 37 | 38 | baidu.startListen() 39 | -------------------------------------------------------------------------------- /BaiduExporter-master/chrome/src/js/home.js: -------------------------------------------------------------------------------- 1 | import Core from './lib/core' 2 | import UI from './lib/ui' 3 | import Downloader from './lib/downloader' 4 | 5 | class Home extends Downloader { 6 | constructor () { 7 | const search = { 8 | dir: '', 9 | channel: 'chunlei', 10 | clienttype: 0, 11 | web: 1 12 | } 13 | const listParameter = { 14 | search, 15 | url: `/api/list?`, 16 | options: { 17 | credentials: 'include', 18 | method: 'GET' 19 | } 20 | } 21 | super(listParameter) 22 | UI.init() 23 | UI.addMenu(document.querySelectorAll('.g-dropdown-button')[3], 'afterend') 24 | Core.requestCookies([{ url: 'https://pan.baidu.com/', name: 'BDUSS' }, { url: 'https://pcs.baidu.com/', name: 'pcsett' }]) 25 | Core.showToast('初始化成功!', 'success') 26 | this.mode = 'RPC' 27 | this.rpcURL = 'http://localhost:6800/jsonrpc' 28 | } 29 | 30 | startListen () { 31 | window.addEventListener('message', (event) => { 32 | if (event.source !== window) { 33 | return 34 | } 35 | 36 | if (event.data.type && event.data.type === 'selected') { 37 | this.reset() 38 | const selectedFile = event.data.data 39 | if (selectedFile.length === 0) { 40 | Core.showToast('请选择一下你要保存的文件哦', 'failure') 41 | return 42 | } 43 | selectedFile.forEach((item) => { 44 | if (item.isdir) { 45 | this.addFolder(item.path) 46 | } else { 47 | this.addFile(item) 48 | } 49 | }) 50 | this.start(Core.getConfigData('interval'), (fileDownloadInfo) => { 51 | if (this.mode === 'RPC') { 52 | Core.aria2RPCMode(this.rpcURL, fileDownloadInfo) 53 | } 54 | if (this.mode === 'TXT') { 55 | Core.aria2TXTMode(fileDownloadInfo) 56 | document.querySelector('#textMenu').classList.add('open-o') 57 | } 58 | }) 59 | } 60 | }) 61 | const menuButton = document.querySelector('#aria2List') 62 | menuButton.addEventListener('click', (event) => { 63 | const rpcURL = event.target.dataset.url 64 | if (rpcURL) { 65 | this.rpcURL = rpcURL 66 | this.getSelected() 67 | this.mode = 'RPC' 68 | } 69 | if (event.target.id === 'aria2Text') { 70 | this.getSelected() 71 | this.mode = 'TXT' 72 | } 73 | }) 74 | } 75 | 76 | getSelected () { 77 | window.postMessage({ type: 'getSelected' }, location.origin) 78 | } 79 | getPrefixLength () { 80 | const path = Core.getHashParameter('/all?path') || Core.getHashParameter('path') 81 | const fold = Core.getConfigData('fold') 82 | if (fold === -1 || path === '/') { 83 | return 1 84 | } else { 85 | const dir = path.split('/') 86 | let count = 0 87 | for (let i = 0; i < dir.length - fold; i++) { 88 | count = count + dir[i].length + 1 89 | } 90 | return count 91 | } 92 | } 93 | getFiles (files) { 94 | const prefix = this.getPrefixLength() 95 | for (let key in files) { 96 | this.fileDownloadInfo.push({ 97 | name: files[key].path.substr(prefix), 98 | link: `${location.protocol}//pcs.baidu.com/rest/2.0/pcs/file?method=download&app_id=250528&path=${encodeURIComponent(files[key].path)}`, 99 | md5: files[key].md5 100 | }) 101 | } 102 | return Promise.resolve() 103 | } 104 | } 105 | 106 | const home = new Home() 107 | 108 | home.startListen() 109 | -------------------------------------------------------------------------------- /BaiduExporter-master/chrome/src/js/lib/EventEmitter.js: -------------------------------------------------------------------------------- 1 | class EventEmitter { 2 | constructor () { 3 | this._listeners = {} 4 | } 5 | 6 | /** 7 | * @param {string} name - event name 8 | * @param {function(data: *): void} fn - listener function 9 | */ 10 | on (name, fn) { 11 | const list = this._listeners[name] = this._listeners[name] || [] 12 | list.push(fn) 13 | } 14 | 15 | /** 16 | * @param {string} name - event name 17 | * @param {*} data - data to emit event listeners 18 | */ 19 | trigger (name, data) { 20 | const fns = this._listeners[name] || [] 21 | fns.forEach(fn => fn(data)) 22 | } 23 | 24 | /** 25 | * @param {string} name - event name 26 | */ 27 | off (name) { 28 | delete this._listeners[name] 29 | } 30 | } 31 | 32 | export default EventEmitter 33 | -------------------------------------------------------------------------------- /BaiduExporter-master/chrome/src/js/lib/core.js: -------------------------------------------------------------------------------- 1 | import Store from './store' 2 | 3 | class Core { 4 | constructor () { 5 | this.cookies = {} 6 | } 7 | httpSend ({url, options}, resolve, reject) { 8 | fetch(url, options).then((response) => { 9 | if (response.ok) { 10 | response.json().then((data) => { 11 | resolve(data) 12 | }) 13 | } else { 14 | reject(response) 15 | } 16 | }).catch((err) => { 17 | reject(err) 18 | }) 19 | } 20 | getConfigData (key = null) { 21 | return Store.getConfigData(key) 22 | } 23 | objectToQueryString (obj) { 24 | return Object.keys(obj).map((key) => { 25 | return `${encodeURIComponent(key)}=${encodeURIComponent(obj[key])}` 26 | }).join('&') 27 | } 28 | sendToBackground (method, data, callback) { 29 | chrome.runtime.sendMessage({ 30 | method, 31 | data 32 | }, callback) 33 | } 34 | showToast (message, type) { 35 | window.postMessage({ type: 'showToast', data: { message, type } }, location.origin) 36 | } 37 | getHashParameter (name) { 38 | const hash = window.location.hash 39 | const paramsString = hash.substr(1) 40 | const searchParams = new URLSearchParams(paramsString) 41 | return searchParams.get(name) 42 | } 43 | formatCookies () { 44 | const cookies = [] 45 | for (let key in this.cookies) { 46 | cookies.push(`${key}=${this.cookies[key]}`) 47 | } 48 | return cookies.join('; ') 49 | } 50 | getHeader (type = 'RPC') { 51 | const headerOption = [] 52 | headerOption.push(`User-Agent: ${this.getConfigData('userAgent')}`) 53 | headerOption.push(`Referer: ${this.getConfigData('referer')}`) 54 | if (Object.keys(this.cookies).length > 0) { 55 | headerOption.push(`Cookie: ${this.formatCookies()}`) 56 | } 57 | const headers = this.getConfigData('headers') 58 | if (headers) { 59 | headers.split('\n').forEach((item) => { 60 | headerOption.push(item) 61 | }) 62 | } 63 | if (type === 'RPC') { 64 | return headerOption 65 | } else if (type === 'aria2Cmd') { 66 | return headerOption.map(item => `--header ${JSON.stringify(item)}`).join(' ') 67 | } else if (type === 'aria2c') { 68 | return headerOption.map(item => ` header=${item}`).join('\n') 69 | } else if (type === 'idm') { 70 | return headerOption.map((item) => { 71 | const headers = item.split(': ') 72 | return `${headers[0].toLowerCase()}: ${headers[1]}` 73 | }).join('\r\n') 74 | } 75 | } 76 | // 解析 RPC地址 返回验证数据 和地址 77 | parseURL (url) { 78 | const parseURL = new URL(url) 79 | let authStr = parseURL.username ? `${parseURL.username}:${decodeURI(parseURL.password)}` : null 80 | if (authStr) { 81 | if (!authStr.includes('token:')) { 82 | authStr = `Basic ${btoa(authStr)}` 83 | } 84 | } 85 | const paramsString = parseURL.hash.substr(1) 86 | let options = {} 87 | const searchParams = new URLSearchParams(paramsString) 88 | for (let key of searchParams) { 89 | options[key[0]] = key.length === 2 ? key[1] : 'enabled' 90 | } 91 | const path = parseURL.origin + parseURL.pathname 92 | return {authStr, path, options} 93 | } 94 | generateParameter (authStr, path, data) { 95 | if (authStr && authStr.startsWith('token')) { 96 | data.params.unshift(authStr) 97 | } 98 | const parameter = { 99 | url: path, 100 | options: { 101 | method: 'POST', 102 | headers: { 103 | 'Content-type': 'application/x-www-form-urlencoded; charset=UTF-8' 104 | }, 105 | body: JSON.stringify(data) 106 | } 107 | } 108 | if (authStr && authStr.startsWith('Basic')) { 109 | parameter.options.headers['Authorization'] = authStr 110 | } 111 | return parameter 112 | } 113 | // get aria2 version 114 | getVersion (rpcPath, element) { 115 | let data = { 116 | jsonrpc: '2.0', 117 | method: 'aria2.getVersion', 118 | id: 1, 119 | params: [] 120 | } 121 | const {authStr, path} = this.parseURL(rpcPath) 122 | this.sendToBackground('rpcVersion', this.generateParameter(authStr, path, data), (version) => { 123 | if (version) { 124 | element.innerText = `Aria2版本为: ${version}` 125 | } else { 126 | element.innerText = '错误,请查看是否开启Aria2' 127 | } 128 | }) 129 | } 130 | copyText (text) { 131 | const input = document.createElement('textarea') 132 | document.body.appendChild(input) 133 | input.value = text 134 | input.focus() 135 | input.select() 136 | const result = document.execCommand('copy') 137 | input.remove() 138 | if (result) { 139 | this.showToast('拷贝成功~', 'success') 140 | } else { 141 | this.showToast('拷贝失败 QAQ', 'failure') 142 | } 143 | } 144 | // cookies format [{"url": "http://pan.baidu.com/", "name": "BDUSS"},{"url": "http://pcs.baidu.com/", "name": "pcsett"}] 145 | requestCookies (cookies) { 146 | this.sendToBackground('getCookies', cookies, (value) => { this.cookies = value }) 147 | } 148 | aria2RPCMode (rpcPath, fileDownloadInfo) { 149 | const {authStr, path, options} = this.parseURL(rpcPath) 150 | fileDownloadInfo.forEach((file) => { 151 | const rpcData = { 152 | jsonrpc: '2.0', 153 | method: 'aria2.addUri', 154 | id: new Date().getTime(), 155 | params: [ 156 | [file.link], { 157 | out: file.name, 158 | header: this.getHeader() 159 | } 160 | ] 161 | } 162 | const md5Check = this.getConfigData('md5Check') 163 | const rpcOption = rpcData.params[1] 164 | const dir = this.getConfigData('downloadPath') 165 | if (dir) { 166 | rpcOption['dir'] = dir 167 | } 168 | if (md5Check) { 169 | rpcOption['checksum'] = `md5=${file.md5}` 170 | } 171 | if (options) { 172 | for (let key in options) { 173 | rpcOption[key] = options[key] 174 | } 175 | } 176 | this.sendToBackground('rpcData', this.generateParameter(authStr, path, rpcData), (success) => { 177 | if (success) { 178 | this.showToast('下载成功!赶紧去看看吧~', 'success') 179 | } else { 180 | this.showToast('下载失败!是不是没有开启Aria2?', 'failure') 181 | } 182 | }) 183 | }) 184 | } 185 | aria2TXTMode (fileDownloadInfo) { 186 | const aria2CmdTxt = [] 187 | const aria2Txt = [] 188 | const idmTxt = [] 189 | const downloadLinkTxt = [] 190 | const prefixTxt = 'data:text/plain;charset=utf-8,' 191 | fileDownloadInfo.forEach((file) => { 192 | let aria2CmdLine = `aria2c -c -s10 -k1M -x16 --enable-rpc=false -o ${JSON.stringify(file.name)} ${this.getHeader('aria2Cmd')} ${JSON.stringify(file.link)}` 193 | let aria2Line = [file.link, this.getHeader('aria2c'), ` out=${file.name}`].join('\n') 194 | const md5Check = this.getConfigData('md5Check') 195 | if (md5Check) { 196 | aria2CmdLine += ` --checksum=md5=${file.md5}` 197 | aria2Line += ` checksum=md5=${file.md5}` 198 | } 199 | aria2CmdTxt.push(aria2CmdLine) 200 | aria2Txt.push(aria2Line) 201 | const idmLine = ['<', file.link, this.getHeader('idm'), '>'].join('\r\n') 202 | idmTxt.push(idmLine) 203 | downloadLinkTxt.push(file.link) 204 | }) 205 | document.querySelector('#aria2CmdTxt').value = `${aria2CmdTxt.join('\n')}` 206 | document.querySelector('#aria2Txt').href = `${prefixTxt}${encodeURIComponent(aria2Txt.join('\n'))}` 207 | document.querySelector('#idmTxt').href = `${prefixTxt}${encodeURIComponent(idmTxt.join('\r\n') + '\r\n')}` 208 | document.querySelector('#downloadLinkTxt').href = `${prefixTxt}${encodeURIComponent(downloadLinkTxt.join('\n'))}` 209 | document.querySelector('#copyDownloadLinkTxt').dataset.link = downloadLinkTxt.join('\n') 210 | } 211 | } 212 | 213 | export default new Core() 214 | -------------------------------------------------------------------------------- /BaiduExporter-master/chrome/src/js/lib/downloader.js: -------------------------------------------------------------------------------- 1 | import Core from './core' 2 | 3 | class Downloader { 4 | constructor (listParameter) { 5 | this.listParameter = listParameter 6 | this.fileDownloadInfo = [] 7 | this.currentTaskId = 0 8 | this.completedCount = 0 9 | this.folders = [] 10 | this.files = {} 11 | } 12 | start (interval = 300, done) { 13 | this.interval = interval 14 | this.done = done 15 | this.currentTaskId = new Date().getTime() 16 | this.getNextFile(this.currentTaskId) 17 | } 18 | reset () { 19 | this.fileDownloadInfo = [] 20 | this.currentTaskId = 0 21 | this.folders = [] 22 | this.files = {} 23 | this.completedCount = 0 24 | } 25 | addFolder (path) { 26 | this.folders.push(path) 27 | } 28 | addFile (file) { 29 | this.files[file.fs_id] = file 30 | } 31 | getNextFile (taskId) { 32 | if (taskId !== this.currentTaskId) { 33 | return 34 | } 35 | if (this.folders.length !== 0) { 36 | this.completedCount++ 37 | Core.showToast(`正在获取文件列表... ${this.completedCount}/${this.completedCount + this.folders.length - 1}`, 'success') 38 | const dir = this.folders.pop() 39 | this.listParameter.search.dir = dir 40 | fetch(`${window.location.origin}${this.listParameter.url}${Core.objectToQueryString(this.listParameter.search)}`, this.listParameter.options).then((response) => { 41 | if (response.ok) { 42 | response.json().then((data) => { 43 | setTimeout(() => this.getNextFile(taskId), this.interval) 44 | if (data.errno !== 0) { 45 | Core.showToast('未知错误', 'failure') 46 | console.log(data) 47 | return 48 | } 49 | data.list.forEach((item) => { 50 | if (item.isdir) { 51 | this.folders.push(item.path) 52 | } else { 53 | this.files[item.fs_id] = item 54 | } 55 | }) 56 | }) 57 | } else { 58 | console.log(response) 59 | } 60 | }).catch((err) => { 61 | Core.showToast('网络请求失败', 'failure') 62 | console.log(err) 63 | setTimeout(() => this.getNextFile(taskId), this.interval) 64 | }) 65 | } else if (this.files.length !== 0) { 66 | Core.showToast('正在获取下载地址...', 'success') 67 | this.getFiles(this.files).then(() => { 68 | this.done(this.fileDownloadInfo) 69 | }) 70 | } else { 71 | Core.showToast('一个文件都没有哦...', 'caution') 72 | this.reset() 73 | } 74 | } 75 | 76 | getFiles (files) { 77 | throw new Error('subclass should implement this method!') 78 | } 79 | } 80 | 81 | export default Downloader 82 | -------------------------------------------------------------------------------- /BaiduExporter-master/chrome/src/js/lib/store.js: -------------------------------------------------------------------------------- 1 | import EventEmitter from './EventEmitter' 2 | 3 | class Store extends EventEmitter { 4 | constructor () { 5 | super() 6 | this.defaultRPC = [{name: 'ARIA2 RPC', url: 'http://localhost:6800/jsonrpc'}] 7 | this.defaultUserAgent = 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.132 Safari/537.36' 8 | this.defaultReferer = 'https://pan.baidu.com/disk/home' 9 | this.defaultConfigData = { 10 | rpcList: this.defaultRPC, 11 | configSync: false, 12 | md5Check: false, 13 | fold: 0, 14 | interval: 300, 15 | downloadPath: '', 16 | userAgent: this.defaultUserAgent, 17 | referer: this.defaultReferer, 18 | headers: '' 19 | } 20 | this.configData = {} 21 | this.on('initConfigData', this.init.bind(this)) 22 | this.on('setConfigData', this.set.bind(this)) 23 | this.on('clearConfigData', this.clear.bind(this)) 24 | } 25 | init () { 26 | chrome.storage.sync.get(null, (items) => { 27 | for (let key in items) { 28 | chrome.storage.local.set({key: items[key]}, () => { 29 | console.log('chrome first local set: %s, %s', key, items[key]) 30 | }) 31 | } 32 | }) 33 | chrome.storage.local.get(null, (items) => { 34 | this.configData = Object.assign({}, this.defaultConfigData, items) 35 | this.trigger('updateView', this.configData) 36 | }) 37 | } 38 | getConfigData (key = null) { 39 | if (key) { 40 | return this.configData[key] 41 | } else { 42 | return this.configData 43 | } 44 | } 45 | set (configData) { 46 | this.configData = configData 47 | this.save(configData) 48 | this.trigger('updateView', configData) 49 | } 50 | save (configData) { 51 | for (let key in configData) { 52 | chrome.storage.local.set({[key]: configData[key]}, () => { 53 | console.log('chrome local set: %s, %s', key, configData[key]) 54 | }) 55 | if (configData['configSync'] === true) { 56 | chrome.storage.sync.set({[key]: configData[key]}, () => { 57 | console.log('chrome sync set: %s, %s', key, configData[key]) 58 | }) 59 | } 60 | } 61 | } 62 | clear () { 63 | chrome.storage.sync.clear() 64 | chrome.storage.local.clear() 65 | this.configData = this.defaultConfigData 66 | this.trigger('updateView', this.configData) 67 | } 68 | } 69 | 70 | export default new Store() 71 | -------------------------------------------------------------------------------- /BaiduExporter-master/chrome/src/js/lib/ui.js: -------------------------------------------------------------------------------- 1 | import Core from './core' 2 | import Store from './store' 3 | 4 | class UI { 5 | constructor () { 6 | this.version = '1.0.2' 7 | this.updateDate = '2017/12/30' 8 | Store.on('updateView', (configData) => { 9 | this.updateSetting(configData) 10 | this.updateMenu(configData) 11 | }) 12 | } 13 | init () { 14 | this.addSettingUI() 15 | this.addTextExport() 16 | Store.trigger('initConfigData') 17 | } 18 | // z-index resolve share page show problem 19 | addMenu (element, position) { 20 | const menu = ` 21 | ` 33 | element.insertAdjacentHTML(position, menu) 34 | const exportMenu = document.querySelector('#exportMenu') 35 | exportMenu.addEventListener('mouseenter', () => { 36 | exportMenu.classList.add('button-open') 37 | }) 38 | exportMenu.addEventListener('mouseleave', () => { 39 | exportMenu.classList.remove('button-open') 40 | }) 41 | const settingButton = document.querySelector('#settingButton') 42 | const settingMenu = document.querySelector('#settingMenu') 43 | settingButton.addEventListener('click', () => { 44 | settingMenu.classList.add('open-o') 45 | }) 46 | } 47 | resetMenu () { 48 | Array.from(document.querySelectorAll('.rpc-button')).forEach((rpc) => { 49 | rpc.remove() 50 | }) 51 | } 52 | updateMenu (configData) { 53 | this.resetMenu() 54 | const { rpcList } = configData 55 | let rpcDOMList = '' 56 | rpcList.forEach((rpc) => { 57 | const rpcDOM = `${rpc.name}` 58 | rpcDOMList += rpcDOM 59 | }) 60 | document.querySelector('#aria2List').insertAdjacentHTML('afterbegin', rpcDOMList) 61 | } 62 | addTextExport () { 63 | const text = ` 64 | ` 83 | document.body.insertAdjacentHTML('beforeend', text) 84 | const textMenu = document.querySelector('#textMenu') 85 | const close = textMenu.querySelector('.modal-close') 86 | const copyDownloadLinkTxt = textMenu.querySelector('#copyDownloadLinkTxt') 87 | copyDownloadLinkTxt.addEventListener('click', () => { 88 | Core.copyText(copyDownloadLinkTxt.dataset.link) 89 | }) 90 | close.addEventListener('click', () => { 91 | textMenu.classList.remove('open-o') 92 | this.resetTextExport() 93 | }) 94 | } 95 | resetTextExport () { 96 | const textMenu = document.querySelector('#textMenu') 97 | textMenu.querySelector('#aria2Txt').href = '' 98 | textMenu.querySelector('#idmTxt').href = '' 99 | textMenu.querySelector('#downloadLinkTxt').href = '' 100 | textMenu.querySelector('#aria2CmdTxt').value = '' 101 | textMenu.querySelector('#copyDownloadLinkTxt').dataset.link = '' 102 | } 103 | addSettingUI () { 104 | const setting = ` 105 | ` 210 | document.body.insertAdjacentHTML('beforeend', setting) 211 | const settingMenu = document.querySelector('#settingMenu') 212 | const close = settingMenu.querySelector('.modal-close') 213 | close.addEventListener('click', () => { 214 | settingMenu.classList.remove('open-o') 215 | this.resetSetting() 216 | }) 217 | const addRPC = document.querySelector('#addRPC') 218 | addRPC.addEventListener('click', () => { 219 | const rpcDOMList = document.querySelectorAll('.rpc-s') 220 | const RPC = ` 221 |
222 |
223 | 224 |
225 |
226 | 227 |
228 |
` 229 | Array.from(rpcDOMList).pop().insertAdjacentHTML('afterend', RPC) 230 | }) 231 | const apply = document.querySelector('#apply') 232 | const message = document.querySelector('#message') 233 | apply.addEventListener('click', () => { 234 | this.saveSetting() 235 | message.innerText = '设置已保存' 236 | }) 237 | 238 | const reset = document.querySelector('#reset') 239 | reset.addEventListener('click', () => { 240 | Store.trigger('clearConfigData') 241 | message.innerText = '设置已重置' 242 | }) 243 | 244 | const testAria2 = document.querySelector('#testAria2') 245 | testAria2.addEventListener('click', () => { 246 | Core.getVersion(Store.getConfigData('rpcList')[0].url, testAria2) 247 | }) 248 | } 249 | resetSetting () { 250 | const message = document.querySelector('#message') 251 | message.innerText = '' 252 | const testAria2 = document.querySelector('#testAria2') 253 | testAria2.innerText = '测试连接,成功显示版本号' 254 | } 255 | updateSetting (configData) { 256 | const { rpcList, configSync, md5Check, fold, interval, downloadPath, userAgent, referer, headers } = configData 257 | // reset dom 258 | Array.from(document.querySelectorAll('.rpc-s')).forEach((rpc, index) => { 259 | if (index !== 0) { 260 | rpc.remove() 261 | } 262 | }) 263 | rpcList.forEach((rpc, index) => { 264 | const rpcDOMList = document.querySelectorAll('.rpc-s') 265 | if (index === 0) { 266 | rpcDOMList[index].querySelector('.name-s').value = rpc.name 267 | rpcDOMList[index].querySelector('.url-s').value = rpc.url 268 | } else { 269 | const RPC = ` 270 |
271 |
272 | 273 |
274 |
275 | 276 |
277 |
` 278 | Array.from(rpcDOMList).pop().insertAdjacentHTML('afterend', RPC) 279 | } 280 | }) 281 | document.querySelector('.configSync-s').checked = configSync 282 | document.querySelector('.md5Check-s').checked = md5Check 283 | document.querySelector('.fold-s').value = fold 284 | document.querySelector('.interval-s').value = interval 285 | document.querySelector('.downloadPath-s').value = downloadPath 286 | document.querySelector('.userAgent-s').value = userAgent 287 | document.querySelector('.referer-s').value = referer 288 | document.querySelector('.headers-s').value = headers 289 | } 290 | 291 | saveSetting () { 292 | const rpcDOMList = document.querySelectorAll('.rpc-s') 293 | const rpcList = Array.from(rpcDOMList).map((rpc) => { 294 | const name = rpc.querySelector('.name-s').value 295 | const url = rpc.querySelector('.url-s').value 296 | if (name && url) { 297 | return { name, url } 298 | } 299 | }).filter(el => el) 300 | const configSync = document.querySelector('.configSync-s').checked 301 | const md5Check = document.querySelector('.md5Check-s').checked 302 | const fold = Number.parseInt(document.querySelector('.fold-s').value) 303 | const interval = document.querySelector('.interval-s').value 304 | const downloadPath = document.querySelector('.downloadPath-s').value 305 | const userAgent = document.querySelector('.userAgent-s').value 306 | const referer = document.querySelector('.referer-s').value 307 | const headers = document.querySelector('.headers-s').value 308 | 309 | const configData = { 310 | rpcList, 311 | configSync, 312 | md5Check, 313 | fold, 314 | interval, 315 | downloadPath, 316 | userAgent, 317 | referer, 318 | headers 319 | } 320 | Store.trigger('setConfigData', configData) 321 | } 322 | } 323 | 324 | export default new UI() 325 | -------------------------------------------------------------------------------- /BaiduExporter-master/chrome/src/js/share.js: -------------------------------------------------------------------------------- 1 | import Core from './lib/core' 2 | import UI from './lib/ui' 3 | import Downloader from './lib/downloader' 4 | 5 | class Share extends Downloader { 6 | constructor () { 7 | const search = { 8 | dir: '', 9 | bdstoken: window.yunData.MYBDSTOKEN, 10 | uk: window.yunData.SHARE_UK, 11 | shareid: window.yunData.SHARE_ID, 12 | channel: 'chunlei', 13 | clienttype: 0, 14 | web: 1 15 | } 16 | const listParameter = { 17 | search, 18 | url: `/share/list?`, 19 | options: { 20 | credentials: 'include', 21 | method: 'GET' 22 | } 23 | } 24 | super(listParameter) 25 | UI.init() 26 | UI.addMenu(document.querySelector('a[data-button-id="b1"]'), 'beforebegin') 27 | Core.requestCookies([{ url: 'https://pan.baidu.com/', name: 'BDUSS' }, { url: 'https://pcs.baidu.com/', name: 'pcsett' }]) 28 | // fix export button position 29 | document.querySelector('.bar').style.position = 'absolute' 30 | Core.showToast('初始化成功!', 'success') 31 | this.mode = 'RPC' 32 | this.rpcURL = 'http://localhost:6800/jsonrpc' 33 | this.cookies = null 34 | this.files = {} 35 | this.requestCookies() 36 | } 37 | 38 | startDownload () { 39 | this.start(Core.getConfigData('interval'), (fileDownloadInfo) => { 40 | console.log(fileDownloadInfo) 41 | if (this.mode === 'RPC') { 42 | Core.aria2RPCMode(this.rpcURL, fileDownloadInfo) 43 | } 44 | if (this.mode === 'TXT') { 45 | Core.aria2TXTMode(fileDownloadInfo) 46 | document.querySelector('#textMenu').classList.add('open-o') 47 | } 48 | }) 49 | } 50 | 51 | requestCookies () { 52 | Core.sendToBackground('getCookies', [{ url: 'http://pan.baidu.com/', name: 'BDCLND' }], (value) => { this.cookies = decodeURIComponent(value['BDCLND']) }) 53 | } 54 | startListen () { 55 | window.addEventListener('message', (event) => { 56 | if (event.source !== window) { 57 | return 58 | } 59 | 60 | if (event.data.type && event.data.type === 'selected') { 61 | this.reset() 62 | const selectedFile = event.data.data 63 | console.log(selectedFile) 64 | if (selectedFile.length === 0) { 65 | Core.showToast('请选择一下你要保存的文件哦', 'failure') 66 | return 67 | } 68 | selectedFile.forEach((item) => { 69 | if (item.isdir) { 70 | this.addFolder(item.path) 71 | } else { 72 | this.addFile(item) 73 | } 74 | }) 75 | this.startDownload() 76 | } 77 | }) 78 | const menuButton = document.querySelector('#aria2List') 79 | menuButton.addEventListener('click', (event) => { 80 | const rpcURL = event.target.dataset.url 81 | if (rpcURL) { 82 | this.rpcURL = rpcURL 83 | this.getSelected() 84 | this.mode = 'RPC' 85 | } 86 | if (event.target.id === 'aria2Text') { 87 | this.getSelected() 88 | this.mode = 'TXT' 89 | } 90 | }) 91 | } 92 | 93 | getSelected () { 94 | if (window.yunData.SHAREPAGETYPE === 'single_file_page') { 95 | this.reset() 96 | this.addFile({ 97 | fs_id: window.yunData.FS_ID 98 | }) 99 | this.startDownload() 100 | } else { 101 | window.postMessage({ type: 'getSelected' }, location.origin) 102 | } 103 | } 104 | showCaptcha (data, resolve, auth) { 105 | const captcha = ` 106 | ` 131 | document.body.insertAdjacentHTML('beforeend', captcha) 132 | const captchaMenu = document.querySelector('#captchaMenu') 133 | const close = captchaMenu.querySelector('.modal-close') 134 | close.addEventListener('click', () => { 135 | captchaMenu.remove() 136 | }) 137 | const apply = captchaMenu.querySelector('#apply') 138 | apply.addEventListener('click', () => { 139 | data['vcode_input'] = document.querySelector('#vcodeValue').value 140 | this.getFiles(this.files, data).then(() => { 141 | resolve() 142 | }) 143 | captchaMenu.remove() 144 | }) 145 | const reset = captchaMenu.querySelector('#reset') 146 | reset.addEventListener('click', () => { 147 | captchaMenu.remove() 148 | }) 149 | const change = captchaMenu.querySelector('#change') 150 | change.addEventListener('click', () => { 151 | captchaMenu.querySelector('#vcode').src = `//pan.baidu.com/genimage?${data.vcode_str}&${new Date().getTime()}` 152 | }) 153 | } 154 | getCaptcha (resolve, auth) { 155 | const search = { 156 | prod: 'share', 157 | bdstoken: window.yunData.MYBDSTOKEN, 158 | app_id: 250528, 159 | channel: 'chunlei', 160 | clienttype: 0, 161 | web: 1 162 | } 163 | const parameter = { 164 | search, 165 | url: `/api/getcaptcha?`, 166 | options: { 167 | credentials: 'include', 168 | method: 'GET' 169 | } 170 | } 171 | fetch(`${window.location.origin}${parameter.url}${Core.objectToQueryString(parameter.search)}`, parameter.options).then((response) => { 172 | if (response.ok) { 173 | response.json().then((data) => { 174 | if (data.errno !== 0) { 175 | Core.showToast('未知错误', 'failure') 176 | console.log(data) 177 | return 178 | } 179 | this.showCaptcha(data, resolve, auth) 180 | }) 181 | } else { 182 | console.log(response) 183 | } 184 | }).catch((err) => { 185 | Core.showToast('网络请求失败', 'failure') 186 | console.log(err) 187 | }) 188 | } 189 | getPrefixLength () { 190 | const path = Core.getHashParameter('list/path') || Core.getHashParameter('path') || '' 191 | // solution for example :链接:http://pan.baidu.com/s/1hqOIdUk 密码:qat2 192 | if (path !== window.yunData.PATH) { 193 | return window.yunData.PATH.slice(0, window.yunData.PATH.lastIndexOf('/')).length + 1 194 | } else { 195 | return path.length === 1 ? 1 : path.length + 1 196 | } 197 | } 198 | getFiles (files, captcha) { 199 | this.files = files 200 | let list = [] 201 | for (let key in files) { 202 | list.push(files[key].fs_id) 203 | } 204 | const body = { 205 | encrypt: '0', 206 | product: 'share', 207 | uk: window.yunData.SHARE_UK, 208 | primaryid: window.yunData.SHARE_ID, 209 | fid_list: JSON.stringify(list) 210 | } 211 | 212 | if (!window.yunData.SHARE_PUBLIC) { 213 | body['extra'] = JSON.stringify({ sekey: this.cookies }) 214 | } 215 | if (captcha) { 216 | body['vcode_input'] = captcha['vcode_input'] 217 | body['vcode_str'] = captcha['vcode_str'] 218 | } 219 | const search = { 220 | timestamp: window.yunData.TIMESTAMP, 221 | sign: window.yunData.SIGN, 222 | bdstoken: window.yunData.MYBDSTOKEN, 223 | app_id: 250528, 224 | channel: 'chunlei', 225 | clienttype: 0, 226 | web: 1 227 | } 228 | const parameter = { 229 | search, 230 | url: `/api/sharedownload?`, 231 | options: { 232 | body: Core.objectToQueryString(body), 233 | credentials: 'include', 234 | method: 'POST', 235 | headers: { 236 | 'Content-type': 'application/x-www-form-urlencoded; charset=UTF-8' 237 | } 238 | } 239 | } 240 | const prefix = this.getPrefixLength() 241 | return new Promise((resolve) => { 242 | fetch(`${window.location.origin}${parameter.url}${Core.objectToQueryString(parameter.search)}`, parameter.options).then((response) => { 243 | if (response.ok) { 244 | response.json().then((data) => { 245 | if (data.errno === 0) { 246 | data.list.forEach((item) => { 247 | this.fileDownloadInfo.push({ 248 | name: item.path.substr(prefix), 249 | link: item.dlink, 250 | md5: item.md5 251 | }) 252 | }) 253 | resolve() 254 | } else if (data.errno === -20) { 255 | Core.showToast('请输入验证码以继续下载', 'caution') 256 | if (captcha) { 257 | this.getCaptcha(resolve, true) 258 | } else { 259 | this.getCaptcha(resolve, false) 260 | } 261 | } 262 | }) 263 | } else { 264 | console.log(response) 265 | } 266 | }).catch((err) => { 267 | Core.showToast('网络请求失败', 'failure') 268 | console.log(err) 269 | }) 270 | }) 271 | } 272 | } 273 | 274 | const share = new Share() 275 | 276 | share.startListen() 277 | -------------------------------------------------------------------------------- /BaiduExporter-master/chrome/src/js/start.js: -------------------------------------------------------------------------------- 1 | if (typeof browser !== 'undefined') { 2 | chrome = browser 3 | } 4 | 5 | function requestAddScript (name) { 6 | chrome.runtime.sendMessage({ 7 | method: 'addScript', 8 | data: `js/${name}.js` 9 | }) 10 | } 11 | window.addEventListener('message', function (event) { 12 | if (event.data.type === 'yunData') { 13 | window.yunData = event.data.data 14 | if (window.location.href.includes('/disk/home')) { 15 | requestAddScript('home') 16 | } else { 17 | requestAddScript('share') 18 | } 19 | } 20 | }) 21 | 22 | function addBaiduJS () { 23 | let script = document.createElement('script') 24 | script.src = chrome.runtime.getURL('js/baidu.js') 25 | document.body.appendChild(script) 26 | } 27 | 28 | if (document.readyState === 'complete') { 29 | // run on firefox 30 | addBaiduJS() 31 | } else { 32 | // run on chrome 33 | window.addEventListener('load', addBaiduJS) 34 | } 35 | -------------------------------------------------------------------------------- /BaiduExporter-master/chrome/updates.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ## ↓支持一下 2 | [![GitHub stars](https://img.shields.io/github/stars/itgoyo/Aria2.svg?style=social&label=Star)](https://github.com/itgoyo/Aria2) [![GitHub forks](https://img.shields.io/github/forks/itgoyo/Aria2.svg?style=social&label=Fork)](https://github.com/itgoyo/Aria2/fork) [![GitHub watchers](https://img.shields.io/github/watchers/itgoyo/Aria2.svg?style=social&label=Watch)](https://github.com/itgoyo/Aria2) [![GitHub followers](https://img.shields.io/github/followers/itgoyo.svg?style=social&label=Follow)](https://github.com/itgoyo/Aria2) 3 | 4 | * [Aria2](#aria2) 5 | * [webui-aria2](#webui-aria2) 6 | * [YAAW](#yaaw) 7 | * [Aria2-GUI](#aria2-gui) 8 | * [增加chrome插件安装](#增加chrome插件安装) 9 | * [关于导入插件老是提示“建议停止开发者模式”解决方法(仅适用于.crx插件)](#关于导入插件老是提示建议停止开发者模式解决方法仅适用于crx插件) 10 | 11 | * [如果您是Mac用户](#如果您是mac用户) 12 | * [BaiduPCS-Go](#baidupcs-go) 13 | * [Tampermonkey](#tampermonkey) 14 | * [Proxyee-down](#proxyee-down) 15 | * [下载](#下载) 16 | * [安装](#安装) 17 | * [安装成功](#安装成功) 18 | * [常见问题(必看)](#常见问题必看) 19 | * [常用功能](#常用功能) 20 | * [手动创建任务](#手动创建任务) 21 | * [刷新任务下载链接](#刷新任务下载链接) 22 | * [速盘](#速盘) 23 | * [Pandownload](#Pandownload) 24 | * [百度网盘直链下载助手](#百度网盘直链下载助手) 25 | * [手机百度云客户端](#手机百度云客户端) 26 | * [如果觉得对您有帮助,想请我喝咖啡](#如果觉得对您有帮助想请我喝咖啡) 27 | 28 | 29 | # Aria2 30 | 31 | **aria2是基于命令行的下载工具,不过还好大神们早已开发了各种易用的UI方便我们小白们使用** 32 | 33 | ## webui-aria2 34 | [http://ziahamza.github.io/webui-aria2/](http://ziahamza.github.io/webui-aria2/) 35 | 36 | ## YAAW 37 | [http://binux.github.io/yaaw/demo/](http://binux.github.io/yaaw/demo/) 38 | 39 | ## Aria2-GUI 40 | 41 | [http://kotlinandroid.net/Aria2-GUI](http://kotlinandroid.net/Aria2-GUI/index.html) 42 | 43 | 下载完了Github上的文件之后打开会有以下几个文件 44 | 45 | - [1] 先打开start.bat 46 | 47 | - [2] 再打开aria2.exe 48 | 49 | 完了之后会出现一个命令框,让它一直开着不能断,否则下载也会跟着断 50 | 51 | ----- 52 | ### 增加chrome插件安装 53 | 54 | 安装如下: 55 | 56 | - 打开开发者额模式 57 | 58 | - 加载已解压的拓展程序,找到下载下来的拓展程序,即可(注意,目录一般就叫chrome) 59 | 60 | [BaiduExporter](https://github.com/acgotaku/BaiduExporter) 61 | 62 | ------- 63 | 64 | ### 关于导入插件老是提示“建议停止开发者模式”解决方法(仅适用于.crx插件) 65 | 66 | 将非官方扩展程序加入chrome的白名单 67 | 68 | [解决方法](http://xclient.info/a/1ddd2a3a-d34b-b568-c0d0-c31a95f0b309.html?_=cf9dfad27682664c64044361f26166a5) 69 | 70 | ### 如果您是Mac用户 71 | 72 | - [Aria2GUI for Mac](https://github.com/yangshun1029/aria2gui) 73 | 74 | - [BaiduNetdiskPlugin-macOS](https://github.com/CodeTips/BaiduNetdiskPlugin-macOS) 【注意一定是要<=2.2.2版本,往上版本已经修复这个漏洞】 75 | 76 | ----- 77 | 78 | # BaiduPCS-Go 79 | [BaiduPCS-Go](https://github.com/iikira/BaiduPCS-Go) 80 | 81 | 本人比较推荐的下载工具,但是由于百度云最近封ID,所以如果遇到不能链接服务器或者是403,请看[issue](https://github.com/iikira/BaiduPCS-Go/issues/460) 82 | 83 | 解决方法: 84 | 85 | 请参考:https://loli.today/baidupcs-appid/ 86 | 87 | ``` 88 | 创建 AppID 目录 89 | 90 | 用已登录百度账号的浏览器访问下面的网址 91 | 92 | http://pcs.baidu.com/rest/2.0/pcs/file?app_id=265486&method=list&path=%2F 93 | 94 | 网页显示 95 | 96 | {"error_code":31064,"error_msg":"file is not authorized","request_id":***************} 97 | 不出意外的话,现在网盘里 /我的应用数据/ 目录下已经出现了 baidu_shurufa,把需要下载的文件/文件夹移动到这个目录。 98 | 99 | 使用 BaiduPCS-Go 下载 100 | 101 | cd /apps/baidu_shurufa 102 | config set -appid=265486 103 | ls 104 | 此时应该会返回你已经移动过去的文件列表,按正常方式开始下载即可满速。 105 | 106 | 彻底删除此文件夹后,访问上面的链接无法再次生成,需在 /我的应用数据/ 手动创建名为 baidu_shurufa 的文件夹。 107 | 108 | ``` 109 | 110 | 如果遇到`31301,无法切换目录的问题`,AppID没有根目录权限,换回266719就可以了,在当前目录输入`config set -appid=266719` 111 | 112 | 这个 AppID 只有读取 /apps/baidu_shurufa 的权限 113 | 访问其他目录要换回 310646,`config set -appid=310646` 114 | 115 | 116 | 117 | ----- 118 | 119 | # Tampermonkey 120 | 121 | [Chrome商店地址](https://chrome.google.com/webstore/detail/tampermonkey/dhdgffkkebhmkfjojejmpbldmpobfkfo?hl=zh-CN) 122 | 123 | 不能翻墙的小伙伴可以直接从我的Github里边的文件直接获取 124 | 125 | [百度云直接下载助手(原作者版)](https://greasyfork.org/zh-CN/scripts/23635-%E7%99%BE%E5%BA%A6%E7%BD%91%E7%9B%98%E7%9B%B4%E6%8E%A5%E4%B8%8B%E8%BD%BD%E5%8A%A9%E6%89%8B) 126 | 127 | 由于原作者提供的代码总是出现不能正常显示直接下载的入口,本人修改此bug之后又发布了在作者原基础上修改的版本 128 | 129 | [百度网盘直接下载助手(显示直接下载入口)](https://greasyfork.org/zh-CN/scripts/36549-%E7%99%BE%E5%BA%A6%E7%BD%91%E7%9B%98%E7%9B%B4%E6%8E%A5%E4%B8%8B%E8%BD%BD%E5%8A%A9%E6%89%8B-%E6%98%BE%E7%A4%BA%E7%9B%B4%E6%8E%A5%E4%B8%8B%E8%BD%BD%E5%85%A5%E5%8F%A3) 130 | 131 | 进入以上直接点击`安装`或者`install`,完了直接刷新界面,进入到自己的百度云盘选择所需的下载文件即可。 132 | 133 | 134 | 这样即可获取下载连接,复制到迅雷或者IMD之类的下载器,让你享受飞一般的感觉。(本人百兆光纤,速度基本保持10m/s左右) 135 | 136 | 137 | # Proxyee-down 138 | [Proxyee-down](https://github.com/monkeyWie/proxyee-down) 139 | ### 下载 140 | - [OneDrive](https://imhx-my.sharepoint.com/:f:/g/personal/pd_imhx_onmicrosoft_com/EnPrybHS3rVFuy_HdcP7RLoBwhb0k5ayJdIzwjU0hCM9-A?e=he0oIz)(推荐) 141 | - [百度云](https://pan.baidu.com/s/1fgBnWJ0gl6ZkneGkVDIEfQ) 提取码:d92x 142 | ### 安装 143 | 1. [Windows安装教程](https://github.com/proxyee-down-org/proxyee-down/wiki/%E8%BD%AF%E4%BB%B6%E4%B8%8B%E8%BD%BD%E4%B8%8E%E8%BF%90%E8%A1%8C) 144 | 2. [MAC安装教程](https://github.com/proxyee-down-org/proxyee-down/wiki/%E8%BD%AF%E4%BB%B6%E4%B8%8B%E8%BD%BD%E4%B8%8E%E8%BF%90%E8%A1%8C) 145 | 3. [Linux安装教程](https://github.com/proxyee-down-org/proxyee-down/wiki/%E8%BD%AF%E4%BB%B6%E4%B8%8B%E8%BD%BD%E4%B8%8E%E8%BF%90%E8%A1%8C) 146 | ### 安装成功 147 | 在安装成功之后,**进入浏览器**下载资源时会跳转到创建任务页面,然后选择保存的路径和分段数进行创建下载任务。 148 | **200带宽下的速度 22m/s** 149 | 150 | ![](https://raw.githubusercontent.com/itgoyo/PicRes/master/687474703a2f2f6f6d76626c343669332e626b742e636c6f7564646e2e636f6d2f33316138366365343831373138323830373036326139663166373137393733642e706e67.png) 151 | 152 | ## 常见问题(**必看**) 153 | 在开始使用前务必看一遍[常见问题列表](https://github.com/monkeyWie/proxyee-down/blob/master/.guide/FAQ.md),可以解决你使用proxyee-down下载遇到的绝大多数问题。 154 | ## 常用功能 155 | ### 手动创建任务 156 | 可以根据链接来创建一个任务,支持自定义请求头和请求体,具体请[查看](https://github.com/monkeyWie/proxyee-down/blob/master/.guide/common/create/read.md)。 157 | ### 刷新任务下载链接 158 | 当任务下载链接失效了,下载没速度或失败则可以使用刷新下载链接的功能,使用新的链接继续下载,具体请[查看](https://github.com/monkeyWie/proxyee-down/blob/master/.guide/common/refresh/read.md)。 159 | 160 | # 速盘 161 | 官网:http://www.speedpan.com 162 | 163 | # Pandownload 164 | 官网:http://pandownload.com/index.html 165 | 166 | # 百度网盘直链下载助手 167 | 官网:https://www.baiduyun.wiki/zh-cn 168 | 169 | # 手机百度云客户端 170 | 悄悄告诉你们一个秘密,手机版的百度云客户端原来用来下载视频或者是zip文件都是满速下载的,不嫌麻烦的直接挂手机客户端,小文件下载不推荐使用客户端,因为小文件很多速度确实很慢。 171 | # 如果觉得对您有帮助,想请我喝咖啡 172 | 173 | 174 | ![](/wechat.jpg) 175 | 176 | -------------------------------------------------------------------------------- /Tampermonkey.crx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itgoyo/Aria2/0a6ce51d65c8d290ca20e06d1ca761cb49bb27b6/Tampermonkey.crx -------------------------------------------------------------------------------- /wechat.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itgoyo/Aria2/0a6ce51d65c8d290ca20e06d1ca761cb49bb27b6/wechat.jpg --------------------------------------------------------------------------------