[facebook] add 'loop' option (#8696)
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -334,6 +334,7 @@
|
||||
|
||||
"author-followups": false,
|
||||
"include": "photos",
|
||||
"loop" : false,
|
||||
"videos" : true
|
||||
},
|
||||
"fanbox":
|
||||
|
||||
@@ -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"])
|
||||
|
||||
|
||||
Reference in New Issue
Block a user