altlinux-autorepacked/autorepacked/providers/rustdesk/__init__.py
2024-01-16 17:32:13 +03:00

32 lines
767 B
Python

import subprocess
from autorepacked.base_provider import BaseProvider
class RustdeskProvider(BaseProvider):
_name = 'rustdesk'
_release_url = 'https://github.com/rustdesk/rustdesk/releases'
_release_file = '[0-9]/rustdesk-[0-9].[0-9].[0-9].deb'
def get_download_url(self):
url = subprocess.run(
args=[
'epm',
'--silent',
'tool',
'eget',
'--list',
'--latest',
'--get-real-url',
self._release_url,
self._release_file,
],
stdout=subprocess.PIPE
).stdout.decode('utf-8')
return url
def get_provider(config):
return RustdeskProvider(config)