Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
hmglife authored Sep 2, 2020
1 parent 4657e2c commit 8606608
Showing 1 changed file with 105 additions and 0 deletions.
105 changes: 105 additions & 0 deletions Aria2_一键完美配置魔改版_v1_0.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
{
"nbformat": 4,
"nbformat_minor": 0,
"metadata": {
"colab": {
"name": "Aria2_一键完美配置魔改版_v1_0.ipynb",
"provenance": [],
"collapsed_sections": []
},
"kernelspec": {
"name": "python3",
"display_name": "Python 3"
}
},
"cells": [
{
"cell_type": "code",
"metadata": {
"id": "PJIJFELO5HXB",
"colab_type": "code",
"cellView": "form",
"colab": {}
},
"source": [
"\n",
"#@markdown <h3>⬅️ 点击一键运行</h3>\n",
"#@markdown <center><h3>Aria2<br />完美配置魔改版</h3></center><br>\n",
"\n",
"#Aria2一键完美配置脚本一键安装\n",
"!apt install wget curl ca-certificates &> /dev/null\n",
"!wget -N git.io/aria2.sh &> /dev/null && chmod +x aria2.sh &> /dev/null\n",
"!echo 1|./aria2.sh &> /dev/null\n",
"\n",
"#rclone安装\n",
"!curl https://rclone.org/install.sh 2>/dev/null | sudo bash &> /dev/null\n",
"\n",
"#rclone配置\n",
"Rclone_config = \"\" # @param {type:\"string\"}\n",
"!wget echo $Rclone_config -P /root/.config/rclone/ &> /dev/null\n",
"\n",
"#自动上传GD配置修改\n",
"Aria2_config = \"\" # @param {type:\"string\"}\n",
"Script_config = \"\" # @param {type:\"string\"}\n",
"!wget echo $Aria2_config -O /root/.aria2c/aria2.conf &> /dev/null\n",
"!wget echo $Script_config -O /root/.aria2c/script.conf &> /dev/null\n",
"\n",
"#自动更新tracker后重启Aria2\n",
"!echo 12|./aria2.sh &> /dev/null\n",
"!echo 6|./aria2.sh &> /dev/null\n",
"\n",
"#搬运Github大佬配置\n",
"import os, pathlib, zipfile, re\n",
"import urllib.request\n",
"from IPython.display import HTML, clear_output\n",
"\n",
"#####################################\n",
"USE_FREE_TOKEN = True # @param {type:\"boolean\"}\n",
"REGION = \"JP\" #@param [\"US\", \"EU\", \"AP\", \"AU\", \"SA\", \"JP\", \"IN\"]\n",
"Aria2_rpc = True\n",
"TOKEN = \"\" # @param {type:\"string\"}\n",
"\n",
"HOME = os.path.expanduser(\"~\")\n",
"\n",
"if not os.path.exists(f\"{HOME}/.ipython/ocr.py\"):\n",
" hCode = \"https://raw.githubusercontent.com/biplobsd/\" \\\n",
" \"OneClickRun/master/res/ocr.py\"\n",
" urllib.request.urlretrieve(hCode, f\"{HOME}/.ipython/ocr.py\")\n",
"\n",
"\n",
"from ocr import (\n",
" runSh,\n",
" loadingAn,\n",
" PortForward_wrapper,\n",
" CWD,\n",
" displayUrl,\n",
" findProcess\n",
")\n",
"\n",
"loadingAn()\n",
"\n",
"# START_SERVER\n",
"# Ngrok region 'us','eu','ap','au','sa','jp','in'\n",
"clear_output()\n",
"PORT_FORWARD = \"ngrok\" #@param [\"ngrok\", \"localhost\"]\n",
"Server = PortForward_wrapper(\n",
" PORT_FORWARD, TOKEN, USE_FREE_TOKEN, [['Aria2_rpc', 6800, 'http']], REGION.lower(), \n",
" [f\"{HOME}/.ngrok2/aria2.yml\", 5042]\n",
")\n",
"if Aria2_rpc:\n",
" data = Server.start('Aria2_rpc', displayB=False)\n",
" Host = data['url'][7:] \n",
" port = \"80\"\n",
" clear_output()\n",
"\n",
"#查看Aria2配置\n",
"!echo 8|./aria2.sh\n",
"\n",
"if Aria2_rpc:\n",
" display(HTML(\"\"\"<style>@import url('https://fonts.googleapis.com/css?family=Source+Code+Pro:200,900'); :root { --text-color: hsla(210, 50%, 85%, 1); --shadow-color: hsla(210, 40%, 52%, .4); --btn-color: hsl(210, 80%, 42%); --bg-color: #141218; } * { box-sizing: border-box; } button { position:relative; padding: 10px 20px; border: none; background: none; font-family: \"Source Code Pro\"; font-weight: 900;font-size: 100%; color: var(--text-color); background-color: var(--btn-color); box-shadow: var(--shadow-color) 2px 2px 22px; border-radius: 4px; z-index: 0;overflow: hidden; -webkit-user-select: text;-moz-user-select: text;-ms-user-select: text;user-select: text;} button:focus { outline-color: transparent; box-shadow: var(--btn-color) 2px 2px 22px; } .right::after, button::after { content: var(--content); display: block; position: absolute; white-space: nowrap; padding: 40px 40px; pointer-events:none; } button::after{ font-weight: 200; top: -30px; left: -20px; } .right, .left { position: absolute; width: 100%; height: 100%; top: 0; } .right { left: 66%; } .left { right: 66%; } .right::after { top: -30px; left: calc(-66% - 20px); background-color: var(--bg-color); color:transparent; transition: transform .4s ease-out; transform: translate(0, -90%) rotate(0deg) } button:hover .right::after { transform: translate(0, -47%) rotate(0deg) } button .right:hover::after { transform: translate(0, -50%) rotate(-7deg) } button .left:hover ~ .right::after { transform: translate(0, -50%) rotate(7deg) } /* bubbles */ button::before { content: ''; pointer-events: none; opacity: .6; background: radial-gradient(circle at 20% 35%, transparent 0, transparent 2px, var(--text-color) 3px, var(--text-color) 4px, transparent 4px), radial-gradient(circle at 75% 44%, transparent 0, transparent 2px, var(--text-color) 3px, var(--text-color) 4px, transparent 4px), radial-gradient(circle at 46% 52%, transparent 0, transparent 4px, var(--text-color) 5px, var(--text-color) 6px, transparent 6px); width: 100%; height: 300%; top: 0; left: 0; position: absolute; animation: bubbles 5s linear infinite both; } @keyframes bubbles { from { transform: translate(); } to { transform: translate(0, -66.666%); } }.zui-table { border: solid 1px #DDEEEE; border-collapse: collapse; border-spacing: 0; font: normal 13px;}.zui-table thead th { background-color: #DDEFEF; border: solid 1px #DDEEEE; color: #0000009e; padding: 10px; text-align: left;}.zui-table tbody td {border: solid 1px #effff97a;color: #ffffffd1; padding: 10px;}</style><center><button><table class=\"zui-table blueBG\"><p>Aria2 rpc config<p><thead> <tr> <th>Protocol</th> <th>Host</th> <th>Port</th> </tr> </thead> <tbody> <tr> <td>WebSocket</td><td>\"\"\"+Host+\"\"\"</td><td>\"\"\"+port+\"\"\"</td></tr></tbody></table><a target=\"_blank\" style=\"text-decoration: none;color: hsla(210, 50%, 85%, 1);font-size: 10px;\" href=\"https://raw.githubusercontent.com/biplobsd/OneClickRun/master/img/aria2RpcConfigSetup.gif\">NB. How to setup this's config. [Click ME]</a></button><center>\"\"\"))"
],
"execution_count": null,
"outputs": []
}
]
}

0 comments on commit 8606608

Please sign in to comment.