mirror of
https://github.com/nexus-stc/hyperboria
synced 2024-12-02 16:02:53 +01:00
43be16e4bc
- [nexus] Remove outdated protos - [nexus] Development - [nexus] Development - [nexus] Development - [nexus] Development - [nexus] Development - [nexus] Refactor views - [nexus] Update aiosumma - [nexus] Add tags - [nexus] Development - [nexus] Update repository - [nexus] Update repository - [nexus] Update dependencies - [nexus] Update dependencies - [nexus] Fixes for MetaAPI - [nexus] Support for new queries - [nexus] Adopt new versions of search - [nexus] Improving Nexus - [nexus] Various fixes - [nexus] Add profile - [nexus] Fixes for ingestion - [nexus] Refactorings and bugfixes - [idm] Add profile methods - [nexus] Fix stalled nexus-meta bugs - [nexus] Various bugfixes - [nexus] Restore IDM API functionality GitOrigin-RevId: a0842345a6dde5b321279ab5510a50c0def0e71a
41 lines
1.2 KiB
Python
41 lines
1.2 KiB
Python
from typing import (
|
|
Dict,
|
|
List,
|
|
Optional,
|
|
)
|
|
|
|
from nexus.pylon.network_agent import NetworkAgent
|
|
from nexus.pylon.prepared_request import PreparedRequest
|
|
from nexus.pylon.proxy_manager import ProxyManager
|
|
from nexus.pylon.validators.base import BaseValidator
|
|
from utils.izihawa_utils.importlib import import_object
|
|
|
|
|
|
class BaseDriver(NetworkAgent):
|
|
def __init__(
|
|
self,
|
|
validator=None,
|
|
downloads_directory: str = '/downloads',
|
|
proxy_list: Optional[List] = None,
|
|
proxy_manager: Optional[ProxyManager] = None,
|
|
):
|
|
super().__init__(proxy_list=proxy_list, proxy_manager=proxy_manager)
|
|
|
|
validator_cls = 'nexus.pylon.validators.PdfValidator'
|
|
if validator and 'class' in validator:
|
|
validator_cls = validator['class']
|
|
validator_cls = import_object(validator_cls)
|
|
|
|
self.validator = validator_cls or BaseValidator
|
|
self.downloads_directory = downloads_directory
|
|
|
|
def __str__(self):
|
|
return self.__class__.__name__
|
|
|
|
async def execute_prepared_file_request(
|
|
self,
|
|
prepared_file_request: PreparedRequest,
|
|
params: Dict,
|
|
):
|
|
raise NotImplementedError()
|