diff --git a/apkdroid.py b/apkdroid.py index a8c68e6..d3c6b76 100644 --- a/apkdroid.py +++ b/apkdroid.py @@ -3,6 +3,13 @@ import logging import re import os import shutil +import webdav.client as wc + +davoptions = { + 'webdav_hostname': "https://fdroid.lsd.cat", + 'webdav_login': "login", + 'webdav_password': "password" +} repo_url = "https://fdroid.lsd.cat" repo_name = "lsd.cat Proprietary Apps Repo" @@ -80,8 +87,17 @@ def check_env(repo): def build(repo): os.system('fdroid update -c') +def publish(repo, davoptions): + client = wc.Client(davoptions) + files = [f for f in os.listdir('.') if os.path.isfile(f)] + for file in files: + client.upload_sync(remote_path="/" + file, local_path=file) -check_env(repo) -for i in urls: - get_apk(i) -build(repo) \ No newline at end of file +def main(): + check_env(repo) + for url in urls: + get_apk(url) + build(repo) + publish(repo, davoptions) + +main() \ No newline at end of file