2024-04-21 21:57:16 +02:00
|
|
|
import moviepy as mp
|
|
|
|
|
|
|
|
|
|
from abc import abstractmethod
|
|
|
|
|
|
|
|
|
|
from ..BaseEngine import BaseEngine
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class BaseStockImageEngine(BaseEngine):
|
|
|
|
|
"""
|
|
|
|
|
The base class for all Stock Image engines.
|
|
|
|
|
"""
|
|
|
|
|
|
|
|
|
|
@abstractmethod
|
2024-05-17 11:26:45 +02:00
|
|
|
def get(self, query: str, start: float, end: float, i="") -> mp.ImageClip:
|
2024-04-21 21:57:16 +02:00
|
|
|
"""
|
|
|
|
|
Get a stock image based on a query.
|
|
|
|
|
|
|
|
|
|
Args:
|
|
|
|
|
query (str): The query to search for.
|
|
|
|
|
start (float): The starting time of the video clip.
|
|
|
|
|
end (float): The ending time of the video clip.
|
2024-05-17 11:18:28 +02:00
|
|
|
i (str): Unique identifier for the image, mandatory if running concurrently.
|
2024-04-21 21:57:16 +02:00
|
|
|
|
|
|
|
|
Returns:
|
|
|
|
|
str: The path to the saved image.
|
|
|
|
|
"""
|
|
|
|
|
...
|