diff --git a/docs/configuration.rst b/docs/configuration.rst index ca41bef3..afd7a0e1 100644 --- a/docs/configuration.rst +++ b/docs/configuration.rst @@ -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 diff --git a/docs/gallery-dl.conf b/docs/gallery-dl.conf index 36bb7113..93ce1aa8 100644 --- a/docs/gallery-dl.conf +++ b/docs/gallery-dl.conf @@ -334,6 +334,7 @@ "author-followups": false, "include": "photos", + "loop" : false, "videos" : true }, "fanbox": diff --git a/gallery_dl/extractor/facebook.py b/gallery_dl/extractor/facebook.py index 5d56a5fc..bedf45c1 100644 --- a/gallery_dl/extractor/facebook.py +++ b/gallery_dl/extractor/facebook.py @@ -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"])