Create facebook dropin - working for images + text. CAVEAT: only gets the first ~100 chars of the post at the moment

This commit is contained in:
Patrick Robertson
2025-02-25 11:44:35 +00:00
parent 5211c5de18
commit f8e846d59a
5 changed files with 110 additions and 23 deletions

View File

@@ -1,3 +1,4 @@
from typing import Type
from yt_dlp.extractor.common import InfoExtractor
from auto_archiver.core.metadata import Metadata
from auto_archiver.core.extractor import Extractor
@@ -23,6 +24,8 @@ class GenericDropin:
"""
extractor: Type[Extractor] = None
def extract_post(self, url: str, ie_instance: InfoExtractor):
"""
This method should return the post data from the url.
@@ -55,4 +58,11 @@ class GenericDropin:
"""
This method should download any additional media from the post.
"""
return metadata
return metadata
def is_suitable(self, url, info_extractor: InfoExtractor):
"""
Used to override the InfoExtractor's 'is_suitable' method. Dropins should override this method to return True if the url is suitable for the extractor
(based on being able to parse other URLs)
"""
return False