├── .babelrc ├── .gitattributes ├── .gitignore ├── LICENSE ├── README.md ├── files └── GeoLite2-Country.mmdb ├── package.json ├── postcss.config.js ├── public ├── fonts │ ├── Lato-Black.ttf │ ├── Lato-BlackItalic.ttf │ ├── Lato-Bold.ttf │ ├── Lato-BoldItalic.ttf │ ├── Lato-Hairline.ttf │ ├── Lato-HairlineItalic.ttf │ ├── Lato-Italic.ttf │ ├── Lato-Light.ttf │ ├── Lato-LightItalic.ttf │ └── Lato-Regular.ttf ├── icons │ └── icon.ico ├── index.html └── styles │ ├── Elements.postcss │ ├── Footer.postcss │ ├── Icons.postcss │ ├── Main.postcss │ ├── Process.postcss │ ├── Result.postcss │ └── Update.postcss ├── src ├── actions │ ├── MainActions.js │ ├── ProcessActions.js │ ├── ResultActions.js │ └── UpdateActions.js ├── components │ ├── Footer.jsx │ ├── ProcessCrawl.jsx │ ├── ProcessCrawlLevel.jsx │ ├── ProcessParse.jsx │ ├── ResultCountryItem.jsx │ ├── Root.jsx │ └── ui │ │ └── Checkbox.jsx ├── constants │ ├── ActionTypes.js │ └── SettingsConstants.js ├── containers │ ├── Main.jsx │ ├── Process.jsx │ ├── Result.jsx │ └── Update.jsx ├── core │ ├── country.js │ ├── links.js │ ├── parser.js │ ├── settings.js │ └── updater.js ├── index.js ├── misc │ ├── methods.js │ ├── other.js │ ├── regexes.js │ └── text.js ├── renderer.dev.js ├── renderer.js └── store │ ├── index.js │ └── reducers │ ├── index.js │ ├── main.js │ ├── process.js │ ├── result.js │ └── update.js ├── webpack.config.base.js ├── webpack.config.main.babel.js └── webpack.config.renderer.babel.js /.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "presets": ["@babel/env", "@babel/react"], 3 | "plugins": ["@babel/plugin-proposal-class-properties", "@babel/plugin-transform-runtime", ["@babel/plugin-proposal-object-rest-spread", { "useBuiltIns": false }]], 4 | "env": { 5 | "development": { 6 | "plugins": ["react-hot-loader/babel"] 7 | } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | public/styles/* linguist-vendored -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | npm-debug.log 3 | settings.unfx.parser.json 4 | /public/*.js 5 | /.vscode 6 | dist 7 | package-lock.json 8 | tests -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2019 assnctr 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 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 |

2 | 3 |

4 | 5 | ![](https://i.ibb.co/YhNLCtH/1prsr2-0-0.png) 6 | ![](https://i.ibb.co/GVtW5Dg/3prsr2-0-0.png) 7 | 8 | ## Features 9 | - Parsing from sites with tables 10 | - Parsing from primitive sites 11 | - Sorting proxies by countries 12 | - `Deep` - Allow to follow links 13 | - `External` - Allow to follow third-party domains 14 | - `Retry` - Retries crawl/parse if been received bad response 15 | 16 | ## Results 17 | Saving proxies in `ip` : `port` format. 18 | 19 | **NOTE:** 20 | 21 | `Double click` - select/deselect all countries. 22 | 23 | ## Updates 24 | Automatically checking for updates and notification if the latest version is available. 25 | 26 | #### Open Proxy Space 27 | [Premium](https://openproxy.space/premium) - Buy Proxy List 28 | [Free Proxy List](https://openproxy.space/list) - Always Updated Proxy Lists 29 | -------------------------------------------------------------------------------- /files/GeoLite2-Country.mmdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openproxyspace/unfx-proxy-parser/2736d0345fdde40c9bd4a414bc6d29422f83d23b/files/GeoLite2-Country.mmdb -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "unfx-proxy-parser", 3 | "version": "2.0.0", 4 | "main": "public/main.js", 5 | "license": "MIT", 6 | "scripts": { 7 | "build": "run-p build:*", 8 | "build:main": "cross-env NODE_ENV=production webpack -p --config webpack.config.main.babel.js", 9 | "build:renderer": "cross-env NODE_ENV=production webpack -p --config webpack.config.renderer.babel.js", 10 | "start": "run-p start:*", 11 | "start:main": "electron --require @babel/register src/index", 12 | "start:renderer": "cross-env NODE_ENV=development webpack-dev-server -d --config webpack.config.renderer.babel.js", 13 | "package": "npm run build && electron-builder --win", 14 | "publish": "npm run build && electron-builder --linux --win --publish always" 15 | }, 16 | "devDependencies": { 17 | "@babel/cli": "^7.1.5", 18 | "@babel/core": "^7.1.6", 19 | "@babel/plugin-proposal-class-properties": "^7.1.0", 20 | "@babel/plugin-proposal-object-rest-spread": "^7.0.0", 21 | "@babel/plugin-transform-runtime": "^7.1.0", 22 | "@babel/preset-env": "^7.1.6", 23 | "@babel/preset-react": "^7.0.0", 24 | "@babel/register": "^7.0.0", 25 | "@babel/runtime": "^7.1.5", 26 | "babel-loader": "^8.0.4", 27 | "cross-env": "^5.2.0", 28 | "css-loader": "^1.0.1", 29 | "electron": "^4.0.0", 30 | "electron-builder": "^20.36.2", 31 | "electron-devtools-installer": "^2.2.4", 32 | "electron-react-devtools": "^0.5.3", 33 | "file-loader": "^2.0.0", 34 | "js-flock": "^3.5.3", 35 | "mmdb-reader": "*", 36 | "npm-run-all": "^4.1.3", 37 | "postcss-color-mod-function": "^2.4.3", 38 | "postcss-loader": "^3.0.0", 39 | "postcss-preset-env": "^5.3.0", 40 | "react": "^16.6.3", 41 | "react-dom": "^16.6.3", 42 | "react-hot-loader": "^4.3.12", 43 | "react-markdown": "^4.0.3", 44 | "react-redux": "^5.1.1", 45 | "redux": "^4.0.1", 46 | "redux-thunk": "^2.3.0", 47 | "request-progress": "^3.0.0", 48 | "request-promise": "^4.2.2", 49 | "style-loader": "^0.23.1", 50 | "url-loader": "^1.1.2", 51 | "webpack": "^4.25.1", 52 | "webpack-cli": "^3.1.2", 53 | "webpack-dev-server": "^3.1.10" 54 | }, 55 | "build": { 56 | "appId": "com.github.assnctr.unfxproxyparser", 57 | "win": { 58 | "target": [ 59 | { 60 | "target": "zip", 61 | "arch": [ 62 | "x64", 63 | "ia32" 64 | ] 65 | }, 66 | { 67 | "target": "nsis-web", 68 | "arch": [ 69 | "x64", 70 | "ia32" 71 | ] 72 | }, 73 | { 74 | "target": "portable", 75 | "arch": [ 76 | "x64", 77 | "ia32" 78 | ] 79 | } 80 | ], 81 | "icon": "/public/icons/icon.ico", 82 | "artifactName": "${name}-v${version}-${arch}-${os}.${ext}" 83 | }, 84 | "linux": { 85 | "target": [ 86 | { 87 | "target": "zip", 88 | "arch": [ 89 | "x64", 90 | "ia32", 91 | "arm64", 92 | "armv7l" 93 | ] 94 | } 95 | ], 96 | "icon": "/public/icons/icon.ico", 97 | "artifactName": "${name}-v${version}-${arch}-${os}.${ext}" 98 | }, 99 | "publish": [ 100 | { 101 | "provider": "github", 102 | "owner": "assnctr", 103 | "repo": "unfx-proxy-parser", 104 | "private": false 105 | } 106 | ], 107 | "productName": "Unfx Proxy Parser", 108 | "copyright": "2019 assnctr (openproxy.space)", 109 | "extraResources": [ 110 | "./files/**" 111 | ], 112 | "portable": { 113 | "artifactName": "${name}-v${version}-${arch}-${os}-portable.${ext}" 114 | }, 115 | "nsisWeb": { 116 | "oneClick": false, 117 | "perMachine": true, 118 | "allowToChangeInstallationDirectory": true, 119 | "differentialPackage": true 120 | } 121 | } 122 | } 123 | -------------------------------------------------------------------------------- /postcss.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | plugins: { 3 | 'postcss-preset-env': { 4 | stage: 4, 5 | features: { 6 | 'nesting-rules': true 7 | } 8 | }, 9 | 'postcss-color-mod-function': {} 10 | } 11 | }; 12 | -------------------------------------------------------------------------------- /public/fonts/Lato-Black.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openproxyspace/unfx-proxy-parser/2736d0345fdde40c9bd4a414bc6d29422f83d23b/public/fonts/Lato-Black.ttf -------------------------------------------------------------------------------- /public/fonts/Lato-BlackItalic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openproxyspace/unfx-proxy-parser/2736d0345fdde40c9bd4a414bc6d29422f83d23b/public/fonts/Lato-BlackItalic.ttf -------------------------------------------------------------------------------- /public/fonts/Lato-Bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openproxyspace/unfx-proxy-parser/2736d0345fdde40c9bd4a414bc6d29422f83d23b/public/fonts/Lato-Bold.ttf -------------------------------------------------------------------------------- /public/fonts/Lato-BoldItalic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openproxyspace/unfx-proxy-parser/2736d0345fdde40c9bd4a414bc6d29422f83d23b/public/fonts/Lato-BoldItalic.ttf -------------------------------------------------------------------------------- /public/fonts/Lato-Hairline.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openproxyspace/unfx-proxy-parser/2736d0345fdde40c9bd4a414bc6d29422f83d23b/public/fonts/Lato-Hairline.ttf -------------------------------------------------------------------------------- /public/fonts/Lato-HairlineItalic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openproxyspace/unfx-proxy-parser/2736d0345fdde40c9bd4a414bc6d29422f83d23b/public/fonts/Lato-HairlineItalic.ttf -------------------------------------------------------------------------------- /public/fonts/Lato-Italic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openproxyspace/unfx-proxy-parser/2736d0345fdde40c9bd4a414bc6d29422f83d23b/public/fonts/Lato-Italic.ttf -------------------------------------------------------------------------------- /public/fonts/Lato-Light.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openproxyspace/unfx-proxy-parser/2736d0345fdde40c9bd4a414bc6d29422f83d23b/public/fonts/Lato-Light.ttf -------------------------------------------------------------------------------- /public/fonts/Lato-LightItalic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openproxyspace/unfx-proxy-parser/2736d0345fdde40c9bd4a414bc6d29422f83d23b/public/fonts/Lato-LightItalic.ttf -------------------------------------------------------------------------------- /public/fonts/Lato-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openproxyspace/unfx-proxy-parser/2736d0345fdde40c9bd4a414bc6d29422f83d23b/public/fonts/Lato-Regular.ttf -------------------------------------------------------------------------------- /public/icons/icon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openproxyspace/unfx-proxy-parser/2736d0345fdde40c9bd4a414bc6d29422f83d23b/public/icons/icon.ico -------------------------------------------------------------------------------- /public/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Unfx Proxy Parser 6 | 7 | 8 |
9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /public/styles/Elements.postcss: -------------------------------------------------------------------------------- 1 | :root { 2 | --green-color: #31bc86; 3 | --grey-color: #8c99a7; 4 | --blue-color: #5396d8; 5 | } 6 | 7 | ::-webkit-scrollbar { 8 | width: 15px; 9 | border-radius: 0.25em; 10 | } 11 | 12 | ::-webkit-scrollbar-thumb { 13 | background-color: color-mod(var(--blue-color) alpha(15%)); 14 | border-radius: 0.25em; 15 | } 16 | 17 | ::-webkit-scrollbar-track { 18 | background-color: #fafafa; 19 | } 20 | 21 | /* -------------------------------- 22 | Buttons section 23 | -------------------------------- */ 24 | 25 | button { 26 | font-weight: 900; 27 | font-size: 1em; 28 | border-radius: 1.75em; 29 | outline: 0; 30 | border: 0; 31 | cursor: pointer; 32 | padding: 0.5em 1.5em; 33 | margin-right: 2em; 34 | background-color: color-mod(var(--green-color) alpha(15%)); 35 | color: color-mod(var(--green-color) alpha(75%)); 36 | transition: all 0.3s cubic-bezier(0.23, 1, 0.32, 1); 37 | 38 | &.blue { 39 | background-color: color-mod(var(--blue-color) alpha(15%)); 40 | color: color-mod(var(--blue-color) alpha(75%)); 41 | } 42 | 43 | &.less { 44 | padding: 0; 45 | background-color: transparent; 46 | color: color-mod(var(--green-color) alpha(50%)); 47 | 48 | &:hover { 49 | color: color-mod(var(--green-color) alpha(75%)); 50 | } 51 | } 52 | 53 | &:not(.less):hover { 54 | color: rgba(255, 255, 255, 0.75); 55 | background-color: rgba(49, 188, 135, 0.65); 56 | 57 | &.blue { 58 | background-color: color-mod(var(--blue-color) alpha(75%)); 59 | } 60 | } 61 | } 62 | 63 | /* -------------------------------- 64 | Inputs section 65 | -------------------------------- */ 66 | 67 | textarea { 68 | font-weight: 400; 69 | border-radius: 0.35em; 70 | border: 0; 71 | outline: 0; 72 | padding: 1em; 73 | width: 100%; 74 | font-size: 1em; 75 | box-shadow: none; 76 | background-color: color-mod(var(--green-color) alpha(5%)); 77 | color: #31bc86; 78 | resize: vertical; 79 | transition: all 0.3s cubic-bezier(0.23, 1, 0.32, 1); 80 | } 81 | 82 | input.field { 83 | width: 100%; 84 | border: 0; 85 | outline: 0; 86 | background-color: color-mod(var(--green-color) alpha(5%)); 87 | font-weight: 900; 88 | padding: 0.5em 0.75em; 89 | border-radius: 1.75em; 90 | font-size: 1em; 91 | color: color-mod(var(--green-color) alpha(50%)); 92 | transition: all 0.5s cubic-bezier(0.23, 1, 0.32, 1); 93 | 94 | &::-webkit-input-placeholder { 95 | color: color-mod(var(--green-color) alpha(25%)); 96 | } 97 | 98 | &:not([value='']) { 99 | background-color: color-mod(var(--green-color) alpha(15%)); 100 | } 101 | 102 | &:focus { 103 | color: #fff; 104 | background-color: color-mod(var(--green-color) alpha(65%)); 105 | 106 | &::-webkit-input-placeholder { 107 | color: transparent; 108 | } 109 | } 110 | } 111 | 112 | input[type='range'] { 113 | -webkit-appearance: none; 114 | width: 100%; 115 | margin: 0; 116 | outline: none; 117 | padding: 0; 118 | 119 | &::-webkit-slider-runnable-track { 120 | width: 100%; 121 | height: 0.8em; 122 | cursor: pointer; 123 | border-radius: 1em; 124 | background-image: linear-gradient(to right, color-mod(var(--green-color) alpha(15%)), color-mod(var(--blue-color) alpha(15%))); 125 | } 126 | 127 | &::-webkit-slider-thumb { 128 | height: 16px; 129 | width: 16px; 130 | background-color: color-mod(var(--green-color) alpha(75%)); 131 | cursor: pointer; 132 | -webkit-appearance: none; 133 | border-radius: 1em; 134 | margin-top: -0.2em; 135 | } 136 | } 137 | 138 | /* -------------------------------- 139 | Checkboxes section 140 | -------------------------------- */ 141 | 142 | .checkbox { 143 | display: inline-flex; 144 | margin: auto; 145 | user-select: none; 146 | cursor: pointer; 147 | padding-top: 1em; 148 | padding-right: 2em; 149 | 150 | &:last-child { 151 | padding-right: 0; 152 | } 153 | 154 | & span.count { 155 | margin-left: 0.5em; 156 | transition: all 0.3s cubic-bezier(0.23, 1, 0.32, 1); 157 | color: color-mod(var(--grey-color) alpha(15%)); 158 | } 159 | 160 | & span:not(.count) { 161 | display: inline-block; 162 | vertical-align: middle; 163 | font-weight: 900; 164 | margin-top: -0.2em; 165 | transform: translate3d(0, 0, 0); 166 | color: color-mod(var(--green-color) alpha(35%)); 167 | transition: all 0.3s cubic-bezier(0.23, 1, 0.32, 1); 168 | 169 | &:first-child { 170 | position: relative; 171 | width: 1.25em; 172 | height: 1.25em; 173 | border-radius: 1.25em; 174 | vertical-align: middle; 175 | transition: all 0.3s cubic-bezier(0.23, 1, 0.32, 1); 176 | background-color: color-mod(var(--green-color) alpha(15%)); 177 | 178 | & svg { 179 | position: absolute; 180 | top: 5px; 181 | left: 4px; 182 | fill: none; 183 | stroke: #ffffff; 184 | stroke-width: 1.1; 185 | stroke-linecap: round; 186 | stroke-linejoin: round; 187 | stroke-dasharray: 1em; 188 | stroke-dashoffset: 1em; 189 | transition: all 0.3s cubic-bezier(0.23, 1, 0.32, 1); 190 | transition-delay: 0.1s; 191 | transform: translate3d(0, 0, 0); 192 | } 193 | 194 | &:before { 195 | content: ''; 196 | width: 100%; 197 | height: 100%; 198 | background-color: color-mod(var(--green-color) alpha(75%)); 199 | display: block; 200 | transform: scale(0); 201 | opacity: 1; 202 | border-radius: 50%; 203 | } 204 | } 205 | 206 | &:last-child { 207 | padding-left: 0.5em; 208 | font-size: 0.95em; 209 | } 210 | } 211 | 212 | &:hover span:first-child { 213 | border-color: color-mod(var(--green-color) alpha(75%)); 214 | } 215 | } 216 | 217 | .input-checkbox { 218 | display: none; 219 | } 220 | 221 | .input-checkbox:checked + .checkbox span.count { 222 | color: color-mod(var(--grey-color) alpha(65%)); 223 | } 224 | 225 | .input-checkbox:checked + .checkbox span:not(.count) { 226 | color: color-mod(var(--green-color) alpha(75%)); 227 | 228 | &:first-child { 229 | background-color: rgba(49, 188, 135, 0.75); 230 | border-color: rgba(49, 188, 135, 0.75); 231 | 232 | & svg { 233 | stroke-dashoffset: 0; 234 | } 235 | 236 | &:before { 237 | transform: scale(3.5); 238 | opacity: 0; 239 | transition: all 0.7s cubic-bezier(0.23, 1, 0.32, 1); 240 | } 241 | } 242 | } 243 | -------------------------------------------------------------------------------- /public/styles/Footer.postcss: -------------------------------------------------------------------------------- 1 | :root { 2 | --green-color: #31bc86; 3 | --grey-color: #8c99a7; 4 | } 5 | 6 | footer { 7 | display: flex; 8 | 9 | & .marks { 10 | display: flex; 11 | align-items: center; 12 | 13 | & .product-name { 14 | font-weight: 700; 15 | color: color-mod(var(--green-color) alpha(50%)); 16 | } 17 | 18 | & .version { 19 | font-weight: 700; 20 | font-size: 0.9em; 21 | color: #fff; 22 | background-color: color-mod(var(--green-color) alpha(35%)); 23 | border-radius: 1em; 24 | padding: 0.2em 0.65em; 25 | } 26 | 27 | & a { 28 | font-weight: 900; 29 | margin-right: 1em; 30 | transition: all 0.3s cubic-bezier(0.23, 1, 0.32, 1); 31 | 32 | &:hover { 33 | text-decoration: underline; 34 | color: color-mod(var(--green-color) alpha(75%)); 35 | } 36 | 37 | &.copyright { 38 | color: var(--grey-color); 39 | font-weight: 400; 40 | text-decoration: none; 41 | 42 | &:hover { 43 | color: #0088cc; 44 | 45 | & svg { 46 | fill: #0088cc; 47 | } 48 | } 49 | 50 | & svg { 51 | width: 1em; 52 | height: 1em; 53 | fill: #8c99a7; 54 | transition: all 0.7s cubic-bezier(0.23, 1, 0.32, 1); 55 | } 56 | } 57 | } 58 | 59 | & span, 60 | & a { 61 | color: color-mod(var(--green-color) alpha(50%)); 62 | } 63 | 64 | & * { 65 | display: flex; 66 | align-content: center; 67 | align-items: center; 68 | margin-right: 0.5em; 69 | } 70 | } 71 | 72 | & .socials { 73 | display: flex; 74 | align-items: center; 75 | align-content: center; 76 | justify-content: flex-end; 77 | margin-left: auto; 78 | 79 | & a { 80 | display: flex; 81 | align-items: center; 82 | align-content: center; 83 | 84 | &:not(:last-child) { 85 | margin-right: 2em; 86 | } 87 | 88 | &.become-a-patron { 89 | cursor: pointer; 90 | font-weight: 700; 91 | user-select: none; 92 | text-decoration: none; 93 | color: #8c99a7; 94 | 95 | & svg { 96 | width: 1.2em; 97 | height: 1.2em; 98 | margin-left: 0.5em; 99 | } 100 | 101 | & span { 102 | margin: 0 0.12em; 103 | transition: all 0.7s cubic-bezier(0.23, 1, 0.32, 1); 104 | } 105 | 106 | &:hover { 107 | & span:nth-child(1) { 108 | color: #052d49; 109 | } 110 | 111 | & span:nth-child(2) { 112 | color: #f96854; 113 | } 114 | 115 | & svg { 116 | & circle { 117 | fill: #f96854; 118 | } 119 | 120 | & rect { 121 | fill: #052d49; 122 | } 123 | } 124 | } 125 | } 126 | } 127 | 128 | & svg { 129 | height: 1.5em; 130 | width: 1.5em; 131 | cursor: pointer; 132 | fill: var(--grey-color); 133 | 134 | &:hover.github-svg path { 135 | fill: #333; 136 | } 137 | } 138 | } 139 | } 140 | -------------------------------------------------------------------------------- /public/styles/Main.postcss: -------------------------------------------------------------------------------- 1 | :root { 2 | --green-color: #31bc86; 3 | --grey-color: #8c99a7; 4 | --blue-color: #5396d8; 5 | } 6 | 7 | @font-face { 8 | font-family: 'Lato'; 9 | font-style: normal; 10 | font-weight: 300; 11 | font-display: auto; 12 | src: local('Lato Light'), local('Lato-Light'), url('../fonts/Lato-Light.ttf') format('truetype'); 13 | } 14 | 15 | @font-face { 16 | font-family: 'Lato'; 17 | font-style: normal; 18 | font-weight: 400; 19 | font-display: auto; 20 | src: local('Lato Regular'), local('Lato-Regular'), url('../fonts/Lato-Regular.ttf') format('truetype'); 21 | } 22 | 23 | @font-face { 24 | font-family: 'Lato'; 25 | font-style: normal; 26 | font-weight: 700; 27 | font-display: auto; 28 | src: local('Lato Bold'), local('Lato-Bold'), url('../fonts/Lato-Bold.ttf') format('truetype'); 29 | } 30 | 31 | body { 32 | padding: 0; 33 | margin: 0; 34 | font-family: 'Lato'; 35 | text-rendering: geometricPrecision; 36 | -webkit-font-smoothing: antialiased; 37 | -moz-font-smoothing: grayscale; 38 | font-smoothing: antialiased; 39 | } 40 | 41 | .no-select { 42 | user-select: none; 43 | } 44 | 45 | input, 46 | textarea, 47 | button { 48 | font-family: 'Lato'; 49 | text-rendering: geometricPrecision; 50 | -webkit-font-smoothing: antialiased; 51 | -moz-font-smoothing: grayscale; 52 | font-smoothing: antialiased; 53 | } 54 | 55 | *, 56 | :after, 57 | :before { 58 | -webkit-box-sizing: border-box; 59 | -moz-box-sizing: border-box; 60 | box-sizing: border-box; 61 | } 62 | 63 | .container { 64 | overflow: hidden; 65 | position: fixed; 66 | width: 100%; 67 | height: 100%; 68 | background-color: #fafafa; 69 | } 70 | 71 | .main-page-container { 72 | position: fixed; 73 | display: flex; 74 | flex-flow: column wrap; 75 | align-items: center; 76 | padding: 2em; 77 | width: 100%; 78 | height: 100%; 79 | top: 0; 80 | left: 0; 81 | overflow-y: auto; 82 | background-color: #fff; 83 | transition: all 0.7s cubic-bezier(0.23, 1, 0.32, 1); 84 | 85 | & .main-page-content { 86 | max-width: 960px; 87 | width: 100%; 88 | 89 | & button.check-button { 90 | margin: 2em; 91 | } 92 | 93 | & .blocks-row { 94 | display: flex; 95 | flex-flow: row wrap; 96 | align-items: center; 97 | justify-content: space-between; 98 | margin-bottom: 2em; 99 | padding-bottom: 2em; 100 | border-bottom: 1px dashed color-mod(var(--green-color) alpha(15%)); 101 | 102 | &:last-child { 103 | padding-right: 0; 104 | } 105 | 106 | & .block { 107 | margin-bottom: 0; 108 | } 109 | 110 | & .block .content { 111 | border: none; 112 | } 113 | } 114 | 115 | & .block { 116 | display: inline-flex; 117 | flex-flow: row wrap; 118 | margin-bottom: 2em; 119 | padding-right: 2em; 120 | 121 | &.slider .content { 122 | padding-top: 1em; 123 | } 124 | 125 | &.wo-title .content { 126 | margin-top: -0.5em; 127 | } 128 | 129 | &:last-child { 130 | padding-right: 0; 131 | } 132 | 133 | & .sub-block { 134 | width: 100%; 135 | 136 | &:not(:first-child) .title { 137 | margin-top: 2em; 138 | } 139 | } 140 | 141 | & .input-area { 142 | width: 100%; 143 | margin-top: 1em; 144 | border-radius: 0.75em; 145 | padding: 0.75em 1em; 146 | background-color: #fff; 147 | resize: none; 148 | background-image: linear-gradient(to right, color-mod(var(--green-color) alpha(10%)), color-mod(var(--blue-color) alpha(10%))); 149 | box-shadow: 0 0.25em 1em color-mod(var(--green-color) alpha(5%)); 150 | } 151 | 152 | & .content { 153 | display: flex; 154 | width: 100%; 155 | padding-bottom: 1em; 156 | border-bottom: 1px dashed color-mod(var(--green-color) alpha(15%)); 157 | 158 | &.no-bot { 159 | padding-bottom: 0; 160 | border-bottom: none; 161 | } 162 | 163 | &.no-flex { 164 | display: block; 165 | } 166 | 167 | & button.ip-lookup-button, 168 | & button.add-url-button { 169 | margin: 0; 170 | margin-left: 2em; 171 | } 172 | } 173 | 174 | & h1:not(:first-child) { 175 | margin-top: 2em; 176 | } 177 | 178 | &.large { 179 | width: 100%; 180 | } 181 | 182 | &.middle { 183 | width: 50%; 184 | } 185 | 186 | &.small { 187 | width: 25%; 188 | } 189 | 190 | &.third { 191 | width: 33.3333333333%; 192 | } 193 | 194 | & .title { 195 | display: flex; 196 | justify-content: space-between; 197 | font-size: 0.85em; 198 | font-weight: 100; 199 | color: color-mod(var(--green-color) alpha(75%)); 200 | width: 100%; 201 | 202 | &.space-bot { 203 | margin-bottom: 16px; 204 | } 205 | 206 | & span.name { 207 | background-color: #fafafa; 208 | padding: 0.25em 0.75em; 209 | border-radius: 0.75em; 210 | } 211 | 212 | & span.value { 213 | padding: 0.25em 0; 214 | color: color-mod(var(--grey-color) alpha(75%)); 215 | } 216 | } 217 | } 218 | } 219 | } 220 | -------------------------------------------------------------------------------- /public/styles/Process.postcss: -------------------------------------------------------------------------------- 1 | :root { 2 | --green-color: #31bc86; 3 | --grey-color: #8c99a7; 4 | --blue-color: #5396d8; 5 | } 6 | 7 | .process-container { 8 | position: fixed; 9 | display: flex; 10 | flex-flow: column nowrap; 11 | align-items: center; 12 | padding: 2em; 13 | width: 100%; 14 | height: 100%; 15 | top: 0; 16 | left: 0; 17 | overflow-y: auto; 18 | background-color: #fff; 19 | transition: all 0.7s cubic-bezier(0.23, 1, 0.32, 1); 20 | opacity: 0; 21 | visibility: hidden; 22 | 23 | &.active { 24 | opacity: 1; 25 | visibility: visible; 26 | } 27 | 28 | & .process-content { 29 | max-width: 960px; 30 | width: 100%; 31 | 32 | & .stage { 33 | margin-bottom: 6em; 34 | animation-name: fade-one; 35 | animation-duration: 0.7s; 36 | animation-timing-function: cubic-bezier(0.23, 1, 0.32, 1); 37 | 38 | & span { 39 | font-weight: 700; 40 | } 41 | 42 | & h3 { 43 | display: inline-block; 44 | border-radius: 1.5em; 45 | margin: 0; 46 | margin-bottom: 2em; 47 | font-size: 1em; 48 | padding: 0.5em 1em; 49 | border: 1px dashed color-mod(var(--grey-color) alpha(35%)); 50 | color: color-mod(var(--grey-color) alpha(75%)); 51 | } 52 | 53 | & .crawl-level { 54 | margin-bottom: 2em; 55 | animation-name: fade-one; 56 | animation-duration: 0.7s; 57 | animation-timing-function: cubic-bezier(0.23, 1, 0.32, 1); 58 | 59 | &:last-child { 60 | margin-bottom: 0; 61 | } 62 | 63 | & .stats { 64 | margin-bottom: 1em; 65 | display: flex; 66 | padding: 0 1em; 67 | align-items: center; 68 | 69 | & .level { 70 | color: color-mod(var(--green-color) alpha(75%)); 71 | font-weight: 100; 72 | } 73 | 74 | & .found-links { 75 | margin-left: auto; 76 | color: color-mod(var(--blue-color) alpha(75%)); 77 | border: 1px dashed color-mod(var(--blue-color) alpha(35%)); 78 | font-size: 0.8em; 79 | padding: 0.25em 1em; 80 | border-radius: 1em; 81 | font-weight: 100; 82 | } 83 | } 84 | } 85 | 86 | & .progress-bar { 87 | position: relative; 88 | display: block; 89 | overflow: hidden; 90 | background-image: linear-gradient(to right, color-mod(var(--green-color) alpha(25%)), color-mod(var(--blue-color) alpha(25%))); 91 | padding: 0.75em; 92 | text-align: center; 93 | border-radius: 1.25em; 94 | 95 | & span { 96 | position: relative; 97 | color: #fff; 98 | } 99 | 100 | & .fill { 101 | top: 0; 102 | left: 0; 103 | width: 0%; 104 | height: 100%; 105 | position: absolute; 106 | border-radius: 1.25em; 107 | transition: all 0.7s cubic-bezier(0.23, 1, 0.32, 1); 108 | background-color: color-mod(var(--grey-color) alpha(15%)); 109 | } 110 | } 111 | } 112 | } 113 | } 114 | 115 | @keyframes fade-one { 116 | from { 117 | opacity: 0; 118 | transform: translateY(10%); 119 | } 120 | to { 121 | opacity: 1; 122 | transform: translateY(0); 123 | } 124 | } 125 | -------------------------------------------------------------------------------- /public/styles/Result.postcss: -------------------------------------------------------------------------------- 1 | :root { 2 | --green-color: #31bc86; 3 | --grey-color: #8c99a7; 4 | --blue-color: #5396d8; 5 | } 6 | 7 | .result-container { 8 | position: fixed; 9 | display: flex; 10 | flex-flow: column nowrap; 11 | align-items: center; 12 | padding: 2em; 13 | width: 100%; 14 | height: 100%; 15 | top: 0; 16 | left: 0; 17 | overflow-y: auto; 18 | background-color: #fff; 19 | transition: all 0.7s cubic-bezier(0.23, 1, 0.32, 1); 20 | opacity: 0; 21 | visibility: hidden; 22 | 23 | &.active { 24 | opacity: 1; 25 | visibility: visible; 26 | 27 | & .result-content { 28 | opacity: 1; 29 | transform: translateY(0%); 30 | } 31 | } 32 | 33 | & .result-content { 34 | max-width: 960px; 35 | width: 100%; 36 | opacity: 0; 37 | transform: translateY(-20%); 38 | transition: transform 0.7s cubic-bezier(0.23, 1, 0.32, 1); 39 | transition-delay: transform 0.3s; 40 | 41 | & .content-header { 42 | display: flex; 43 | flex-flow: row wrap; 44 | margin-bottom: 2em; 45 | 46 | & .selected-counts { 47 | display: flex; 48 | align-items: center; 49 | color: #fff; 50 | font-weight: 700; 51 | user-select: none; 52 | 53 | & span { 54 | font-weight: 100; 55 | color: color-mod(var(--grey-color) alpha(75%)); 56 | border-radius: 1.75em; 57 | margin-right: 1em; 58 | border: 1px solid color-mod(var(--grey-color) alpha(35%)); 59 | padding: 0.25em 1em; 60 | font-size: 0.8em; 61 | } 62 | } 63 | 64 | & .controls { 65 | margin-left: auto; 66 | align-items: center; 67 | display: flex; 68 | 69 | & svg { 70 | width: 1.25em; 71 | height: 1.25em; 72 | transition: all 0.3s cubic-bezier(0.23, 1, 0.32, 1); 73 | fill: color-mod(var(--grey-color) alpha(35%)); 74 | cursor: pointer; 75 | margin-left: 2em; 76 | 77 | &:hover { 78 | fill: color-mod(var(--blue-color) alpha(75%)); 79 | } 80 | } 81 | } 82 | } 83 | 84 | & .countries { 85 | display: flex; 86 | flex-flow: row wrap; 87 | justify-content: space-between; 88 | text-align: left; 89 | 90 | & .country-item { 91 | display: flex; 92 | user-select: none; 93 | cursor: pointer; 94 | padding: 0.25em 0.5em; 95 | width: calc(25% - 0.5em); 96 | margin-bottom: 0.75em; 97 | overflow: hidden; 98 | align-items: center; 99 | border-radius: 2em; 100 | border: 1px dashed color-mod(var(--grey-color) alpha(15%)); 101 | transition: all 0.5s cubic-bezier(0.23, 1, 0.32, 1); 102 | color: color-mod(var(--grey-color) alpha(50%)); 103 | 104 | &.active { 105 | color: color-mod(var(--blue-color) alpha(75%)); 106 | border-color: color-mod(var(--blue-color) alpha(50%)); 107 | } 108 | 109 | & .ico { 110 | width: 40px; 111 | min-width: 40px; 112 | height: 26px; 113 | background-color: #fafafa; 114 | background-repeat: no-repeat; 115 | background-position: center; 116 | background-size: cover; 117 | border-radius: 1em; 118 | margin-right: 0.5em; 119 | } 120 | 121 | & .merge { 122 | width: calc(100% - 48px); 123 | } 124 | 125 | & .name { 126 | font-size: 0.9em; 127 | white-space: nowrap; 128 | overflow: hidden; 129 | text-overflow: ellipsis; 130 | } 131 | 132 | & .count { 133 | font-size: 0.75em; 134 | font-weight: 700; 135 | white-space: nowrap; 136 | overflow: hidden; 137 | text-overflow: ellipsis; 138 | } 139 | } 140 | } 141 | } 142 | } 143 | -------------------------------------------------------------------------------- /public/styles/Update.postcss: -------------------------------------------------------------------------------- 1 | :root { 2 | --green-color: #31bc86; 3 | --grey-color: #8c99a7; 4 | --blue-color: #5396d8; 5 | } 6 | 7 | .update-notify { 8 | position: fixed; 9 | width: 100%; 10 | height: 100%; 11 | display: flex; 12 | flex-flow: column nowrap; 13 | align-items: center; 14 | left: 0; 15 | top: 0; 16 | padding: 2em; 17 | overflow: auto; 18 | opacity: 1; 19 | transition: all 0.5s cubic-bezier(0.23, 1, 0.32, 1); 20 | background-image: linear-gradient(to right, color-mod(var(--green-color) alpha(25%)), color-mod(var(--blue-color) alpha(25%))); 21 | background-color: color-mod(#fff alpha(95%)); 22 | z-index: 3; 23 | 24 | &.closed { 25 | opacity: 0; 26 | visibility: hidden; 27 | z-index: 0; 28 | } 29 | 30 | &.checking { 31 | width: 100%; 32 | height: 100%; 33 | left: 0; 34 | top: 0; 35 | 36 | & .lds-ripple { 37 | opacity: 1; 38 | } 39 | } 40 | 41 | &.downloading { 42 | width: 400px; 43 | height: 100px; 44 | left: calc(50% - 200px); 45 | top: calc(50% - 50px); 46 | overflow: hidden; 47 | border-radius: 0.75em; 48 | 49 | & .update-container { 50 | opacity: 0; 51 | } 52 | } 53 | 54 | & .lds-ripple { 55 | opacity: 0; 56 | position: fixed; 57 | width: 58px; 58 | height: 58px; 59 | left: calc(50% - 29px); 60 | top: calc(50% - 29px); 61 | border-radius: 100%; 62 | 63 | & div { 64 | position: absolute; 65 | border: 4px solid #fff; 66 | opacity: 1; 67 | border-radius: 50%; 68 | animation: lds-ripple 1s cubic-bezier(0, 0.2, 0.8, 1) infinite; 69 | 70 | &:nth-child(2) { 71 | animation-delay: -0.5s; 72 | } 73 | } 74 | } 75 | 76 | & .update-container { 77 | max-width: 960px; 78 | width: 100%; 79 | border-radius: 0.75em; 80 | transform: translateY(0); 81 | opacity: 1; 82 | transition: all 0.7s cubic-bezier(0.23, 1, 0.32, 1); 83 | animation-name: fade-one; 84 | animation-duration: 0.7s; 85 | animation-timing-function: cubic-bezier(0.23, 1, 0.32, 1); 86 | padding: 2em; 87 | border-radius: 1.25em; 88 | background-color: color-mod(#fff alpha(75%)); 89 | 90 | & .section-name { 91 | display: inline-flex; 92 | font-weight: 100; 93 | font-size: 1em; 94 | color: color-mod(var(--green-color) alpha(50%)); 95 | border: 1px dashed color-mod(var(--green-color) alpha(50%)); 96 | padding: 0.25em 0.75em; 97 | border-radius: 1.25em; 98 | } 99 | 100 | & .update-description { 101 | color: color-mod(var(--green-color) alpha(50%)); 102 | margin-bottom: 4em; 103 | } 104 | } 105 | } 106 | 107 | .download-progress { 108 | position: fixed; 109 | left: calc(50% - 200px + 2em); 110 | top: calc(50% - 5px); 111 | width: calc(400px - 4em); 112 | height: 10px; 113 | overflow: hidden; 114 | background-color: #ffffff; 115 | border-radius: 0.25em; 116 | } 117 | 118 | .download-progress-bar { 119 | position: absolute; 120 | background-color: rgba(49, 188, 135, 0.75); 121 | height: 100%; 122 | border-radius: 0.25em; 123 | transition: all 0.5s cubic-bezier(0.23, 1, 0.32, 1); 124 | } 125 | 126 | .update-download { 127 | margin: 1em 0 2em 0; 128 | display: flex; 129 | flex-flow: column nowrap; 130 | 131 | & a { 132 | color: color-mod(var(--green-color) alpha(50%)); 133 | text-decoration: none; 134 | transition: all 0.5s cubic-bezier(0.23, 1, 0.32, 1); 135 | margin: 0.15em 0; 136 | white-space: nowrap; 137 | overflow: hidden; 138 | text-overflow: ellipsis; 139 | 140 | &:hover { 141 | color: var(--green-color); 142 | } 143 | 144 | & span.size { 145 | margin-right: 0.5em; 146 | color: #607d8b; 147 | font-size: 0.85em; 148 | text-decoration: none; 149 | } 150 | } 151 | } 152 | 153 | @keyframes lds-ripple { 154 | 0% { 155 | top: 28px; 156 | left: 28px; 157 | width: 0; 158 | height: 0; 159 | opacity: 1; 160 | } 161 | 100% { 162 | top: -1px; 163 | left: -1px; 164 | width: 58px; 165 | height: 58px; 166 | opacity: 0; 167 | } 168 | } 169 | 170 | @keyframes fade-one { 171 | from { 172 | opacity: 0; 173 | transform: translateY(10%); 174 | } 175 | to { 176 | opacity: 1; 177 | transform: translateY(0); 178 | } 179 | } 180 | -------------------------------------------------------------------------------- /src/actions/MainActions.js: -------------------------------------------------------------------------------- 1 | import { MAIN_CHANGE_OPTION, MAIN_TOGGLE_OPTION } from '../constants/ActionTypes'; 2 | 3 | export const changeOption = e => ({ 4 | type: MAIN_CHANGE_OPTION, 5 | target: e.target.name, 6 | value: e.target.value 7 | }); 8 | 9 | export const toggleOption = e => ({ 10 | type: MAIN_TOGGLE_OPTION, 11 | target: e.target.name 12 | }); 13 | -------------------------------------------------------------------------------- /src/actions/ProcessActions.js: -------------------------------------------------------------------------------- 1 | import Links from '../core/links'; 2 | import Parser from '../core/parser'; 3 | import { uniq } from '../misc/other'; 4 | import { saveSettings } from '../core/settings'; 5 | import { 6 | PROCESS_START_CRAWLING, 7 | PROCESS_UPDATE_CRAWLING_LEVEL_STATUS, 8 | PROCESS_ADD_CRAWLING_LEVEL, 9 | PROCESS_START_PARSING, 10 | PROCESS_UPDATE_PARSING_STATUS 11 | } from '../constants/ActionTypes'; 12 | import { showResults } from './ResultActions'; 13 | 14 | const normalizeUrls = urls => { 15 | const links = urls.match(/((https?\:\/\/)|(www\.))(\S+)(\w{2,4})(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?/gi); 16 | 17 | if (links == null) { 18 | throw new Error('No links found'); 19 | } 20 | 21 | return links.map(url => (url.match(/http:\/\/|https:\/\//i) ? url : 'http://' + url)); 22 | }; 23 | 24 | export const start = () => async (dispatch, getState) => { 25 | try { 26 | const { 27 | main: { threads, retry, deep, external, level, input } 28 | } = getState(); 29 | saveSettings({ main: { threads, retry, deep, external, level, input } }); 30 | 31 | if (deep) { 32 | dispatch(startCrawling()); 33 | } 34 | 35 | const normalizedLinks = uniq(normalizeUrls(input)); 36 | const links = deep ? await new Links({ threads, retry, deep, external, level }, normalizedLinks) : normalizedLinks; 37 | 38 | dispatch(startParsing(links.length)); 39 | 40 | const results = await new Parser({ threads, retry }, links); 41 | 42 | dispatch(showResults(results)); 43 | } catch (error) { 44 | alert(error); 45 | } 46 | }; 47 | 48 | export const startCrawling = () => ({ 49 | type: PROCESS_START_CRAWLING 50 | }); 51 | 52 | export const addCrawlLevel = (level, passed, all) => ({ 53 | type: PROCESS_ADD_CRAWLING_LEVEL, 54 | level, 55 | passed, 56 | all 57 | }); 58 | 59 | export const updateCrawlLevelStatus = (level, passed, found) => ({ 60 | type: PROCESS_UPDATE_CRAWLING_LEVEL_STATUS, 61 | level, 62 | passed, 63 | found 64 | }); 65 | 66 | export const startParsing = all => ({ 67 | type: PROCESS_START_PARSING, 68 | all 69 | }); 70 | 71 | export const updateParsingStatus = done => ({ 72 | type: PROCESS_UPDATE_PARSING_STATUS, 73 | done 74 | }); 75 | -------------------------------------------------------------------------------- /src/actions/ResultActions.js: -------------------------------------------------------------------------------- 1 | import { lookup, codes } from '../core/country'; 2 | import { uniq } from '../misc/other'; 3 | import { sort } from 'js-flock'; 4 | import { writeFile } from 'fs'; 5 | import { remote } from 'electron'; 6 | import { RESULT_SHOW, CLOSE, RESULT_TOGGLE_COUNTRY } from '../constants/ActionTypes'; 7 | 8 | const { dialog } = remote; 9 | 10 | export const showResults = results => dispatch => { 11 | const res = []; 12 | let countries = {}; 13 | const proxies = uniq(results.proxies.flat()); 14 | 15 | proxies.forEach(item => { 16 | const [ip] = item.split(':'); 17 | const code = lookup(ip); 18 | 19 | if (countries[code] == undefined) { 20 | countries[code] = { 21 | code, 22 | ...codes[code], 23 | items: [item] 24 | }; 25 | } else { 26 | countries[code].items.push(item); 27 | } 28 | }); 29 | 30 | Object.keys(countries).forEach(item => { 31 | res.push({ 32 | ...countries[item], 33 | active: true 34 | }); 35 | }); 36 | 37 | dispatch({ 38 | type: RESULT_SHOW, 39 | linksWithProxies: results.linksWithProxies, 40 | proxiesByCountries: sort(res).desc(item => item.items.length) 41 | }); 42 | }; 43 | 44 | export const toggleCountry = (code, state, all) => ({ 45 | type: RESULT_TOGGLE_COUNTRY, 46 | code, 47 | state, 48 | all 49 | }); 50 | 51 | export const save = () => (dispatch, getState) => { 52 | let savePath = dialog.showSaveDialog({ 53 | filters: [ 54 | { 55 | name: 'Text Files', 56 | extensions: ['txt'] 57 | } 58 | ] 59 | }); 60 | 61 | if (savePath) { 62 | const { 63 | result: { proxiesByCountries } 64 | } = getState(); 65 | 66 | const results = proxiesByCountries 67 | .filter(item => item.active) 68 | .map(item => item.items) 69 | .reduce((prev, curr) => [...prev, ...curr], []); 70 | 71 | writeFile(savePath, results.join('\r\n'), () => null); 72 | } 73 | }; 74 | 75 | export const close = () => ({ 76 | type: CLOSE 77 | }); 78 | -------------------------------------------------------------------------------- /src/actions/UpdateActions.js: -------------------------------------------------------------------------------- 1 | import request from 'request'; 2 | import progress from 'request-progress'; 3 | import { remote, shell } from 'electron'; 4 | import { getLatestVersionInfo } from '../core/updater'; 5 | import { createWriteStream } from 'fs'; 6 | import { wait } from '../misc/other'; 7 | import { UPDATE_CHANGE_STATE, UPDATE_UP_DOWNLOAD_PROGRESS, UPDATE_CLOSE } from '../constants/ActionTypes'; 8 | 9 | const { dialog, getCurrentWindow } = remote; 10 | 11 | export const checkAtAvailable = () => async dispatch => { 12 | const details = await getLatestVersionInfo(); 13 | 14 | await wait(500); 15 | 16 | if (details) { 17 | dispatch( 18 | changeUpdateState({ 19 | isAvailable: true, 20 | isChecking: false, 21 | info: details 22 | }) 23 | ); 24 | } else { 25 | dispatch( 26 | changeUpdateState({ 27 | active: false, 28 | isChecking: false 29 | }) 30 | ); 31 | } 32 | }; 33 | 34 | const changeUpdateState = nextState => ({ 35 | type: UPDATE_CHANGE_STATE, 36 | nextState 37 | }); 38 | 39 | export const close = () => ({ 40 | type: UPDATE_CLOSE 41 | }); 42 | 43 | const upDownloadProgress = percent => ({ 44 | type: UPDATE_UP_DOWNLOAD_PROGRESS, 45 | percent 46 | }); 47 | 48 | export const download = e => async dispatch => { 49 | e.preventDefault(); 50 | 51 | let savePath = dialog.showSaveDialog({ 52 | defaultPath: e.target.title, 53 | filters: [ 54 | { 55 | name: '.rar, .exe, .zip, .7z', 56 | extensions: ['rar', 'exe', 'zip', '7z'] 57 | } 58 | ] 59 | }); 60 | 61 | if (!savePath) return; 62 | 63 | dispatch(changeUpdateState({ onDownloading: true })); 64 | 65 | progress(request(e.target.href), { 66 | throttle: 100 67 | }) 68 | .on('progress', state => { 69 | dispatch(upDownloadProgress(state.percent * 100)); 70 | }) 71 | .on('end', () => { 72 | shell.showItemInFolder(savePath); 73 | getCurrentWindow().close(); 74 | }) 75 | .pipe(createWriteStream(savePath)); 76 | }; 77 | -------------------------------------------------------------------------------- /src/components/Footer.jsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { shell } from 'electron'; 3 | import { currentVersion } from '../core/updater'; 4 | 5 | import '../../public/styles/Footer.postcss'; 6 | 7 | const openLink = e => { 8 | e.preventDefault(); 9 | shell.openExternal(e.currentTarget.href || e.currentTarget.getAttribute('xlink:href')); 10 | }; 11 | 12 | const Footer = () => ( 13 | 43 | ); 44 | 45 | export default Footer; 46 | -------------------------------------------------------------------------------- /src/components/ProcessCrawl.jsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import ProcessCrawlLevel from './ProcessCrawlLevel'; 3 | 4 | const ProcessCrawl = ({ crawling }) => ( 5 |
6 |

Crawling

7 | {crawling.map(item => ( 8 | 9 | ))} 10 |
11 | ); 12 | 13 | export default ProcessCrawl; 14 | -------------------------------------------------------------------------------- /src/components/ProcessCrawlLevel.jsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { splitByKK } from '../misc/text'; 3 | 4 | const ProcessCrawlLevel = ({ level, links }) => { 5 | const progressStyle = { 6 | width: Math.floor((links.passed / links.all) * 100) + '%' 7 | }; 8 | 9 | return ( 10 |
11 |
12 | Deep level {level + 1} 13 | Found New Links: {splitByKK(links.found)} 14 |
15 |
16 |
17 | 18 | Crawled links {splitByKK(links.passed)} of {splitByKK(links.all)} 19 | 20 |
21 |
22 | ); 23 | }; 24 | 25 | export default ProcessCrawlLevel; 26 | -------------------------------------------------------------------------------- /src/components/ProcessParse.jsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { splitByKK } from '../misc/text'; 3 | 4 | const ProcessParse = ({ parsing }) => { 5 | const progressStyle = { 6 | width: Math.floor((parsing.done / parsing.all) * 100) + '%' 7 | }; 8 | 9 | return ( 10 |
11 |

Parsing

12 |
13 |
14 | 15 | Parsed links {splitByKK(parsing.done)} of {splitByKK(parsing.all)} 16 | 17 |
18 |
19 | ); 20 | }; 21 | 22 | export default ProcessParse; 23 | -------------------------------------------------------------------------------- /src/components/ResultCountryItem.jsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { splitByKK } from '../misc/text'; 3 | 4 | export default class ResultCountryItem extends React.PureComponent { 5 | toggle = () => { 6 | const { toggleCountry, code, active } = this.props; 7 | toggleCountry(code, !active); 8 | }; 9 | 10 | toggleAll = () => { 11 | const { toggleCountry, code, active } = this.props; 12 | toggleCountry(code, !active, true); 13 | }; 14 | 15 | render = () => { 16 | const { active, flag, name, items } = this.props; 17 | 18 | return ( 19 |
20 |
21 |
22 |
{name}
23 |
Proxies: {splitByKK(items.length)}
24 |
25 |
26 | ); 27 | }; 28 | } 29 | -------------------------------------------------------------------------------- /src/components/Root.jsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import Main from '../containers/Main'; 3 | import Process from '../containers/Process'; 4 | import Result from '../containers/Result'; 5 | import Update from '../containers/Update'; 6 | 7 | const Root = () => ( 8 |
9 |
10 | 11 | 12 | 13 |
14 | ); 15 | 16 | export default Root; 17 | -------------------------------------------------------------------------------- /src/components/ui/Checkbox.jsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | const Checkbox = ({ id, name, checked, onChange, text }) => ( 4 | <> 5 | 6 | 14 | 15 | ); 16 | 17 | export default Checkbox; 18 | -------------------------------------------------------------------------------- /src/constants/ActionTypes.js: -------------------------------------------------------------------------------- 1 | //main 2 | export const MAIN_CHANGE_OPTION = 'MAIN_CHANGE_OPTION'; 3 | export const MAIN_TOGGLE_OPTION = 'MAIN_TOGGLE_OPTION'; 4 | 5 | //process 6 | export const PROCESS_START_CRAWLING = 'PROCESS_START_CRAWLING'; 7 | export const PROCESS_ADD_CRAWLING_LEVEL = 'PROCESS_ADD_CRAWLING_LEVEL'; 8 | export const PROCESS_UPDATE_CRAWLING_LEVEL_STATUS = 'PROCESS_UPDATE_CRAWLING_LEVEL_STATUS'; 9 | export const PROCESS_START_PARSING = 'PROCESS_START_PARSING'; 10 | export const PROCESS_UPDATE_PARSING_STATUS = 'PROCESS_UPDATE_PARSING_STATUS'; 11 | 12 | //results 13 | export const RESULT_SHOW = 'RESULT_SHOW'; 14 | export const RESULT_TOGGLE_COUNTRY = 'RESULT_TOGGLE_COUNTRY'; 15 | 16 | //update 17 | export const UPDATE_CHANGE_STATE = 'UPDATE_CHANGE_STATE'; 18 | export const UPDATE_UP_DOWNLOAD_PROGRESS = 'UPDATE_UP_DOWNLOAD_PROGRESS'; 19 | export const UPDATE_CLOSE = 'UPDATE_CLOSE'; 20 | 21 | // process + results 22 | export const CLOSE = 'CLOSE'; 23 | -------------------------------------------------------------------------------- /src/constants/SettingsConstants.js: -------------------------------------------------------------------------------- 1 | import path from 'path'; 2 | 3 | export const SETTINGS_FILE_NAME = 'settings.unfx.parser.json'; 4 | export const SETTINGS_FILE_PATH = process.env.PORTABLE_EXECUTABLE_DIR ? path.resolve(process.env.PORTABLE_EXECUTABLE_DIR, SETTINGS_FILE_NAME) : SETTINGS_FILE_NAME; 5 | 6 | export const DEFAULT_MAIN_SETTINGS = { 7 | threads: 350, 8 | external: false, 9 | retry: false, 10 | deep: true, 11 | level: 2, 12 | input: '' 13 | }; 14 | 15 | export const MERGED_DEFAULT_SETTINGS = { 16 | main: DEFAULT_MAIN_SETTINGS 17 | }; 18 | -------------------------------------------------------------------------------- /src/containers/Main.jsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { connect } from 'react-redux'; 3 | import { changeOption, toggleOption } from '../actions/MainActions'; 4 | import { start } from '../actions/ProcessActions'; 5 | import Footer from '../components/Footer'; 6 | import Checkbox from '../components/ui/Checkbox'; 7 | 8 | import '../../public/styles/Main.postcss'; 9 | import '../../public/styles/Elements.postcss'; 10 | 11 | const Main = ({ threads, retry, deep, external, level, input, changeOption, toggleOption, start }) => ( 12 |
13 |
14 |
15 |
16 |
17 | 18 | 19 | 20 |
21 |
22 |
23 |
24 |
25 |
26 | Threads 27 | {threads} 28 |
29 |
30 | 31 |
32 |
33 |
34 |
35 | Deep level 36 | {level} 37 |
38 |
39 | 40 |
41 |
42 |
43 |
44 |
45 |
46 | Urls 47 |
48 |
49 |