BitcasaFileLister icon indicating copy to clipboard operation
BitcasaFileLister copied to clipboard

access token and oauth

Open skeeve42 opened this issue 12 years ago • 8 comments

Storing permanent token US1_blahblahblahblah user@myvps:/BitcasaFileLister/python$ python getfiles.py /blahblahblah /mnt/Images Please retrive an access token using the following command. python getfiles.py --oauth user@myvps:/BitcasaFileLister/python$

Am I missing something? It accepted my permanent token but wants me to get a new one when I try transfer files.

skeeve42 avatar Nov 09 '14 10:11 skeeve42

What do you do exactly?

ghost avatar Nov 09 '14 10:11 ghost

Is there token.ini?

ekoekoazarak avatar Nov 09 '14 15:11 ekoekoazarak

I do not see a token.ini anywhere.

user@myvps:/BitcasaFileLister/python$ ls bitcasa getfiles.py logger.py logger.pyc threads.py utils.py utils.pyc user@myvps:/BitcasaFileLister/python$ cd bitcasa user@myvps:/BitcasaFileLister/python/bitcasa$ ls init.py client.py exception.py filesystem.py version.py init.pyc client.pyc exception.pyc filesystem.pyc version.pyc user@myvps:/BitcasaFileLister/python/bitcasa$

skeeve42 avatar Nov 10 '14 05:11 skeeve42

check chmod on the folder /BitcasaFileLister/python

--settoken writes token.ini to store the token for you.

ghost avatar Nov 10 '14 05:11 ghost

Ok, yes, I see it now. So I do the following:

user@myvps:/BitcasaFileLister/python$ sudo python getfiles.py --oauth https://developer.api.bitcasa.com/v1/oauth2/authenticate?redirect=https%3A%2F%2F rose-llc.com%2Fbitcasafilelist%2F&client_id=something user@myvps:/BitcasaFileLister/python$ sudo python getfiles.py --settoken US1_longrandomletternumberstring Storing permanent token US1_longrandomletternumberstring user@myvps:/BitcasaFileLister/python$

And I'm on the hosted rose-llc.com filelister. What is my next step? I assume I log into Bitcasa FileLister (towards the bottom of the page) to see my files paths, right?

Then I log into Bitcasa through a develper.api portal I get this error in the window: An error Occured Drive RootInvalid response code object(BitcasaException)#4 (7) { ["message":protected]=> string(21) "Invalid response code" ["string":"Exception":private]=> string(0) "" ["code":protected]=> int(429) ["file":protected]=> string(74) "/home/roseweb/http/hosts/bitcasafilelist/bitcasa-sdk-php/BitcasaClient.php" ["line":protected]=> int(803) ["trace":"Exception":private]=> array(3) { [0]=> array(6) { ["file"]=> string(74) "/home/roseweb/http/hosts/bitcasafilelist/bitcasa-sdk-php/BitcasaClient.php" ["line"]=> int(476) ["function"]=> string(8) "http_get" ["class"]=> string(13) "BitcasaClient" ["type"]=> string(2) "->" ["args"]=> array(2) { [0]=> string(9) "/folders/" [1]=> array(0) { } } } [1]=> array(6) { ["file"]=> string(74) "/home/roseweb/http/hosts/bitcasafilelist/bitcasa-sdk-php/BitcasaClient.php" ["line"]=> int(436) ["function"]=> string(12) "doListFolder" ["class"]=> string(13) "BitcasaClient" ["type"]=> string(2) "->" ["args"]=> array(1) { [0]=> string(1) "/" } } [2]=> array(6) { ["file"]=> string(50) "/home/roseweb/http/hosts/bitcasafilelist/files.php" ["line"]=> int(132) ["function"]=> string(17) "getFolderFromPath" ["class"]=> string(13) "BitcasaClient" ["type"]=> string(2) "->" ["args"]=> array(1) { [0]=> string(1) "/" } } } ["previous":"Exception":private]=> NULL }

skeeve42 avatar Nov 10 '14 05:11 skeeve42

Retry to access rose-llc - that may be caused by overloaded api. After some retries it works...

ghost avatar Nov 10 '14 06:11 ghost

Ok, refreshing the page worked after a while. I then ran python getfiles.py /longstringoflettersandnumbers /mnt/location and it does appear to be doing what it should. Will the command I used also transfer all the subfolders of that main folder?

edit: It appears to be transferring all the nested folders.

skeeve42 avatar Nov 10 '14 06:11 skeeve42

Thanks for your help!

skeeve42 avatar Nov 10 '14 06:11 skeeve42