Open ALEERQUESON2DIAS opened 5 years ago
Thanks -
To answer your questions:
The auth JSON does not need to be updated every time - only when th access_token
expired, during which a new access_token
shall be retrieved by refresh_token
.
I will need to reproduce this issue but currently I've lost access to my Onedrive so this make take longer than expected.
However, from the error message you provided I can only assume that somehow Onedrive did not send a content-length
header, which will be used to estimate the file size. Honestly I have no idea why Onedrive would have such a weird behaviour - and I will try my best to look into that.
Yours,
Thanks a lot for your fast response and your notes.
My knowledge of python and the authorization environment in microsfot are very small. I have written a program very similar to yours to access GoogleDrive. In this program, when I launch any request, the xxx.json file itself that accompanies the command is automatically refreshed.
It would be so kind to tell me how I can force that so it never expires. I dont know how to do retrieve a new refresh_token.
Thank you
a cordial greeting
Angel (ALQS2D)
Thanks a lot. I will investigate this
Thanks a lot
Regards
Ángel-ALQS2D
Hello,
My knowledge of Python, and specially V3, is not good. I have located the "def refresh_token(client):" section in the source but I do not see how to execute it and then save the session in each call in the .json file.
Is it necessary to modify any of the source and rebuild the executable?
Can it be achieved by some parameter in the ONEDRIVECMD call?
Thank you
Best regards
Ángel (ALQS2D)
You do not need to save any session information since all the API calls are stateless.
If you want to save the json you can refer to the do login logic, where json shall be generated upon first login.
ALEERQUESON2DIAS notifications@github.com于2019年1月13日 周日上午1:46写道:
Hello,
My knowledge of Python, and specially V3, is not good. I have located the "def refresh_token(client):" section in the source but I do not see how to execute it and then save the session in each call in the .json file.
Is it necessary to modify any of the source and rebuild the executable?
Can it be achieved by some parameter in the ONEDRIVECMD call?
Thank you
Best regards
Ángel (ALQS2D)
— You are receiving this because you commented.
Reply to this email directly, view it on GitHub https://github.com/cnbeining/onedrivecmd/issues/36#issuecomment-453806726, or mute the thread https://github.com/notifications/unsubscribe-auth/ABfRgq9Ug-GqFkcLgrSWOV9-t3JSXKiWks5vCtY9gaJpZM4Z8zyy .
I don't know if my knowledge is correct but in the .json file there is an expiration date with 0 days ( expires_at": 1547320508, wich is 12-jan-2019 20:15:08 , ). If this date is not updated on each call, after 90 days will fail and it will be necessary obtain it again. It is possible that it is in error but in the two previous years it has worked for me that way. My proposal is that ONEDRIVECMD will be executed on a different computer (laptop of my wife or children) in which there is no python neither "init process" has been executed, so they need to use the json file generated on my desktop. Thank you Best regards
Hello all:
I have managed to make changes to the source of the program so that the session saved ".json" file is refreshed and saved each time and I have also solved the problem of downloading "Nontype" files, which was due to not obtain the size and therefore causing problems in the treatment of the download advance bar.
I have also managed to have an additional parameter indicating the directory of the PC where to leave the downloaded file when using the option GET.
Now all my efforts will be dedicated to package ONEDRIVECMD into an executable (.exe) using Pyinstaller so that it will be usable in other PCs that do not have Python installed.
Thank you very much for the program and for the comments.
Sincerely
Ángel (ALQS2D)
First of all my gratitude for this magnificent tool that perfectly fulfills the function that I am looking for. And excuse my english, i hope you could understand me.
There are three issues that I can not clarify...
1) The authorizations file (.json) is not automatically updated on each call, as in other platforms like GoogleDrive. Is there any way to keep or get one with the updated token for next calls?
2) Conventional files (like .txt o .pdf) are uploaded or downloaded perfectly. But in case of nontype files, this is a file without extension, they show an error. Is there any solution for doing this?
3) I would need to have an executable of type .exe build by Pyinstaller to be able to migrate an unique executable file to other family computers where I do not have python installed. Is that possible?
Many thanks
a cordial greeting
Ángel (ALQS2D)
ERROR SHOWED WHEN DOWNLOAD FILES WITHOUT EXTENSIONS
C:\Users\ANGEL>onedrivecmd -conf A:/ODCMD/.onedrive.json get od:/ALQS2D/DAT/11A7QC7iEY39i72t Traceback (most recent call last): File "C:\Python372\Scripts\onedrivecmd-script.py", line 11, in
load_entry_point('OnedriveCMD==0.1.6', 'console_scripts', 'onedrivecmd')()
File "c:\python372\lib\site-packages\onedrivecmd\onedrivecmd.py", line 61, in main
do_get(client, args)
File "c:\python372\lib\site-packages\onedrivecmd\utils\actions.py", line 203, in do_get
total_length = int(r.headers.get('content-length'))
TypeError: int() argument must be a string, a bytes-like object or a number, not 'NoneType'