mirror of
https://github.com/mikf/gallery-dl.git
synced 2024-11-25 04:02:32 +01:00
[twitter] allow disabling 'cursor' output (#5990)
This commit is contained in:
parent
78ae0ba9f7
commit
c0668f5106
@ -3985,6 +3985,26 @@ Description
|
||||
* ``"cookies"``: Use token given by the ``ct0`` cookie if present.
|
||||
|
||||
|
||||
extractor.twitter.cursor
|
||||
------------------------
|
||||
Type
|
||||
* ``bool``
|
||||
* ``string``
|
||||
Default
|
||||
``true``
|
||||
Example
|
||||
``"1/DAABCgABGVKi5lE___oKAAIYbfYNcxrQLggAAwAAAAIAAA"``
|
||||
Description
|
||||
Controls from which position to start the extraction process from.
|
||||
|
||||
* ``true``: Start from the beginning.
|
||||
Log the most recent ``cursor`` value when interrupted before reaching the end.
|
||||
* ``false``: Start from the beginning.
|
||||
* any ``string``: Start from the position defined by this value.
|
||||
|
||||
Note: A ``cursor`` value from one timeline cannot be used with another.
|
||||
|
||||
|
||||
extractor.twitter.expand
|
||||
------------------------
|
||||
Type
|
||||
|
@ -504,7 +504,11 @@ class TwitterExtractor(Extractor):
|
||||
}
|
||||
|
||||
def _init_cursor(self):
|
||||
return self.config("cursor") or None
|
||||
cursor = self.config("cursor", True)
|
||||
if not cursor:
|
||||
self._update_cursor = util.identity
|
||||
elif isinstance(cursor, str):
|
||||
return cursor
|
||||
|
||||
def _update_cursor(self, cursor):
|
||||
self.log.debug("Cursor: %s", cursor)
|
||||
@ -590,9 +594,16 @@ class TwitterTimelineExtractor(TwitterExtractor):
|
||||
return cursor
|
||||
|
||||
def tweets(self):
|
||||
self._cursor = cursor = self.config("cursor") or None
|
||||
reset = False
|
||||
|
||||
cursor = self.config("cursor", True)
|
||||
if not cursor:
|
||||
self._update_cursor = util.identity
|
||||
elif isinstance(cursor, str):
|
||||
self._cursor = cursor
|
||||
else:
|
||||
cursor = None
|
||||
|
||||
if cursor:
|
||||
state = cursor.partition("/")[0]
|
||||
state, _, tweet_id = state.partition("_")
|
||||
|
Loading…
Reference in New Issue
Block a user