Skip to content

Commit

Permalink
[twitter] Fix stop before real end (#573)
Browse files Browse the repository at this point in the history
* [twitter] Fix stop before real end

Fix for #544. Makes sure that it really reached the end by checking that both "min_position" is null and "has_more_items" is false before stopping.

* [twitter] Fix stop before real end (update)
  • Loading branch information
alice945 authored and mikf committed Jan 14, 2020
1 parent 8bb32ee commit f498a90
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions gallery_dl/extractor/twitter.py
Original file line number Diff line number Diff line change
Expand Up @@ -230,9 +230,12 @@ def _tweets_from_api(self, url, max_position=None):
for tweet in text.extract_iter(
data["items_html"], '<div class="tweet ', '\n</li>'):
yield tweet

if not data["has_more_items"]:
return

if data.get("min_position") is None:
if data["has_more_items"] and "min_position" not in data:
pass
else:
return

if "min_position" in data:
position = data["min_position"]
Expand Down

0 comments on commit f498a90

Please sign in to comment.