andreafabrizi / Dropbox-Uploader

Dropbox Uploader is a BASH script which can be used to upload, download, list or delete files from Dropbox, an online file sharing, synchronization and backup service.
https://www.andreafabrizi.it/2016/01/01/Dropbox-Uploader/
GNU General Public License v3.0
6.56k stars 1.08k forks source link

missing OAUTH_REFRESH_TOKEN #525

Open Dusan308a opened 3 years ago

Dusan308a commented 3 years ago

I have followed the procedure for generating new App_key, App_secret and Access_code within Dropbox after ticking the tickmarks in the Permissions section. I have copied these on the first run of the dropbox_uploader.sh and confirmed the entry since all three of them looked OK when ECHOed back to the console. However, the line in the "dropbox_uploader" file with OAUTH_REFRESH_TOKEN remains empty after this. Could someone suggest what I did wrong? Thanks! Dusan

gmcinalli commented 3 years ago

@Dusan308a I can confirm this, just write your refresh token directly into the config file and you're good to go.

Dusan308a commented 3 years ago

Hi, Thanks for the fast response. However, I still have problems, Dropbox will not let me in. I long have a Dropbox account, and I have just these days created a connected App as specified at your site, and I can see it in Dropbox personal account. I have obtained the AppKey, AppSecret and Access token (mine is significantly longer than the one shown at your internet page and has 137 charasters starting with "sl.A"). I have tick-marked options for this connected app on the "permissions" page of the Dropbox setup.I have a folder on Dropbox to use for this purpose and it is shared (I think not needed really). I run the 'dropbox_uploader' for the first time, and it asks me on the above keyword, which I enter. It asks me to confirm the entered keys, and I confirm with "y". When I go and view the file '.dropbox_uploader' the fourth line with "OAUTH_REFRESH_TOKEN=" remains empty; nothing is written after the "=" and when I run the ' dropbox_uploader ' again I get the message "Error loading data from ...." and "It is recommended to run ... unlink". If I manually copy the Access token into this lline of the ".dropbox_uploader", and run the './dropbox_uploader.sh list /', the response changes to "> Listing "/"...FAILED" and "Some error occured. ....", and 'the du_resp' file reads "Error in call to API function "files/list_folder": Invalid authorization value in HTTP header "Authorization": "Bearer". Expecting "Bearer "." I am sorry to bother you again since I am sure I made a silly beginner's mistake somewhere. However, I would be grateful for help. Dušan

On Sun, Jan 31, 2021 at 5:37 PM Gian Marco Cinalli notifications@github.com wrote:

@Dusan308a https://github.com/Dusan308a I can confirm this, just write your refresh token directly into the config file and you're good to go.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/andreafabrizi/Dropbox-Uploader/issues/525#issuecomment-770409858, or unsubscribe https://github.com/notifications/unsubscribe-auth/ASUES3VSV66ZV656HAFAXTDS4WBKXANCNFSM4WXCEBUA .

lpadula commented 3 years ago

I have exactly the same problem, and it's driving me crazy! Have you found a solution?

Dusan308a commented 3 years ago

Hi No, I do not have the solution. I am new with Raspberry Pi, Linux and JS and was kind of hoping for some help. I have read a low of stuff these past days and I suspect something was changed from Dropbox side, and that Andrea suggestions do not work any more; please correct me if I made a wrong assumption. The Dropbox page Andrea mentioned has changed, and suggests the use of something called DBX platform. Also, the page to select the kind of access differs from the one Andrea showed,, and the length of the key-code so I am in doubt. I have read the Dropbox page https://www.dropbox.com/developers, and have selected here to get to https://www.dropbox.com/developers/documentation?_tk=pilot_lp&_ad=altcta1&_camp=docs with detailed explanation of the drivers to install from Dropbox site to access the Dropbox from different applications, ald langueges, including JS. I will try those instructions instead, but expect sirious problems due to my lack of knowledge. Good luck! Dusan

