'))
418 | return True
419 | else:
420 | print("Script Update Checker: Your script is up to date")
421 |
422 | class LocalhostRun:
423 | def __init__(self,port,id=None,interval=30,retries=30):
424 | import os
425 | filePath = "/usr/local/sessionSettings/localhostDB.json"
426 | if not os.path.exists(filePath):
427 | os.makedirs(filePath[:-16], exist_ok=True)
428 | open(filePath, 'w').close()
429 | installAutoSSH()
430 | if not id:id=str(uuid.uuid4())[:8]
431 | self.connection=None
432 | self.id=id
433 | self.port=port
434 | self.interval=interval
435 | self.retries=retries
436 |
437 | def start(self):
438 | if self.connection:self.connection.kill()
439 | self.connection=Popen(f"ssh -R 80:localhost:{self.port} {self.id}@ssh.localhost.run -o StrictHostKeyChecking=no".split(), stdout=PIPE, stdin=PIPE)
440 | try:
441 | return re.findall("http://(.*?.localhost.run)",self.connection.stdout.readline().decode("utf-8"))[0]
442 | except:
443 | raise Exception(self.connection.stdout.readline().decode("utf-8"))
444 |
445 | def keep_alive(self):
446 | # if self.connection:self.connection.kill()
447 | import urllib
448 | try:
449 | localhostOpenDB = dict(accessSettingFile("localhostDB.json", v=False))
450 | except TypeError:
451 | localhostOpenDB = dict()
452 |
453 | if findProcess("autossh", f"80:localhost:{self.port}"):
454 | try:
455 | oldAddr = localhostOpenDB[str(self.port)]
456 | urllib.request.urlopen("http://"+oldAddr)
457 | return oldAddr
458 | except:
459 | pass
460 |
461 | self.connection=Popen(f"autossh -R 80:localhost:{self.port} {self.id}@ssh.localhost.run -o StrictHostKeyChecking=no -o ServerAliveInterval={self.interval} -o ServerAliveCountMax={self.retries}".split(), stdout=PIPE, stdin=PIPE)
462 | #print("ssh -R 80:localhost:{self.port} {self.id}@ssh.localhost.run -o StrictHostKeyChecking=no -o ServerAliveInterval={self.interval} -o ServerAliveCountMax={self.retries}")
463 | try:
464 | newAddr = re.findall("http://(.*?.localhost.run)",self.connection.stdout.readline().decode("utf-8"))[0]
465 | localhostOpenDB[str(self.port)] = newAddr
466 | accessSettingFile("localhostDB.json" , localhostOpenDB, v=False)
467 | return newAddr
468 | except:
469 | raise Exception(self.connection.stdout.readline().decode("utf-8"))
470 |
471 | def kill(self):
472 | self.connection.kill()
473 |
474 |
475 | class PortForward:
476 | def __init__(self,connections,region=None,SERVICE="localhost",TOKEN=None,USE_FREE_TOKEN=None,config=None):
477 | c=dict()
478 | for con in connections:
479 | c[con[0]]=dict(port=con[1],proto=con[2])
480 | self.connections=c
481 | self.ngrok=ngrok(TOKEN,USE_FREE_TOKEN,connections,region,config)
482 | self.SERVICE = SERVICE
483 |
484 | def start(self,name,btc='b',displayB=True,v=True):
485 | from IPython.display import clear_output
486 |
487 | if self.SERVICE == "localhost":
488 | con=self.connections[name]
489 | port=con["port"]
490 | proto=con["proto"]
491 | if(proto=="tcp"):
492 | return self.ngrok.start(name,btc,displayB,v)
493 | else:
494 | if v:
495 | clear_output()
496 | loadingAn(name="lds")
497 | textAn("Starting localhost ...", ty="twg")
498 | data = dict(url="http://"+LocalhostRun(port).keep_alive())
499 | if displayB:
500 | displayUrl(data, btc)
501 | return data
502 | elif self.SERVICE == "ngrok":
503 | return self.ngrok.start(name,btc,displayB,v)
504 |
505 |
506 | class PortForward_wrapper(PortForward):
507 | def __init__(self,SERVICE,TOKEN,USE_FREE_TOKEN,connections,region,config):
508 | super(self.__class__,self).__init__(connections,region,SERVICE,TOKEN,USE_FREE_TOKEN,config)
509 |
--------------------------------------------------------------------------------
/res/utorrent/utserver.conf:
--------------------------------------------------------------------------------
1 | ###########################################
2 | ### ###
3 | ### Utorrent Server v3.0 Config File ###
4 | ### ###
5 | ### By Khizer Naeem ###
6 | ### khizernaeem@gmail.com ###
7 | ### Date: 29/12/2011 ###
8 | ### ###
9 | ###########################################
10 | ###########################################
11 | # Note: - Don't use quotes or double quotes when giving a value
12 | # - Don't add trailing / when specifying any directory
13 |
14 | #####################
15 | ## Regular Settings #
16 | #####################
17 |
18 | #bind_port (integer):
19 | # Default value: 6881. Port used for BitTorrent protocol. This can be any value in the range 1025-65000.
20 | bind_port: 6881
21 |
22 | #max_ul_rate (integer):
23 | # Default value: -1. Maximum total upload rate in kilobytes per second. -1 means unlimited. We recommend setting it to -1.
24 | max_ul_rate: 0
25 |
26 | #max_ul_rate_seed (integer):
27 | # Default value: -1. Maximum per-torrent upload rate when seeding, in kilobytes per second. -1 means unlimited. We recommend setting it to -1.
28 | max_ul_rate_seed: 0
29 |
30 | #conns_per_torrent (integer):
31 | # Default value: 50. Maximum number of connections for a given torrent.
32 | conns_per_torrent: 999
33 |
34 | #max_total_connections (integer):
35 | # Default value: 200. Maximum number of connection opened at the same time.
36 | max_total_connections: 999
37 |
38 | #auto_bandwidth_management (boolean):
39 | # Default value: true. If true, upload bandwidth is automatically throttled in order to not impact other applications using TCP/IP.
40 | auto_bandwidth_management: true
41 |
42 | #max_dl_rate (integer):
43 | # Default value: -1. Maximum total download rate in kilobytes per second. -1 means unlimited. We recommend setting it to -1.
44 | max_dl_rate: 0
45 |
46 | #seed_ratio (integer):
47 | # Default value: 0. Seed ratio in percent (%) (e.g. 100 means 100%). If not 0, seeding will stop after reaching this upload/download ratio.
48 | seed_ratio: 0
49 |
50 | #seed_time (integer):
51 | # Default value: 0. Time after which seeding will stop, in seconds. 0 means seeding won't stop.
52 | seed_time: 0
53 |
54 |
55 | #####################
56 | # Internal Settings #
57 | #####################
58 |
59 | #bind_ip (string):
60 | # IP address to use for socket connections. If not provided, a default IP address will be used. We do not recommend changing this value.
61 |
62 | #ut_webui_port (integer):
63 | # Default value: 8080. Port number where the utserver process accepts HTTP RPC API calls to support the µTorrent-compatible HTTP interface.
64 | ut_webui_port: 5454
65 |
66 | #token_auth_enable (boolean)
67 | # Default value: true. If true, the µTorrent HTTP interface defends against cross-site request forgeries.
68 | # If false, the µTorrent HTTP interface will not be protected in this manner.
69 | token_auth_enable: false
70 |
71 | #dir_root (string):
72 | # Default value: "". If not empty, dir_active, dir_completed, and dir_torrent_files are relative to this directory.
73 | dir_root: /opt/utorrent/data
74 |
75 | #dir_active (string):
76 | # Default value: "./". Directory in which currently downloaded data is saved.
77 | # Can be an absolute path or relative to dir_root or the current working directory if dir_root is not defined or an empty string.
78 | #dir_active: /content/downloads
79 |
80 | #dir_completed (string):
81 | # Default value: "". Directory where completed downloads are stored.
82 | dir_completed:
83 |
84 | #dir_download (string):
85 | # Default value: "". Optional directory where completed downloads can be stored, instead of in dir_completed.
86 | # If no value is specified for this setting, the value of dir_completed is used.
87 | # This option can be specified multiple times in the file - once for each directory to be designated as such.
88 | # This option can be used when adding torrents via the µTorrent HTTP interface, not via the SDK interface.
89 | # Use the action list-dirs to obtain a list of download directories from the µTorrent HTTP interface.
90 | # Use the option download_dir to specify which of these directories to use when adding a torrent by URL or file through the µTorrent HTTP interface;
91 | # The index of each entry will be in order in which each entry appears in utserver.conf
92 | dir_download: /content/downloads
93 |
94 | #dir_torrent_files (string):
95 | # Default value: "". Directory where torrent files are stored. If the empty string, the value of dir_active is used.
96 | dir_torrent_files:
97 |
98 | #dir_temp_files (string):
99 | # Default value: "". Directory where temporary files are stored. If the empty string, the value of dir_active is used.
100 | # Using a separate directory just for temporary files allows for deleting the files in this directory on boot and/or periodically.
101 | # The utserver process creates temporary files with a .utt extension,
102 | # if a value for this setting is specified, the utserver process will delete all files with that extension in that directory at process startup.
103 | # The value should specify a directory, not a symbolic link to a directory.
104 | dir_temp_files:
105 |
106 | #dir_autoload (string):
107 | # Default value: "". Directory where torrent files will be recognized and auto-loaded. If the empty string, auto-load is disabled.
108 | dir_autoload: /content/downloads
109 |
110 | #dir_autoload_delete (boolean):
111 | # Default value: false. If true, torrent files in the autoload directory will be deleted after being loaded,
112 | # else they will be renamed with an extension of .loaded. The dir_autoload setting must be specified for this setting to have an effect.
113 | dir_autoload_delete: false
114 |
115 | #upnp (boolean):
116 | # Default value: true. If true, UPNP functionality for mapping ports is used by utserver. We recommend setting this value to true.
117 | upnp: true
118 |
119 | #natpmp (boolean):
120 | # Default value: true. If true, NAT-PMP functionality for mapping ports is used by utserver. We recommend setting this value to true.
121 | natpmp: true
122 |
123 | #lsd (boolean):
124 | # Default value: true. If true, Local Service Discovery is enabled. We recommend setting this value to true.
125 | lsd: true
126 |
127 | #dht (boolean):
128 | # Default value: true. If true, Distributed Hash Table extension is enabled. We recommend setting this value to true.
129 | dht: true
130 |
131 | #pex (boolean):
132 | # Default value: true. If true, Peer Exchange extension is enabled. We recommend setting this value to true.
133 | pex: true
134 |
135 | #rate_limit_local_peers (boolean):
136 | # Default value: false. If true, rate limiting also applies to communications with peers in the local subnet. We recommend setting this value to false.
137 | rate_limit_local_peers: false
138 |
139 | #disk_cache_max_size (integer):
140 | # Default value: 0. Maximum amount of memory used by each of the read, write, and piece caches. Value is in megabytes.
141 | # If 0, accepts the SDK's default choices on selecting sizes of disk caches. Maximum value is 512.
142 | disk_cache_max_size: 0
143 |
144 | #preferred_interface (string):
145 | # Default value: "". If defined, name of network interface to be preferred,
146 | # when attempting to search among network interfaces for an external IP and hardware address.
147 | # If empty string, preferred interface is ignored.
148 | preferred_interface:
149 |
150 | #admin_name (string):
151 | # Default value: "admin". If defined, name that must be supplied (along with the password) when authenticating to the server via the HTTP interface.
152 | # This allows the administrator to define an initial non-default value for this name.
153 | # This value will not be applied from utserver.conf if settings.dat already exists.
154 | admin_name: admin
155 |
156 | #admin_password (string):
157 | # Default value: "". If defined, password that must be supplied (along with the name) when authenticating to the server via the HTTP interface.
158 | # This allows the administrator to define an initial non-default value for this password.
159 | # This value will not be applied from utserver.conf if settings.dat already exists.
160 | admin_password: admin
161 |
162 | #logmask (integer):
163 | # Default value: 0. A mask whose bits when set allow certain categories of log messages to be generated.
164 | # The bits (0 - 31) in the value of this setting correspond to a set of internal events and subsystems.
165 | #
166 | # 3 - send have
167 | # 6 - hole punch
168 | # 7 - got bad piece request
169 | # 8 - trace
170 | # 9 - piece picker
171 | # 10 - got bad cancel
172 | # 11 - got bad unchoke
173 | # 12 - got bad piece
174 | # 13 - rss
175 | # 14 - rss error
176 | # 15 - got have
177 | # 16 - got bad have
178 | # 17 - error
179 | # 18 - aggregated
180 | # 19 - disconnect
181 | # 20 - out connect
182 | # 21 - in connect
183 | # 22 - UPnP
184 | # 23 - UPnP error
185 | # 24 - NATPMP
186 | # 25 - NATPMP error
187 | # 26 - metadata finish
188 | # 27 - web UI
189 | # 28 - got bad reject
190 | # 29 - pex
191 | # 30 - peer messages
192 | # 31 - blocked connect
193 | logmask: 0
194 |
195 | #dir_request (string):
196 | # Default value: "". Directory where maintenance request files will be recognized, loaded, and deleted.
197 | # If the empty string, maintenance request handling is disabled.
198 | #
199 | # Your software running on your device can create the following files in this directory in order to request the following maintenance procedures.
200 | #
201 | # If the file c.utmr is created in or moved into this directory,
202 | # the credentials necessary to access the µTorrent HTTP interface will be reset to username admin and a blank password.
203 | #
204 | # If the file wipl.utmr is created in or moved into this directory,
205 | # the IP restriction list that limits the IPs that can use the µTorrent HTTP interface is cleared,
206 | # so that there will be no restrictions on IP address.
207 | #
208 | # If the file rcf.utmr is created in or moved into this directory,
209 | # the server will reload the configuration file. If you always use this method to request a configuration file reload,
210 | # you can safely change the value of this setting while the server is running.
211 |
212 | #ut_webui_dir (string):
213 | # Default value: "". Directory where the web UI file archive webui.zip is stored,
214 | # or which contains a webui subdirectory within which the unarchived web UI files are stored.
215 | # It can be an absolute path or set relative to the current directory.
216 | ut_webui_dir:
217 |
218 | #finish_cmd (string), state_cmd (string):
219 | # Default value: "". If defined,
220 | # finish_cmd is a command that will be executed upon completion of each torrent.
221 | # state_cmd is a command that will be executed when a torrent changes state.
222 | # The command is run asynchronously as the same user that runs the server process.
223 | #
224 | # The server permits substitutions in the command text as follows:
225 | #
226 | # %F Name of downloaded data file (for single-file torrents)
227 | # %D directory where torrent data files are saved
228 | # %N torrent title
229 | # %S torrent state
230 | # %P previous state of torrent
231 | # %L label associated with torrent
232 | # %T tracker
233 | # %M status message
234 | # %I hex-encoded info-hash
235 | #
236 | # State (%S) and previous state (%P) are integers that have the following values:
237 | #
238 | # 1 (error)
239 | # 2 (checked)
240 | # 3 (paused)
241 | # 4 (super seeding)
242 | # 5 (seeding)
243 | # 6 (downloading)
244 | # 7 (super seeding (forced))
245 | # 8 (seeding (forced))
246 | # 9 (downloading (forced))
247 | # 10 (queued seed)
248 | # 11 (finished)
249 | # 12 (queued)
250 | # 13 (stopped)
251 | finish_cmd:
252 | state_cmd:
253 |
--------------------------------------------------------------------------------
/src/L3MON_DEMO.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/beiona/Google-Colab-CloudTorrent/9528113e87bd79584521d0eb4286715e48a578fb/src/L3MON_DEMO.gif
--------------------------------------------------------------------------------
/src/aria2RpcConfigSetup.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/beiona/Google-Colab-CloudTorrent/9528113e87bd79584521d0eb4286715e48a578fb/src/aria2RpcConfigSetup.gif
--------------------------------------------------------------------------------
/src/aria2cli.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/beiona/Google-Colab-CloudTorrent/9528113e87bd79584521d0eb4286715e48a578fb/src/aria2cli.png
--------------------------------------------------------------------------------
/src/cover.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/beiona/Google-Colab-CloudTorrent/9528113e87bd79584521d0eb4286715e48a578fb/src/cover.png
--------------------------------------------------------------------------------
/src/preview.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/beiona/Google-Colab-CloudTorrent/9528113e87bd79584521d0eb4286715e48a578fb/src/preview.gif
--------------------------------------------------------------------------------
/src/rclone_config_create.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/beiona/Google-Colab-CloudTorrent/9528113e87bd79584521d0eb4286715e48a578fb/src/rclone_config_create.gif
--------------------------------------------------------------------------------
/src/spotify-downloader.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/beiona/Google-Colab-CloudTorrent/9528113e87bd79584521d0eb4286715e48a578fb/src/spotify-downloader.png
--------------------------------------------------------------------------------
/src/sshPreview.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/beiona/Google-Colab-CloudTorrent/9528113e87bd79584521d0eb4286715e48a578fb/src/sshPreview.gif
--------------------------------------------------------------------------------
/src/zip.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/beiona/Google-Colab-CloudTorrent/9528113e87bd79584521d0eb4286715e48a578fb/src/zip.png
--------------------------------------------------------------------------------
/update.xml:
--------------------------------------------------------------------------------
1 |
2 | 1.3.0
3 | is now available!
4 |
5 |
--------------------------------------------------------------------------------