├── .gitignore ├── .vscode └── launch.json ├── 115sha1.rc ├── 115sha1.syso ├── 115sha1_64位.zip ├── 80.go编译的exe程序添加图标和版权信息等 - 简书.pdf ├── Icon.png ├── LICENSE ├── Logo.ico ├── README.md ├── ali.jpg ├── build.bat ├── go.mod ├── go.sum ├── main.go ├── update.md ├── version.txt ├── wechat.png ├── zip.exe └── 编译方式.txt /.gitignore: -------------------------------------------------------------------------------- 1 | 2 | __debug_bin 3 | *.log 4 | main.exe 5 | *.json 6 | 已导入sha1.txt 7 | *.gz 8 | cookies.txt 9 | 115sha1.exe 10 | -------------------------------------------------------------------------------- /.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | // 使用 IntelliSense 了解相关属性。 3 | // 悬停以查看现有属性的描述。 4 | // 欲了解更多信息,请访问: https://go.microsoft.com/fwlink/?linkid=830387 5 | "version": "0.2.0", 6 | "configurations": [ 7 | { 8 | "name": "Launch Package", 9 | "type": "go", 10 | "request": "launch", 11 | "mode": "debug", 12 | "program": "${workspaceFolder}" 13 | } 14 | ] 15 | } -------------------------------------------------------------------------------- /115sha1.rc: -------------------------------------------------------------------------------- 1 | 1 VERSIONINFO 2 | FILEVERSION 1,0,0,0 3 | PRODUCTVERSION 1,0,0,0 4 | FILEOS 0x40004 5 | FILETYPE 0x1 6 | { 7 | BLOCK "StringFileInfo" 8 | { 9 | BLOCK "040904B0" 10 | { 11 | VALUE "CompanyName", "ShaoXia" 12 | VALUE "FileDescription", "Convenient, safe and open source SHA1 import / export tool for 115 network disk" 13 | VALUE "FileVersion", "1.0.0.0" 14 | VALUE "InternalName", "115sha1 import / export tool" 15 | VALUE "LegalCopyright", "Copyright (C)2021 ShaoXia.xyz. All rights reserved." 16 | VALUE "OriginalFilename", "115sha1.exe" 17 | VALUE "ProductName", "115sha1 import / export tool" 18 | VALUE "ProductVersion", "1.0.0.0" 19 | } 20 | } 21 | 22 | 23 | 24 | 25 | BLOCK "VarFileInfo" 26 | { 27 | VALUE "Translation", 0X0409, 0X04B0 28 | } 29 | } 30 | 31 | 32 | 33 | IDI_ICON1 ICON "Logo.ico" -------------------------------------------------------------------------------- /115sha1.syso: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/user1121114685/115sha1/0bd6c9621dcd206a2d94430af8a12bf85d605e27/115sha1.syso -------------------------------------------------------------------------------- /115sha1_64位.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/user1121114685/115sha1/0bd6c9621dcd206a2d94430af8a12bf85d605e27/115sha1_64位.zip -------------------------------------------------------------------------------- /80.go编译的exe程序添加图标和版权信息等 - 简书.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/user1121114685/115sha1/0bd6c9621dcd206a2d94430af8a12bf85d605e27/80.go编译的exe程序添加图标和版权信息等 - 简书.pdf -------------------------------------------------------------------------------- /Icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/user1121114685/115sha1/0bd6c9621dcd206a2d94430af8a12bf85d605e27/Icon.png -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2019- shaoxia.xyz 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | 23 | -------------------------------------------------------------------------------- /Logo.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/user1121114685/115sha1/0bd6c9621dcd206a2d94430af8a12bf85d605e27/Logo.ico -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # 115sha1 2 | 便捷的115sha1导入/导出功能。方便分享。 3 | ## 开源说明 4 | 5 | 本项目旨在练习golang 和减少劳动力。 6 | 7 | 本项目只是 fake115-go 的GUI包装,核心功能由fake115-go实现,对大佬进行感谢! 8 | [更新日志](https://github.com/user1121114685/115sha1/blob/main/update.md) 9 | 10 | 11 | 12 | ## 使用方法 13 | 14 | **需要Chrome** 15 | 下载地址:https://shaoxia1991.coding.net/p/115sha1/d/115sha1/git/raw/main/115sha1_64%E4%BD%8D.zip 16 | 使用简单方便,就不需要说明了,如果你想让该项目持续健康的发展请对我的付出进行捐赠。 17 | 18 | ## 特别感谢 19 | https://github.com/gawwo/fake115-go 20 | https://github.com/getbuguai/gaihosts 21 | --- 22 | ## 如果对你有所帮助,也可以对我进行捐赠。那撒我也不废话,下面是二维码。 23 | ![微信](https://gitee.com/shaoxia1991/Blog/raw/master/me/%E5%BE%AE%E4%BF%A1%E6%94%B6%E6%AC%BE.png) 24 | 25 | ![支付宝](https://gitee.com/shaoxia1991/Blog/raw/master/me/%E6%94%AF%E4%BB%98%E5%AE%9D%E6%94%B6%E6%AC%BE.jpg) 26 | 27 | --- 28 | ## 编译 29 | 30 | `go build -ldflags="-s -w -H windowsgui" main.go` 31 | 32 | ``` 33 | fyne package -os android -appID shaoxia.xyz.115sha1 34 | ``` 35 | 36 | 37 | 38 | ## 尚未实现 39 | 40 | 1. IOS 41 | 2. 多个json 选择 42 | 43 | ## License 44 | 45 | [The MIT License (MIT)](https://raw.githubusercontent.com/user1121114685/115sha1/master/LICENSE) -------------------------------------------------------------------------------- /ali.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/user1121114685/115sha1/0bd6c9621dcd206a2d94430af8a12bf85d605e27/ali.jpg -------------------------------------------------------------------------------- /build.bat: -------------------------------------------------------------------------------- 1 | set buildtime=%date:~0,4%%date:~5,2%%date:~8,2%%time:~0,2%%time:~3,2%%time:~6,2% 2 | echo %buildtime%>./version.txt 3 | 4 | go build -ldflags "-X main.Version=%buildtime%" 5 | 6 | del 115sha1_64λ.zip 7 | zip -q 115sha1_64λ.zip 115sha1.exe 8 | del 115sha1.exe 9 | rmdir /s/q logs -------------------------------------------------------------------------------- /go.mod: -------------------------------------------------------------------------------- 1 | module 115sha1 2 | 3 | go 1.16 4 | 5 | require ( 6 | fyne.io/fyne/v2 v2.0.4 7 | github.com/chromedp/cdproto v0.0.0-20210728214956-1fab41c4e0b7 8 | github.com/chromedp/chromedp v0.7.4 9 | github.com/flopp/go-findfont v0.0.0-20201114153133-e7393a00c15b 10 | github.com/gawwo/fake115-go v1.3.1-0.20210808024344-d6de12deef23 11 | github.com/gogf/gf v1.16.5 12 | github.com/tidwall/gjson v1.8.1 13 | ) 14 | -------------------------------------------------------------------------------- /go.sum: -------------------------------------------------------------------------------- 1 | fyne.io/fyne/v2 v2.0.4 h1:eDGaPGzeR4qNqWuAp9Li1kY4eVIHldCkf42KMakKIK4= 2 | fyne.io/fyne/v2 v2.0.4/go.mod h1:nNpgL7sZkDVLraGtQII2ArNRnnl6kHup/KfQRxIhbvs= 3 | github.com/BurntSushi/toml v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ= 4 | github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= 5 | github.com/Kodeworks/golang-image-ico v0.0.0-20141118225523-73f0f4cfade9/go.mod h1:7uhhqiBaR4CpN0k9rMjOtjpcfGd6DG2m04zQxKnWQ0I= 6 | github.com/akavel/rsrc v0.8.0/go.mod h1:uLoCtb9J+EyAqh+26kdrTgmzRBFPGOolLWKpdxkKq+c= 7 | github.com/chromedp/cdproto v0.0.0-20210713064928-7d28b402946a/go.mod h1:At5TxYYdxkbQL0TSefRjhLE3Q0lgvqKKMSFUglJ7i1U= 8 | github.com/chromedp/cdproto v0.0.0-20210728214956-1fab41c4e0b7 h1:dQJK4L7mbjSpxZKvy83RZproooehK5KPS7m9qx1A0V0= 9 | github.com/chromedp/cdproto v0.0.0-20210728214956-1fab41c4e0b7/go.mod h1:At5TxYYdxkbQL0TSefRjhLE3Q0lgvqKKMSFUglJ7i1U= 10 | github.com/chromedp/chromedp v0.7.4 h1:U+0d3WbB/Oj4mDuBOI0P7S3PJEued5UZIl5AJ3QulwU= 11 | github.com/chromedp/chromedp v0.7.4/go.mod h1:dBj+SXuQHznp6ZPwZeDDEBZKwclUwDLbZ0hjMialMYs= 12 | github.com/chromedp/sysutil v1.0.0 h1:+ZxhTpfpZlmchB58ih/LBHX52ky7w2VhQVKQMucy3Ic= 13 | github.com/chromedp/sysutil v1.0.0/go.mod h1:kgWmDdq8fTzXYcKIBqIYvRRTnYb9aNS9moAV0xufSww= 14 | github.com/clbanning/mxj v1.8.5-0.20200714211355-ff02cfb8ea28/go.mod h1:BVjHeAH+rl9rs6f+QIpeRl0tfu10SXn1pUSa5PVGJng= 15 | github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= 16 | github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= 17 | github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= 18 | github.com/fatih/color v1.12.0/go.mod h1:ELkj/draVOlAH/xkhN6mQ50Qd0MPOk5AAr3maGEBuJM= 19 | github.com/flopp/go-findfont v0.0.0-20201114153133-e7393a00c15b h1:/wqXgpZNTP8qV1dPEApjJXlDQd5N/F9U/WEvy5SawUI= 20 | github.com/flopp/go-findfont v0.0.0-20201114153133-e7393a00c15b/go.mod h1:wKKxRDjD024Rh7VMwoU90i6ikQRCr+JTHB5n4Ejkqvw= 21 | github.com/fredbi/uri v0.0.0-20181227131451-3dcfdacbaaf3 h1:FDqhDm7pcsLhhWl1QtD8vlzI4mm59llRvNzrFg6/LAA= 22 | github.com/fredbi/uri v0.0.0-20181227131451-3dcfdacbaaf3/go.mod h1:CzM2G82Q9BDUvMTGHnXf/6OExw/Dz2ivDj48nVg7Lg8= 23 | github.com/fsnotify/fsnotify v1.4.9 h1:hsms1Qyu0jgnwNXIxa+/V/PDsU6CfLf6CNO8H7IWoS4= 24 | github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= 25 | github.com/fyne-io/mobile v0.1.3-0.20210412090810-650a3139866a h1:3TAJhl8vXyli0tooKB0vd6gLCyBdWL4QEYbDoJpHEZk= 26 | github.com/fyne-io/mobile v0.1.3-0.20210412090810-650a3139866a/go.mod h1:/kOrWrZB6sasLbEy2JIvr4arEzQTXBTZGb3Y96yWbHY= 27 | github.com/gawwo/fake115-go v1.3.0 h1:KxewHm7SlVQnRTWBftH4miIZcoCjwAHnUpZpJO/MC9g= 28 | github.com/gawwo/fake115-go v1.3.0/go.mod h1:zb17UeGBBv+kB3ukJxrRwIagRekz2q1YuJHTxXhj9dA= 29 | github.com/gawwo/fake115-go v1.3.1-0.20210808024344-d6de12deef23 h1:5K7FBYC4JK4FrsIRy+us9+4xi4k7sdtm5T14FPfnuJk= 30 | github.com/gawwo/fake115-go v1.3.1-0.20210808024344-d6de12deef23/go.mod h1:zb17UeGBBv+kB3ukJxrRwIagRekz2q1YuJHTxXhj9dA= 31 | github.com/go-gl/gl v0.0.0-20190320180904-bf2b1f2f34d7 h1:SCYMcCJ89LjRGwEa0tRluNRiMjZHalQZrVrvTbPh+qw= 32 | github.com/go-gl/gl v0.0.0-20190320180904-bf2b1f2f34d7/go.mod h1:482civXOzJJCPzJ4ZOX/pwvXBWSnzD4OKMdH4ClKGbk= 33 | github.com/go-gl/glfw/v3.3/glfw v0.0.0-20210410170116-ea3d685f79fb h1:T6gaWBvRzJjuOrdCtg8fXXjKai2xSDqWTcKFUPuw8Tw= 34 | github.com/go-gl/glfw/v3.3/glfw v0.0.0-20210410170116-ea3d685f79fb/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= 35 | github.com/gobwas/httphead v0.1.0 h1:exrUm0f4YX0L7EBwZHuCF4GDp8aJfVeBrlLQrs6NqWU= 36 | github.com/gobwas/httphead v0.1.0/go.mod h1:O/RXo79gxV8G+RqlR/otEwx4Q36zl9rqC5u12GKvMCM= 37 | github.com/gobwas/pool v0.2.1 h1:xfeeEhW7pwmX8nuLVlqbzVc7udMDrwetjEv+TZIz1og= 38 | github.com/gobwas/pool v0.2.1/go.mod h1:q8bcK0KcYlCgd9e7WYLm9LpyS+YeLd8JVDW6WezmKEw= 39 | github.com/gobwas/ws v1.1.0 h1:7RFti/xnNkMJnrK7D1yQ/iCIB5OrrY/54/H930kIbHA= 40 | github.com/gobwas/ws v1.1.0/go.mod h1:nzvNcVha5eUziGrbxFCo6qFIojQHjJV5cLYIbezhfL0= 41 | github.com/godbus/dbus/v5 v5.0.4 h1:9349emZab16e7zQvpmsbtjc18ykshndd8y2PG3sgJbA= 42 | github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= 43 | github.com/gogf/gf v1.16.5 h1:Fh+w+YSbRIGt9nsDcggVLWfMn0Dqemg5rXTtFZRSSpk= 44 | github.com/gogf/gf v1.16.5/go.mod h1:QaYTIiafVdCo5aF/TV/sduU2jLmwJ7JphVCjkZ5v+Jg= 45 | github.com/gogf/mysql v1.6.1-0.20210603073548-16164ae25579/go.mod h1:52e6mXyNnHAsFrXrSnj5JPRSKsZKpHylVtA3j4AtMz8= 46 | github.com/goki/freetype v0.0.0-20181231101311-fa8a33aabaff h1:W71vTCKoxtdXgnm1ECDFkfQnpdqAO00zzGXLA5yaEX8= 47 | github.com/goki/freetype v0.0.0-20181231101311-fa8a33aabaff/go.mod h1:wfqRWLHRBsRgkp5dmbG56SA0DmVtwrF5N3oPdI8t+Aw= 48 | github.com/gomodule/redigo v2.0.0+incompatible/go.mod h1:B4C85qUVwatsJoIUNIfCRsp7qO0iAmpGFZ4EELWSbC4= 49 | github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= 50 | github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= 51 | github.com/gorilla/websocket v1.4.1/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= 52 | github.com/grokify/html-strip-tags-go v0.0.0-20190921062105-daaa06bf1aaf/go.mod h1:2Su6romC5/1VXOQMaWL2yb618ARB8iVo6/DR99A6d78= 53 | github.com/jackmordaunt/icns v0.0.0-20181231085925-4f16af745526/go.mod h1:UQkeMHVoNcyXYq9otUupF7/h/2tmHlhrS2zw7ZVvUqc= 54 | github.com/josephspurrier/goversioninfo v0.0.0-20200309025242-14b0ab84c6ca/go.mod h1:eJTEwMjXb7kZ633hO3Ln9mBUCOjX2+FlTljvpl9SYdE= 55 | github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY= 56 | github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y= 57 | github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= 58 | github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= 59 | github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= 60 | github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= 61 | github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= 62 | github.com/lucor/goinfo v0.0.0-20200401173949-526b5363a13a/go.mod h1:ORP3/rB5IsulLEBwQZCJyyV6niqmI7P4EWSmkug+1Ng= 63 | github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0= 64 | github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= 65 | github.com/mattn/go-colorable v0.1.8/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= 66 | github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= 67 | github.com/mattn/go-runewidth v0.0.9/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI= 68 | github.com/mattn/go-runewidth v0.0.10/go.mod h1:RAqKPSqVFrSLVXbA8x7dzmKdmGzieGRCM46jaSJTDAk= 69 | github.com/nfnt/resize v0.0.0-20180221191011-83c6a9932646/go.mod h1:jpp1/29i3P1S/RLdc7JQKbRpFeM1dOBd8T9ki5s+AY8= 70 | github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e h1:fD57ERR4JtEqsWbfPhv4DMiApHyliiK5xCTNVSPiaAs= 71 | github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= 72 | github.com/olekukonko/tablewriter v0.0.5/go.mod h1:hPp6KlRPjbx+hW8ykQs1w3UBbZlj6HuIJcUGPhkA7kY= 73 | github.com/orisano/pixelmatch v0.0.0-20210112091706-4fa4c7ba91d5 h1:1SoBaSPudixRecmlHXb/GxmaD3fLMtHIDN13QujwQuc= 74 | github.com/orisano/pixelmatch v0.0.0-20210112091706-4fa4c7ba91d5/go.mod h1:nZgzbfBr3hhjoZnS66nKrHmduYNpc34ny7RK4z5/HM0= 75 | github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= 76 | github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= 77 | github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= 78 | github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= 79 | github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= 80 | github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= 81 | github.com/rivo/uniseg v0.1.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc= 82 | github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= 83 | github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ= 84 | github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= 85 | github.com/srwiley/oksvg v0.0.0-20200311192757-870daf9aa564 h1:HunZiaEKNGVdhTRQOVpMmj5MQnGnv+e8uZNu3xFLgyM= 86 | github.com/srwiley/oksvg v0.0.0-20200311192757-870daf9aa564/go.mod h1:afMbS0qvv1m5tfENCwnOdZGOF8RGR/FsZ7bvBxQGZG4= 87 | github.com/srwiley/rasterx v0.0.0-20200120212402-85cb7272f5e9 h1:m59mIOBO4kfcNCEzJNy71UkeF4XIx2EVmL9KLwDQdmM= 88 | github.com/srwiley/rasterx v0.0.0-20200120212402-85cb7272f5e9/go.mod h1:mvWM0+15UqyrFKqdRjY6LuAVJR0HOVhJlEgZ5JWtSWU= 89 | github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= 90 | github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= 91 | github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= 92 | github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= 93 | github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= 94 | github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY= 95 | github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= 96 | github.com/tidwall/gjson v1.8.1 h1:8j5EE9Hrh3l9Od1OIEDAb7IpezNA20UdRngNAj5N0WU= 97 | github.com/tidwall/gjson v1.8.1/go.mod h1:5/xDoumyyDNerp2U36lyolv46b3uF/9Bu6OfyQ9GImk= 98 | github.com/tidwall/match v1.0.3 h1:FQUVvBImDutD8wJLN6c5eMzWtjgONK9MwIBCOrUJKeE= 99 | github.com/tidwall/match v1.0.3/go.mod h1:eRSPERbgtNPcGhD8UCthc6PmLEQXEWd3PRB5JTxsfmM= 100 | github.com/tidwall/pretty v1.1.0 h1:K3hMW5epkdAVwibsQEfR/7Zj0Qgt4DxtNumTq/VloO8= 101 | github.com/tidwall/pretty v1.1.0/go.mod h1:XNkn88O1ChpSDQmQeStsy+sBenx6DDtFZJxhVysOjyk= 102 | github.com/valyala/fastjson v1.6.3 h1:tAKFnnwmeMGPbwJ7IwxcTPCNr3uIzoIj3/Fh90ra4xc= 103 | github.com/valyala/fastjson v1.6.3/go.mod h1:CLCAqky6SMuOcxStkYQvblddUtoRxhYMGLrsQns1aXY= 104 | github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= 105 | go.opentelemetry.io/otel v1.0.0-RC2/go.mod h1:w1thVQ7qbAy8MHb0IFj8a5Q2QU0l2ksf8u/CN8m3NOM= 106 | go.opentelemetry.io/otel/oteltest v1.0.0-RC2/go.mod h1:kiQ4tw5tAL4JLTbcOYwK1CWI1HkT5aiLzHovgOVnz/A= 107 | go.opentelemetry.io/otel/trace v1.0.0-RC2/go.mod h1:JPQ+z6nNw9mqEGT8o3eoPTdnNI+Aj5JcxEsVGREIAy4= 108 | go.uber.org/atomic v1.6.0 h1:Ezj3JGmsOnG1MoRWQkPBsKLe9DwWD9QeXzTRzzldNVk= 109 | go.uber.org/atomic v1.6.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= 110 | go.uber.org/multierr v1.5.0 h1:KCa4XfM8CWFCpxXRGok+Q0SS/0XBhMDbHHGABQLvD2A= 111 | go.uber.org/multierr v1.5.0/go.mod h1:FeouvMocqHpRaaGuG9EjoKcStLC43Zu/fmqdUMPcKYU= 112 | go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee h1:0mgffUl7nfd+FpvXMVz4IDEaUSmT1ysygQC7qYo7sG4= 113 | go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee/go.mod h1:vJERXedbb3MVM5f9Ejo0C68/HhF8uaILCdgjnY+goOA= 114 | go.uber.org/zap v1.16.0 h1:uFRZXykJGK9lLY4HtgSw44DnIcAM+kRBP7x5m+NpAOM= 115 | go.uber.org/zap v1.16.0/go.mod h1:MA8QOfq0BHJwdXa996Y4dYkAqRKB8/1K1QMMZVaNZjQ= 116 | golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= 117 | golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= 118 | golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= 119 | golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= 120 | golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= 121 | golang.org/x/image v0.0.0-20200430140353-33d19683fad8 h1:6WW6V3x1P/jokJBpRQYUJnMHRP6isStQwCozxnU7XQw= 122 | golang.org/x/image v0.0.0-20200430140353-33d19683fad8/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= 123 | golang.org/x/lint v0.0.0-20190930215403-16217165b5de h1:5hukYrvBGR8/eNkX5mdUezrA6JiaEZDtJb9Ei+1LlBs= 124 | golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= 125 | golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= 126 | golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= 127 | golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= 128 | golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= 129 | golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= 130 | golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= 131 | golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= 132 | golang.org/x/net v0.0.0-20201031054903-ff519b6c9102 h1:42cLlJJdEh+ySyeUUbEQ5bsTiq8voBeTuweGVkY6Puw= 133 | golang.org/x/net v0.0.0-20201031054903-ff519b6c9102/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= 134 | golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= 135 | golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= 136 | golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= 137 | golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 138 | golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 139 | golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 140 | golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 141 | golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 142 | golang.org/x/sys v0.0.0-20200720211630-cb9d2d5c5666/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 143 | golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 144 | golang.org/x/sys v0.0.0-20201207223542-d4d67f95c62d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 145 | golang.org/x/sys v0.0.0-20210525143221-35b2ab0089ea h1:+WiDlPBBaO+h9vPNZi8uJ3k4BkKQB7Iow3aqwHVA5hI= 146 | golang.org/x/sys v0.0.0-20210525143221-35b2ab0089ea/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= 147 | golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= 148 | golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= 149 | golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= 150 | golang.org/x/text v0.3.4 h1:0YWbFKbhXG/wIiuHDSKpS0Iy7FSA+u45VtBMfQcFTTc= 151 | golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= 152 | golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= 153 | golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= 154 | golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= 155 | golang.org/x/tools v0.0.0-20190808195139-e713427fea3f/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= 156 | golang.org/x/tools v0.0.0-20191029041327-9cc4af7d6b2c/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= 157 | golang.org/x/tools v0.0.0-20191029190741-b9c20aec41a5/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= 158 | golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= 159 | golang.org/x/tools v0.0.0-20200328031815-3db5fc6bac03 h1:XpToik3MpT5iW3iHgNwnh3a8QwugfomvxOlyDnaOils= 160 | golang.org/x/tools v0.0.0-20200328031815-3db5fc6bac03/go.mod h1:Sl4aGygMT6LrqrWclx+PTx3U+LnKx/seiNR+3G19Ar8= 161 | golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= 162 | golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= 163 | golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= 164 | gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= 165 | gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= 166 | gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f h1:BLraFXnmrev5lT+xlilqcH8XK9/i0At2xKjWk4p6zsU= 167 | gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= 168 | gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= 169 | gopkg.in/natefinch/lumberjack.v2 v2.0.0 h1:1Lc07Kr7qY4U2YPouBjpCLxpiyxIVoxqXgkXLknAOE8= 170 | gopkg.in/natefinch/lumberjack.v2 v2.0.0/go.mod h1:l0ndWWf7gzL7RNwBG7wST/UCcT4T24xpD6X8LsfU/+k= 171 | gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= 172 | gopkg.in/yaml.v2 v2.2.8 h1:obN1ZagJSUGI0Ek/LBmuj4SNLPfIny3KsKFopxRdj10= 173 | gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= 174 | gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo= 175 | gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= 176 | honnef.co/go/tools v0.0.1-2019.2.3 h1:3JgtbtFHMiCmsznwGVTUWbgGov+pVqnlf1dEJTNAXeM= 177 | honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= 178 | -------------------------------------------------------------------------------- /main.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "bufio" 5 | "context" 6 | "errors" 7 | "fmt" 8 | "io" 9 | "io/ioutil" 10 | "log" 11 | "net/http" 12 | "net/url" 13 | "os" 14 | "strings" 15 | "unicode/utf8" 16 | 17 | "fyne.io/fyne/v2" 18 | "fyne.io/fyne/v2/app" 19 | "fyne.io/fyne/v2/canvas" 20 | "fyne.io/fyne/v2/container" 21 | "fyne.io/fyne/v2/dialog" 22 | "fyne.io/fyne/v2/layout" 23 | "fyne.io/fyne/v2/storage" 24 | "fyne.io/fyne/v2/widget" 25 | "github.com/chromedp/cdproto/network" 26 | "github.com/chromedp/chromedp" 27 | "github.com/flopp/go-findfont" 28 | "github.com/gawwo/fake115-go/config" 29 | "github.com/gawwo/fake115-go/core" 30 | "github.com/gogf/gf/text/gregex" 31 | 32 | //"github.com/gawwo/fake115-go/log" 33 | "crypto/sha1" 34 | 35 | "github.com/tidwall/gjson" 36 | ) 37 | 38 | func init() { 39 | 40 | //获取中文字体列表 41 | fontPaths := findfont.List() 42 | for _, path := range fontPaths { 43 | //设置字体 44 | if strings.Contains(path, "simkai.ttf") { 45 | os.Setenv("FYNE_FONT", path) 46 | break 47 | } 48 | } 49 | } 50 | 51 | var Version = "" 52 | 53 | var MyFolderChoose string // 最终选择的目录 54 | var MyFolderChooseName string // 最终选择的目录 55 | var JsonData string //JSON 目录 56 | var CooKie_115 string //115 Cookie 57 | var ChooseFolder_115 []string //115 文件目录 58 | 59 | var NewVersion string //新版本提示 60 | // go get github.com/gawwo/fake115-go@master 61 | func loginAndGetcookie() { 62 | // 尝试从本地cookie登录 63 | var localCookie string 64 | _, err := os.Stat("./cookies.txt") //os.Stat获取文件信息 65 | if err == nil { 66 | 67 | coo, err := ioutil.ReadFile("./cookies.txt") 68 | if err != nil { 69 | fmt.Println("读取cookies失败") 70 | 71 | } 72 | localCookie = string(coo) 73 | } 74 | dir, err := ioutil.TempDir("", "115sha1") 75 | if err != nil { 76 | panic(err) 77 | } 78 | defer os.RemoveAll(dir) 79 | 80 | opts := append(chromedp.DefaultExecAllocatorOptions[:], 81 | chromedp.DisableGPU, 82 | chromedp.NoDefaultBrowserCheck, 83 | chromedp.Flag("headless", false), 84 | chromedp.Flag("ignore-certificate-errors", true), 85 | chromedp.Flag("window-size", "1280,720"), 86 | chromedp.UserDataDir(dir), 87 | ) 88 | 89 | allocCtx, _ := chromedp.NewExecAllocator(context.Background(), opts...) 90 | //defer cancel() 91 | 92 | // also set up a custom logger 93 | taskCtx, _ := chromedp.NewContext(allocCtx, chromedp.WithLogf(log.Printf)) 94 | //defer cancel() 95 | chromedp.ListenTarget(taskCtx, func(ev interface{}) { 96 | switch ev := ev.(type) { 97 | 98 | case *network.EventResponseReceived: 99 | resp := ev.Response 100 | if len(resp.Headers) != 0 { 101 | // log.Printf("received headers: %s", resp.Headers) 102 | //https://115.com/?cid=0&offset=0&tab=&mode=wangpan 103 | //https://115.com/?cid= &offset=0&mode=wangpan 104 | // https://webapi.115.com/files?aid=1&cid= &o=user_ptime&asc=0&offset=0&show_dir=1&limit=40&code=&scid=&snap=0&natsort=1&record_open_time=1&source=&format=json&type=&star=&is_share=&suffix=&custom_order=&fc_mix= 105 | if strings.Index(resp.URL, "https://115.com/?cid=") != -1 { 106 | fmt.Println("找到CID啦!! " + resp.URL) 107 | 108 | respURL, err := gregex.MatchString(`cid=\d+`, resp.URL) 109 | respCid, err := gregex.MatchString(`\d+`, respURL[0]) 110 | if err == nil { 111 | MyFolderChoose = respCid[0] 112 | // document.querySelector("#js_top_header_file_path_box > div.top-file-path > div") 113 | choose115FolderName() 114 | fmt.Println("选择了 " + MyFolderChooseName + MyFolderChoose) 115 | //choose115FolderName() 116 | 117 | } else { 118 | fmt.Println("CID 提取错误。。 请GitHub联系 " + resp.URL) 119 | 120 | var exitScan string 121 | _, _ = fmt.Scan(&exitScan) 122 | } 123 | 124 | } 125 | } 126 | 127 | } 128 | // other needed network Event 129 | }) 130 | chromedp.Run(taskCtx, 131 | network.Enable(), 132 | // 尝试加载cookies 133 | chromedp.ActionFunc(func(ctx context.Context) error { 134 | if localCookie != "" { 135 | cooArr := strings.Split(localCookie, ";") 136 | for _, v := range cooArr { 137 | //expr := cdp.TimeSinceEpoch(time.Now().Add(14 * 24 * time.Hour)) 138 | cooArrOfOne := strings.Split(v, "=") 139 | if len(cooArrOfOne) > 1 { // 当切片长度大于1 也就是两个的时候 才执行 避免崩溃 140 | network.SetCookie(cooArrOfOne[0], cooArrOfOne[1]).WithDomain(".115.com").WithHTTPOnly(false).Do(ctx) 141 | } 142 | 143 | } 144 | return err 145 | } 146 | //chromedp.Navigate(`https://115.com/`) 147 | return nil 148 | }), 149 | 150 | chromedp.Navigate(`https://115.com/`), 151 | 152 | chromedp.WaitVisible(`#js-top_search_text`, chromedp.ByID), //等待顶部搜索框加载完毕 153 | chromedp.Navigate(`https://webapi.115.com/history/receive_list`), 154 | chromedp.ActionFunc(func(taskCtx context.Context) error { 155 | 156 | if CooKie_115 == "" { // 当没有cookie的时候才写入。已有Cookie就不管 157 | cookies, err := network.GetCookies().Do(taskCtx) 158 | if err != nil { 159 | return err 160 | } 161 | for _, v := range cookies { 162 | CooKie_115 = CooKie_115 + v.Name + "=" + v.Value + ";" 163 | } 164 | // // 保存到文件 方便下次调用,也可以给fake115-go 用 也可以自己输入。避免挤掉已登录的设备 165 | ioutil.WriteFile(`./cookies.txt`, []byte(CooKie_115), 0775) 166 | } 167 | 168 | return nil 169 | }), 170 | chromedp.Navigate(`https://115.com/`), 171 | ) 172 | 173 | //choose115Folder() 174 | 175 | } 176 | 177 | func choose115FolderName() { 178 | 179 | client := &http.Client{} 180 | //urlstring := "https://webapi.115.com/files?aid=1&cid=" "&o=user_ptime&asc=0&offset=0&show_dir=1&limit=40&code=&scid=&snap=0&natsort=1&record_open_time=1&source=&format=json" 181 | // https://webapi.115.com/files?aid=1&cid= &o=user_ptime&asc=0&offset=0&show_dir=1&limit=40&code=&scid=&snap=0&natsort=1&record_open_time=1&source=&format=json 182 | urlstring := "https://aps.115.com/natsort/files.php?aid=1&cid=" + MyFolderChoose + "&o=file_name&asc=1&offset=0&show_dir=1&limit=56&code=&scid=&snap=0&natsort=1&record_open_time=1&source=&format=json&fc_mix=0" 183 | reqest, err := http.NewRequest("GET", urlstring, nil) //建立一个请求 184 | if err != nil { 185 | fmt.Println("Fatal error ", err.Error()) 186 | os.Exit(0) 187 | } 188 | //Add 头协议 189 | reqest.Header.Add("Accept", "*/*") 190 | reqest.Header.Add("Accept-Language", "ja,zh-CN;q=0.8,zh;q=0.6") 191 | reqest.Header.Add("Connection", "keep-alive") 192 | reqest.Header.Add("Cookie", CooKie_115) 193 | reqest.Header.Add("User-Agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.146 Safari/537.36") 194 | response, err := client.Do(reqest) //提交 195 | if err != nil { 196 | fmt.Printf(err.Error()) 197 | } 198 | defer response.Body.Close() 199 | body, err1 := ioutil.ReadAll(response.Body) 200 | if err1 != nil { 201 | // handle error 202 | } 203 | fmt.Println(string(body)) //网页源码 204 | //gjson.GetMany(string(body)) 205 | //gjson.Parse(json).Get("name").Get("last") 206 | //gjson.Get(string(body), "data.data.cid").Get("ns") 207 | result := gjson.Get(string(body), "path.#.name") 208 | MyFolderChooseName = "\r\n" 209 | for _, pathname := range result.Array() { 210 | println(pathname.String()) 211 | MyFolderChooseName = MyFolderChooseName + "/" + pathname.String() 212 | 213 | } 214 | MyFolderChooseName = MyFolderChooseName + "\r\n" 215 | 216 | } 217 | 218 | func inputBoxChoose() { 219 | 220 | fdw := fyne.CurrentApp().NewWindow("导入功能") 221 | // 窗口大小 222 | fdw.Resize(fyne.NewSize(800, 400)) 223 | //selectEntry := widget.NewSelectEntry(ChooseFolder_115) 224 | //selectEntry.PlaceHolder = "请输入CID或者选择文件夹" 225 | fdw.SetContent(container.NewVBox( 226 | // 选择需要导入的目录 227 | widget.NewLabel("选择导入目录请在Chrome浏览器上进行\r\n按f5刷新,确认导入目录"), 228 | 229 | //content := fdw.SetContent(container.NewVBox( 230 | widget.NewButton("选择需要导入的Json文件或者TXT文件", func() { 231 | 232 | fd := dialog.NewFileOpen(func(reader fyne.URIReadCloser, err error) { 233 | if err == nil && reader == nil { 234 | return 235 | } 236 | 237 | if err != nil { 238 | dialog.ShowError(err, fdw) 239 | return 240 | } 241 | JsonData = reader.URI().Path() 242 | //imageOpened(reader) 243 | }, fdw) 244 | fd.Resize(fyne.NewSize(800, 400)) 245 | 246 | fd.SetFilter(storage.NewExtensionFileFilter([]string{".json", ".txt"})) 247 | 248 | fd.Show() 249 | 250 | }), 251 | 252 | //开始导入 253 | widget.NewButton("开始导入", func() { 254 | if JsonData == "" { 255 | err := errors.New("请先选择 需要导入的Json文件") 256 | dialog.ShowError(err, fdw) 257 | } else if MyFolderChoose == "" { 258 | err := errors.New("请在Chrome 中选择导入到115的目录,按刷新(F5)") 259 | dialog.ShowError(err, fdw) 260 | } else { 261 | 262 | _, err := os.Stat("./已导入sha1.txt") //os.Stat获取文件信息 263 | if err != nil { 264 | ioutil.WriteFile("./已导入sha1.txt", nil, 0777) 265 | } 266 | file, err := os.Open("./已导入sha1.txt") 267 | 268 | if err != nil { 269 | println(err.Error()) 270 | 271 | } 272 | defer file.Close() 273 | // 计算导入文件的sha1 274 | f, err := os.Open(JsonData) 275 | if err != nil { 276 | log.Fatal(err) 277 | } 278 | defer f.Close() 279 | h1 := sha1.New() 280 | if _, err := io.Copy(h1, f); err != nil { 281 | log.Fatal(err) 282 | } 283 | // 判断导入文件是否为UTF-8编码 284 | var IsUtf8 bool 285 | 286 | jsonBytes, err := ioutil.ReadFile(JsonData) 287 | if err != nil { 288 | 289 | fmt.Println("读取导入文件错误") 290 | 291 | } else { 292 | //IsUtf8 = utf8.ValidString(string(metaBytes)) 293 | IsUtf8 = utf8.Valid(jsonBytes) 294 | } 295 | 296 | ScannerSha1 := bufio.NewScanner(file) 297 | var WriteToSha1 bool 298 | WriteToSha1 = true 299 | for ScannerSha1.Scan() { 300 | 301 | sha1s := ScannerSha1.Text() 302 | if fmt.Sprintf("%x", h1.Sum(nil)) == sha1s { 303 | 304 | WriteToSha1 = false 305 | } 306 | 307 | } 308 | // dir, _ := os.Getwd() 309 | 310 | //exec.Command("cmd", "/c", "start cmd /k"+dir+"\\fake115.exe -c \""+CooKie_115+"\" "+MyFolderChoose+" "+JsonData).Run() 311 | 312 | //go core.Import(MyFolderChoose, JsonData) 313 | 314 | cnf := dialog.NewConfirm(JsonData, "确定导入到 "+MyFolderChooseName+"CID是 "+MyFolderChoose, func(s bool) { 315 | 316 | if s == true { 317 | go core.Import(MyFolderChoose, JsonData) 318 | 319 | if WriteToSha1 != false { 320 | file, err := os.OpenFile("./已导入sha1.txt", os.O_APPEND, 0777) 321 | defer file.Close() 322 | 323 | if err != nil { 324 | println(err.Error()) 325 | 326 | } 327 | write := bufio.NewWriter(file) 328 | 329 | write.WriteString(fmt.Sprintf("%x\r\n", h1.Sum(nil))) 330 | 331 | //Flush将缓存的文件真正写入到文件中 332 | write.Flush() 333 | file.Sync() 334 | fmt.Println(fmt.Sprintf("%x\r\n", h1.Sum(nil))) 335 | 336 | } 337 | 338 | } 339 | }, fdw) 340 | cnf.SetDismissText("不") 341 | cnf.SetConfirmText("确定") 342 | cnf.Show() 343 | if WriteToSha1 == false { 344 | 345 | dialog.ShowInformation("发现该文件已导入", "请注意是否需要重复导入 "+JsonData, fdw) 346 | } 347 | if IsUtf8 == false { 348 | dialog.ShowInformation(JsonData, "此文件文件并非UTF-8编码\r\n导入将出现文件名乱码\r\n\r\n请用 记事本\r\n另存为 UTF-8编码", fdw) 349 | } 350 | } 351 | 352 | }), 353 | )) 354 | 355 | fdw.Show() 356 | //content.Show() 357 | } 358 | 359 | func outputBoxChoose() { 360 | 361 | fdw := fyne.CurrentApp().NewWindow("导出功能") 362 | 363 | // 窗口大小 364 | fdw.Resize(fyne.NewSize(800, 400)) 365 | fdw.SetContent(container.NewVBox( 366 | 367 | // 选择需要导入的目录 368 | widget.NewLabel("选择导出目录请在Chrome浏览器上进行\r\n按f5刷新,确认导出目录"), 369 | 370 | //开始导入 371 | widget.NewButton("开始导出", func() { 372 | if MyFolderChoose == "" { 373 | err := errors.New("请在Chrome 中选择导出到115的目录,按刷新(F5)") 374 | dialog.ShowError(err, fdw) 375 | } else { 376 | //dir, _ := os.Getwd() 377 | cnf := dialog.NewConfirm("导出文件夹确认", "确定导出 "+MyFolderChooseName+"CID是 "+MyFolderChoose, func(s bool) { 378 | if s == true { 379 | go core.Export(MyFolderChoose) 380 | } 381 | }, fdw) 382 | cnf.SetDismissText("不") 383 | cnf.SetConfirmText("确定") 384 | cnf.Show() 385 | //exec.Command("cmd", "/c", "start cmd /k"+dir+"\\fake115.exe -c \""+CooKie_115+"\" "+MyFolderChoose).Run() 386 | 387 | } 388 | 389 | }), 390 | )) 391 | 392 | fdw.Show() 393 | //content.Show() 394 | } 395 | 396 | func parseURL(urlStr string) *url.URL { 397 | link, err := url.Parse(urlStr) 398 | if err != nil { 399 | fyne.LogError("Could not parse URL", err) 400 | } 401 | 402 | return link 403 | } 404 | 405 | func QRcode() { 406 | fdw := fyne.CurrentApp().NewWindow("给开源一份阳光") 407 | // 窗口大小 408 | //fdw.Resize(fyne.NewSize(800, 800)) storage.NewURI("https://gitee.com/shaoxia1991/Blog/raw/master/me/%E6%94%AF%E4%BB%98%E5%AE%9D%E6%94%B6%E6%AC%BE.jpg") 409 | // 410 | aliQRcode, _ := http.Get("https://gitee.com/shaoxia1991/Blog/raw/master/me/%E6%94%AF%E4%BB%98%E5%AE%9D%E6%94%B6%E6%AC%BE.jpg") 411 | defer aliQRcode.Body.Close() 412 | weChatQRcode, _ := http.Get("https://gitee.com/shaoxia1991/Blog/raw/master/me/%E5%BE%AE%E4%BF%A1%E6%94%B6%E6%AC%BE.png") 413 | defer weChatQRcode.Body.Close() 414 | f_ali, err := os.Create("./ali.jpg") 415 | if err != nil { 416 | panic(err) 417 | } 418 | f_wechat, err := os.Create("./wechat.png") 419 | if err != nil { 420 | panic(err) 421 | } 422 | io.Copy(f_ali, aliQRcode.Body) 423 | io.Copy(f_wechat, weChatQRcode.Body) 424 | // // 将保存的字符串转换为字节流 425 | // str := []byte(coo) 426 | 427 | // // 保存到文件 428 | // ioutil.WriteFile(`cookies.txt`, str, 0775) 429 | img1 := canvas.NewImageFromFile("./ali.jpg") 430 | img1.FillMode = canvas.ImageFillOriginal 431 | img2 := canvas.NewImageFromFile("./wechat.png") 432 | img2.FillMode = canvas.ImageFillOriginal 433 | 434 | container := fyne.NewContainerWithLayout( 435 | layout.NewGridWrapLayout(fyne.NewSize(300, 300)), 436 | img1, img2) 437 | fdw.SetContent(container) 438 | fdw.Show() 439 | } 440 | 441 | func checkNewVersion() { 442 | //https://shaoxia1991.coding.net/p/115sha1/d/115sha1/git/raw/main/ 443 | //https://raw.githubusercontent.com/user1121114685/115sha1/main/main.go 444 | newVersion, err := http.Get("https://shaoxia1991.coding.net/p/115sha1/d/115sha1/git/raw/main/version.txt?download=true") 445 | 446 | if err != nil { 447 | fmt.Println("获取新版本失败 ....") 448 | // handle error 449 | } 450 | defer newVersion.Body.Close() 451 | body, err := ioutil.ReadAll(newVersion.Body) 452 | if err != nil { 453 | fmt.Println("获取新版本失败 ....") 454 | // handle error 455 | } 456 | fmt.Println("最新版本为 " + string(body)) //网页源码 457 | NewVersion = string(body) 458 | } 459 | 460 | func fake115(w fyne.Window) { 461 | config.Cookie = CooKie_115 462 | //config.WorkerNum = 10 463 | // 确保cookie在登录状态 464 | loggedIn := core.SetUserInfoConfig() 465 | if !loggedIn { 466 | fmt.Println("Login expire or fail...") 467 | err := errors.New("登陆失效,或者登陆失败") 468 | dialog.ShowError(err, w) 469 | os.Exit(1) 470 | } 471 | 472 | } 473 | func main() { 474 | 475 | checkNewVersion() 476 | a := app.New() 477 | w := a.NewWindow("115 Sha1备份/恢复 by 联盟少侠") 478 | // 窗口大小 479 | w.Resize(fyne.NewSize(200, 600)) 480 | 481 | hello := widget.NewLabel(" 这是我的第一个GUI程序\r\n 运行本程序需要安装Chrome") 482 | 483 | // 第一个按钮 484 | w.SetContent(container.NewVBox( 485 | hello, 486 | widget.NewButton("1.登陆", func() { loginAndGetcookie() }), 487 | widget.NewButton("2.导出", func() { 488 | if CooKie_115 == "" { 489 | err := errors.New("你还没登陆,我猜你不知道需要先登陆") 490 | dialog.ShowError(err, w) 491 | } else { 492 | fake115(w) 493 | outputBoxChoose() 494 | } 495 | 496 | }), 497 | 498 | widget.NewButton("3.导入", func() { 499 | if CooKie_115 == "" { 500 | err := errors.New("你还没登陆,我猜你不知道需要先登陆") 501 | dialog.ShowError(err, w) 502 | } else { 503 | fake115(w) 504 | inputBoxChoose() 505 | } 506 | }), 507 | 508 | container.NewHBox( 509 | widget.NewLabel("项目地址:"), 510 | widget.NewHyperlink("115sha1", parseURL("https://github.com/user1121114685/115sha1")), 511 | widget.NewLabel(" "), 512 | widget.NewHyperlink("fake115", parseURL("https://github.com/gawwo/fake115-go/releases/latest")), 513 | ), 514 | container.NewHBox( 515 | widget.NewLabel("作者博客:"), 516 | widget.NewHyperlink("shaoxia.xyz", parseURL("https://shaoxia.xyz/")), 517 | widget.NewLabel(" "), 518 | widget.NewHyperlink("TG分享交流群", parseURL("https://t.me/Resources115")), 519 | ), 520 | container.NewHBox( 521 | widget.NewLabel("当前版本:"+Version), 522 | ), 523 | container.NewHBox( 524 | widget.NewLabel("最新版本:"), 525 | widget.NewHyperlink(NewVersion, parseURL("https://shaoxia1991.coding.net/p/115sha1/d/115sha1/git/raw/main/115sha1_64%E4%BD%8D.zip")), 526 | ), 527 | widget.NewButton("115SHA1加油", func() { QRcode() }), 528 | 529 | //widget.NewButton("合二为一的版本", func() { fake115(w) }), 530 | 531 | )) 532 | 533 | //w.ShowAndRun() 534 | //第二个按钮 535 | 536 | w.ShowAndRun() 537 | os.Unsetenv("FYNE_FONT") 538 | } 539 | 540 | // 选择文件不好用,那就拖动输入 541 | -------------------------------------------------------------------------------- /update.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | ## 20210311220629 4 | 1.同步fake115-go源码更新 5 | 2.修复获取目录会失灵出现错误的问题 6 | ## 第五次更新 7 | 1.修复cookie本地加载导致登陆过期的问题(第一个手写bug 尴尬) 8 | 2.同步fake115-go源码更新,多次导入/导出不再闪退 9 | ## 第四次更新 10 | 1.对非UTF-8编码的文件 进行提示. 11 | 2.新增本地cookies登录,此cookies.txt也可以用于fake115-go项目,直接复制即可。 12 | 注:此cookies自动保存,也可以手动更新。 13 | 14 | ## 第三次更新 15 | 1.支持txt格式的文件导入,支持115优化大师格式json 16 | ## 第二次更新 17 | 1.降低软件窗口大小,减少UI 18 | 2.内置了fack115 这样打包出来只有一个exe 19 | 3.新增了已导入提醒。当用户导入过重复json时候进行提醒 20 | 4.增加软件图标 21 | 5.增加在线版本提示 22 | 6.移除了原来的选择目录模式,现在在Chrome中选择导入/导出目录了 23 | 24 | ## 初始版本 25 | 1.第一个可用的版本 2021年2月6日16:04:35 -------------------------------------------------------------------------------- /version.txt: -------------------------------------------------------------------------------- 1 | 20210808130619 2 | -------------------------------------------------------------------------------- /wechat.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/user1121114685/115sha1/0bd6c9621dcd206a2d94430af8a12bf85d605e27/wechat.png -------------------------------------------------------------------------------- /zip.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/user1121114685/115sha1/0bd6c9621dcd206a2d94430af8a12bf85d605e27/zip.exe -------------------------------------------------------------------------------- /编译方式.txt: -------------------------------------------------------------------------------- 1 | go build -ldflags="-s -w -H windowsgui" main.go 2 | 3 | 4 | 5 | -ldflags=“参数”: 表示将引号里面的参数传给编译器 6 | -s:去掉符号信息 (这样panic时,stack trace就没有任何文件名/行号信息了,这等价于普通C/C+=程序被strip的效果) 7 | -w:去掉DWARF调试信息 (得到的程序就不能用gdb调试了) 8 | 9 | -H windowsgui : 以windows gui形式打包,不带dos窗口。其中注意H是大写的 --------------------------------------------------------------------------------