INNER CODE UNIT · Python

download

LiuChangFreeman/OneIndexServerless · Serverless/main.py:176

def download():
    id = request.args.get("id")
    if id:
        path='me/drive/items/{}'.format(id)
        url = base_url + path
        access_token = token["access_token"]
        headers = {
            "Authorization": "bearer {}".format(access_token),
            "Content-Type": "application/json"
        }
        data = requests.get(url, headers=headers).json()
        if not "folder" in data:
            url_download=data["@microsoft.graph.downloadUrl"]
            return redirect(url_download)

@app.before_request
def before(*args,**kwargs):
    global token

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…