@@ -187,6 +187,17 @@ def load_yaml_list(filenames_list):
187187def local_addon_path ():
188188 return addon_path (* LOCAL_NAME .split ('/' ))
189189
190+ def google_wget_str (gid ):
191+ str = 'wget --load-cookies /tmp/cookies.txt ' + \
192+ '"https://docs.google.com/uc?export=download&confirm=' + \
193+ '$(wget --quiet --save-cookies /tmp/cookies.txt ' + \
194+ '--keep-session-cookies --no-check-certificate ' + \
195+ '\' https://docs.google.com/uc?export=download&id=%s\' ' % gid + \
196+ ' -O- | sed -rn \' s/.*confirm=([0-9: A-Za-z_]+)' + \
197+ '.*/\1 \n /p\' )&id=%s" -O .tmp.zip && rm -rf ' % gid + \
198+ '/tmp/cookies.txt'
199+ return str
200+
190201
191202def install_addon (name ):
192203 url , repo_user , repo_name , name = _parse_name (name )
@@ -246,7 +257,14 @@ def install_addon(name):
246257 'remote_target' not in state [name ] or
247258 state [name ]['remote_target' ] != target ):
248259 print ("\t Remote content is new. Fetching ..." )
249- if (run ('wget "%s" -O ".tmp.zip"' % remote , ** {
260+ # Hacky google drive download check and command
261+ # Should find better long-term storage after CloudStor
262+ if 'google' in remote :
263+ gid = re .search ('/d/(.*)/view' , remote ).group (1 )
264+ wget_str = google_wget_str (gid )
265+ else :
266+ wget_str = 'wget "%s" -O ".tmp.zip"' % remote
267+ if (run (wget_str , ** {
250268 ** cmd_args , 'stdout' : None ,
251269 'stderr' : None
252270 }).returncode != 0 ):
0 commit comments