mirror of
https://github.com/instaloader/instaloader.git
synced 2026-10-17 06:02:18 -07:00
Compare commits
5
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
21d10a7f3e | ||
|
|
c7d3e8dc0e | ||
|
|
0c143b6121 | ||
|
|
b806153ab6 | ||
|
|
247bddcc9f |
@@ -963,6 +963,11 @@ class Instaloader:
|
||||
.. versionchanged:: 4.3
|
||||
Also downloads and saves the Highlight's cover pictures.
|
||||
|
||||
.. versionchanged:: 4.16
|
||||
Add progress output for highlight retrieval, displaying a counter of the current
|
||||
highlight number and the total number of highlights being processed. This provides
|
||||
feedback similar to the per-item download counter already present in this function.
|
||||
|
||||
:param user: ID or Profile of the user whose highlights should get downloaded.
|
||||
:param fast_update: If true, abort when first already-downloaded picture is encountered
|
||||
:param filename_target: Replacement for {target} in dirname_pattern and filename_pattern
|
||||
@@ -970,14 +975,20 @@ class Instaloader:
|
||||
:param storyitem_filter: function(storyitem), which returns True if given StoryItem should be downloaded
|
||||
:raises LoginRequiredException: If called without being logged in.
|
||||
"""
|
||||
for user_highlight in self.get_highlights(user):
|
||||
user_highlights = list(self.get_highlights(user))
|
||||
hl_size = len(user_highlights)
|
||||
for hl_number, user_highlight in enumerate(user_highlights, start=1):
|
||||
name = user_highlight.owner_username
|
||||
highlight_target: Union[str, Path] = (filename_target
|
||||
if filename_target
|
||||
else (Path(_PostPathFormatter.sanitize_path(name, self.sanitize_paths)) /
|
||||
_PostPathFormatter.sanitize_path(user_highlight.title,
|
||||
self.sanitize_paths)))
|
||||
self.context.log("Retrieving highlights \"{}\" from profile {}".format(user_highlight.title, name))
|
||||
self.context.log(
|
||||
"[{0:{w}d}/{1:{w}d}] Retrieving highlights \"{2}\" from profile {3}".format(
|
||||
hl_number, hl_size, user_highlight.title, name, w=len(str(hl_size))
|
||||
)
|
||||
)
|
||||
self.download_highlight_cover(user_highlight, highlight_target)
|
||||
totalcount = user_highlight.itemcount
|
||||
count = 1
|
||||
|
||||
Reference in New Issue
Block a user