[facebook] add 'loop' option (#8696)

This commit is contained in:
Mike Fährmann
2025-12-21 21:23:26 +01:00
parent 19a27a47b3
commit 375ab4084b
3 changed files with 17 additions and 0 deletions

View File

@@ -3021,6 +3021,16 @@ Note
It is possible to use ``"all"`` instead of listing all values separately.
extractor.facebook.loop
-----------------------
Type
``bool``
Default
``false``
Description
Continue when detecting a jump to a set's beginning.
extractor.facebook.videos
-------------------------
Type

View File

@@ -334,6 +334,7 @@
"author-followups": false,
"include": "photos",
"loop" : false,
"videos" : true
},
"fanbox":

View File

@@ -306,6 +306,12 @@ class FacebookExtractor(Extractor):
"Detected a loop in the set, it's likely finished. "
"Extraction is over."
)
elif int(photo["next_photo_id"]) > int(photo["id"]) + i*120:
self.log.info(
"Detected jump to the beginning of the set. (%s -> %s)",
photo["id"], photo["next_photo_id"])
if self.config("loop", False):
all_photo_ids.append(photo["next_photo_id"])
else:
all_photo_ids.append(photo["next_photo_id"])