On Mon, Feb 8, 2021 at 12:42 AM Leandro Padula notifications@github.com wrote:

I have exactly the same problem, and it's driving me crazy! Have you find a solution?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/andreafabrizi/Dropbox-Uploader/issues/525#issuecomment-774789948, or unsubscribe https://github.com/notifications/unsubscribe-auth/ASUES3UD6KAGDQVYQCWABATS54QM3ANCNFSM4WXCEBUA .

telemaxx commented 3 years ago

i have just tested that and can confirm this. after .dropbox_uploader was created i checked it and the fourth line was OK. than I entered the "list" command and got the error. now the fourth line was empty.

so I removed ".dropbox_uploader" and started the script and entered the api keys stuff again.

before using the list command i copied the .dropbox_uploader file to have a backup.

now I tried directly uploading a file and it worked. not sure why.

Dusan308a commented 3 years ago

Hi I gave up the Dropbox-Uploader since I was unable to make it work on my Raspberry Pi zero W. After dozens of (different) trys I always got the same result, that is the empty fourth line. I must be doing something wrong, but cannot figure out what, and yes, it is frustrating. I did, however, managed to upload/download/list files from my dropbox account using "rclone" as decribed at " https://www.thedigitalpictureframe.com/how-to-finally-access-dropbox-on-your-raspberry-pi-using-rclone/". Everything worked on first attempt, and I am going to proceed with this software. Thanks for all suggestions! Regards, Dusan

On Mon, Feb 8, 2021 at 7:07 PM Thomas Th. notifications@github.com wrote:

i have just tested that and can confirm this. after .dropbox_uploader was created i checked it and the fourth line was OK. than I entered the "list" command and got the error. now the fourth line was empty.

so I removed ".dropbox_uploader" and started the script and entered the api keys stuff again.

before using the list command i copied the .dropbox_uploader file to have a backup.

now I tried directly uploading a file and it worked. not sure why.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/andreafabrizi/Dropbox-Uploader/issues/525#issuecomment-775336591, or unsubscribe https://github.com/notifications/unsubscribe-auth/ASUES3X3ZRJPMZYHDNGM4O3S6AR4TANCNFSM4WXCEBUA .

telemaxx commented 3 years ago

rclone seems to be interesting. as dropbox-uploader is not really maintained anymore, it is good to an alternative.

tjluoma commented 3 years ago

FYI - As much as I like/enjoy/respect dropbox_uploader. I have to say that rclone seems to have this token situation handled much better. I was able to get rclone setup very quickly, and it's handling the token issue seamlessly.

diggidre commented 3 years ago

i have just tested that and can confirm this. after .dropbox_uploader was created i checked it and the fourth line was OK. than I entered the "list" command and got the error. now the fourth line was empty.

so I removed ".dropbox_uploader" and started the script and entered the api keys stuff again.

before using the list command i copied the .dropbox_uploader file to have a backup.

now I tried directly uploading a file and it worked. not sure why.

I can confirm. At first clean install the .dropbox_uploader file is partly empty. After deleting it and running the dropbox_uploader.sh again the .dropbox_uploader config was filled correctly. During second time setup I generated a new Refresh-Token... Im not sure if this does matter. Then after second setup the file uploading was fixed.

9.4.21 EDIT: Getting dropbox-uploader up and running seems a bit of luck. On one docker container linking will work as described above and on another container it fails everytime. Now I switched to rclone. But its a bit tricky on raspbian because of missing browser if headless. Rclone workaround: First set up the remote (link rclone with your dropbox) on another machine with gui and browser. Copy then the generated rclone config file to your raspbian where rclone is installed to /root/.config/rclone directory... voila

barbalex commented 3 years ago

Yep, rclone seems great. Check https://rclone.org/remote_setup/ for setup in a headless box and https://rclone.org/docs/#copying-single-files to copy single files