How to configure a OneDrive file for use with wget



  • Right click file and choose embed

    bcdd3f11-35ff-4361-982f-ebbd9652bfb1-image.png

    Click Generate

    578ab148-5446-492b-85e9-2614a0ff4f43-image.png

    Copy embed code and extract out URL

    56efda91-751b-469b-aef5-9e215e58662b-image.png

    Change embed to download in URL
    a3395933-7878-4448-aae5-b8780ce06799-image.png

    Now create your command using wget

    
    wget --no-check-certificate "https://onedrive.live.com/download?cid=E7B1244EB32C92BE&resid=E7B1244EB32C92BE%214342&authkey=AM2GkZym39m6oB4" 
    
    

    Now rename file to original name and delete garbage name

    cp download\?cid\=E7B1244EB32C92BE\&resid\=E7B1244EB32C92BE\!4342\&authkey\=AM2GkZym39m6oB4 testfile.txt
    rm download\?cid\=E7B1244EB32C92BE\&resid\=E7B1244EB32C92BE\!4342\&authkey\=AM2GkZym39m6oB4 
    
    


  • Added extra step of renaming file and deleting long garbage file name.