Skip to content
Snippets Groups Projects
Commit 40906944 authored by Marvin Winkens's avatar Marvin Winkens
Browse files

restructure code and add jupyter notebook

parent 698fdf54
Branches
No related tags found
No related merge requests found
fingerhuete_*/
__pycache__
.idea
.eudat-key
from rembg import remove
from webdavsync import pull, push, get_info, list_b2drop
from webdavsync import pull, push, get_info, list_b2drop, connect_webdav_b2drop
from rembg import remove as remove_bg
import os
import threading
......@@ -60,11 +60,17 @@ def push_data():
time.sleep(60) # sleep for a minute
def main():
# b2drop_list = list_b2drop()
# for el in b2drop_list:
# print(el["path"])
username = "1686b184-4d7a-45ba-8cba-4c8aef619886"
try:
f = open(".eudat-key", "r")
except OSError as e:
print(e)
print("Make sure the file .eudat-key does exist and contains your B2DROP key")
webdav_pw = f.read()
f.close()
connect_webdav_b2drop(username, webdav_pw)
t1 = threading.Thread(target=pull_data)
t2 = threading.Thread(target=process, args=(local_path_in, local_path_out))
t3 = threading.Thread(target=push_data)
......
from webdav3.client import Client
username = "1686b184-4d7a-45ba-8cba-4c8aef619886"
client: Client
def connect_webdav_b2drop(username, webdav_pw):
global client
options = {
'webdav_hostname': f"https://b2drop.eudat.eu/remote.php/dav/files/{username}",
'webdav_login': username,
'webdav_password': "CYFfS-Ff7FG-yke27-XkjTe-dWJrw",
'webdav_password': webdav_pw,
'verbose': True,
'webdav_timeout': 60 * 4, # 10 minutes
}
client = Client(options)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment