mirror of
https://github.com/robweber/xbmcbackup.git
synced 2024-12-22 14:05:23 +01:00
commit
d3ed0bc63c
@ -47,8 +47,8 @@
|
||||
<string id="30052">Writing file</string>
|
||||
<string id="30053">Starting scheduled backup</string>
|
||||
<string id="30054">Removing backup</string>
|
||||
<string id="30056">Check log for Dropbox authorize URL</string>
|
||||
<string id="30057">Click OK when authorized</string>
|
||||
<string id="30056">Go to this URL to authorize</string>
|
||||
<string id="30057">Click OK AFTER completion</string>
|
||||
<string id="30058">Dropbox Developer Code Needed</string>
|
||||
<string id="30059">Visit https://www.dropbox.com/developers</string>
|
||||
<string id="30060">Enable Scheduler</string>
|
||||
@ -93,4 +93,6 @@
|
||||
<string id="30099">Open Settings</string>
|
||||
<string id="30100">Extracting Archive</string>
|
||||
<string id="30101">Error extracting the zip archive</string>
|
||||
<string id="30102">Click OK to enter code</string>
|
||||
<string id="30103">Google Drive Validation Code</string>
|
||||
</strings>
|
||||
|
11
resources/lib/tinyurl.py
Normal file
11
resources/lib/tinyurl.py
Normal file
@ -0,0 +1,11 @@
|
||||
import urllib2
|
||||
|
||||
#this is duplicated in snipppets of code from all over the web, credit to no one
|
||||
#in particular - to all those that have gone before me!
|
||||
def shorten(aUrl):
|
||||
tinyurl = 'http://tinyurl.com/api-create.php?url='
|
||||
req = urllib2.urlopen(tinyurl + aUrl)
|
||||
data = req.read()
|
||||
|
||||
#should be a tiny url
|
||||
return str(data)
|
@ -1,4 +1,5 @@
|
||||
import utils as utils
|
||||
import tinyurl as tinyurl
|
||||
import xbmc
|
||||
import xbmcvfs
|
||||
import xbmcgui
|
||||
@ -135,14 +136,14 @@ class DropboxFileSystem(Vfs):
|
||||
user_token_key,user_token_secret = self.getToken()
|
||||
|
||||
sess = session.DropboxSession(self.APP_KEY,self.APP_SECRET,"app_folder")
|
||||
utils.log("token:" + user_token_key + ":" + user_token_secret)
|
||||
|
||||
if(user_token_key == '' and user_token_secret == ''):
|
||||
token = sess.obtain_request_token()
|
||||
url = sess.build_authorize_url(token)
|
||||
|
||||
#print url in log
|
||||
utils.log("Authorize URL: " + url)
|
||||
xbmcgui.Dialog().ok(utils.getString(30010),utils.getString(30056),utils.getString(30057))
|
||||
xbmcgui.Dialog().ok(utils.getString(30010),utils.getString(30056),utils.getString(30057),tinyurl.shorten(url))
|
||||
|
||||
#if user authorized this will work
|
||||
user_token = sess.obtain_access_token(token)
|
||||
@ -304,7 +305,8 @@ class GoogleDriveFilesystem(Vfs):
|
||||
|
||||
utils.log("Google Drive Authorize URL: " + drive_url)
|
||||
|
||||
code = xbmcgui.Dialog().input('Google Drive Validation Code','Input the Validation code after authorizing this app')
|
||||
xbmcgui.Dialog().ok(utils.getString(30010),utils.getString(30056),utils.getString(30102),tinyurl.shorten(drive_url))
|
||||
code = xbmcgui.Dialog().input(utils.getString(30103))
|
||||
|
||||
gauth.Auth(code)
|
||||
gauth.SaveCredentialsFile(xbmc.validatePath(xbmc.translatePath(utils.data_dir() + 'google_drive.dat')))
|
||||
|
Loading…
Reference in New Issue
Block a user