Created
May 24, 2020 16:08
-
-
Save JoeThunyathep/5293f3bbdb87840b67aa027b4ee0b4d0 to your computer and use it in GitHub Desktop.
Generate direct download link from OneDrive
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import base64 | |
def create_onedrive_directdownload (onedrive_link): | |
data_bytes64 = base64.b64encode(bytes(onedrive_link, 'utf-8')) | |
data_bytes64_String = data_bytes64.decode('utf-8').replace('/','_').replace('+','-').rstrip("=") | |
resultUrl = f"https://api.onedrive.com/v1.0/shares/u!{data_bytes64_String}/root/content" | |
return resultUrl |
same here, the code wont work
The code won't work for me
the code won't work for me too
It works for me, link was shared as publicly available.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The code won't work for me. It gives me a Error 400: Bad Request