22 lines
410 B
Python
22 lines
410 B
Python
import logging
|
|
import typing
|
|
from pathlib import Path
|
|
|
|
logger = logging.getLogger(__name__)
|
|
|
|
|
|
Payload = typing.TypedDict(
|
|
"Payload",
|
|
{
|
|
"gid": str,
|
|
"num_files": int,
|
|
"path": str,
|
|
"files": list[typing.TypedDict("File", {"path": str, "size": int})],
|
|
},
|
|
)
|
|
|
|
|
|
def main(payload: Payload):
|
|
logging.info("got {torrent}", torrent=payload)
|
|
path = Path(payload["path"])
|