#!/usr/bin/env python3 from flask import Flask, redirect import requests app = Flask(__name__) def get_files(uuid, password): r = requests.get( "https://www.odrive.com/rest/weblink/list_folder", params={"weblinkUri": f"/{uuid}", "password": password}, ) print(r.url) return dict( (item["name"], item["downloadUrl"]) for item in r.json()["data"]["items"] ) @app.route("/") def help(): return """
Fill the two fields with the UUID (the
part after https://www.odrive.com/s/) and the access password. You
will be redirected to the proxied directory listing. Point rclone
at that URL and it should be able to download the files
(rclone copy --http-url "YOUR_URL_HERE" :http:
remote:bucket
).
' for name, url in get_files(uuid, password).items(): res += f'{name}\n' res += "" return res @app.route("/