1: Add a parameter to specify whether to download GIFs. 2: Resolve errors when downloading GIFs.#51
Open
wohaoeRiver wants to merge 1 commit intodeepghs:mainfrom
Open
1: Add a parameter to specify whether to download GIFs. 2: Resolve errors when downloading GIFs.#51wohaoeRiver wants to merge 1 commit intodeepghs:mainfrom
wohaoeRiver wants to merge 1 commit intodeepghs:mainfrom
Conversation
…d gif when downloading images. 2:TemporaryDirectory ignore cleanup errors in _make_gif_for_ugoira (The TemporaryDirectory needs to be manually cleared after it is enabled)
narugo1992
requested changes
Mar 9, 2024
| self.type = type | ||
| self.filter = filter | ||
| self.req_auth = req_auth | ||
| self.download_gif = download_gif |
Contributor
There was a problem hiding this comment.
better to pass this value at __init__
| self.filter = filter | ||
| self.date = date | ||
| self.req_auth = req_auth | ||
| self.download_gif = download_gif |
Contributor
There was a problem hiding this comment.
the same, better to pass it at __init__.
| self.end_date = end_date | ||
| self.filter = filter | ||
| self.req_auth = req_auth | ||
| self.download_gif = download_gif |
Contributor
There was a problem hiding this comment.
better to pass it at __init__
| class BasePixivSource(WebDataSource): | ||
| def __init__(self, group_name: str = 'pixiv', select: _SelectTyping = 'large', | ||
| no_ai: bool = False, refresh_token: Optional[str] = None, download_silent: bool = True): | ||
| no_ai: bool = False, refresh_token: Optional[str] = None, download_silent: bool = True, download_gif: bool = True): |
Contributor
There was a problem hiding this comment.
consider using name download_ugoira instead of download_gif?
| 'url': zip_url, | ||
| } | ||
| yield f'{illust["id"]}', gif_image, meta | ||
| if self.download_gif: |
Contributor
There was a problem hiding this comment.
i think maybe it's better to give use a selection, like:
- download gif image
- dont download gif, but download the seperated images, and rename each of them
- just ignore all the ugoiras
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
1: Add a download_gif parameter to the PixivSource, allowing to choose whether to download GIFs when using any of the three download methods provided by Pixiv. true indicates download, flase indicates no download

2:In the
_make_gif_for_ugoirafunction, adding theignore_cleanup_errors=Trueparameter toTemporaryDirectory(defaulting toFalse) aims to ignore errors that occur during the cleanup of the temporary directory, such as files being in use by other programs and unable to be deleted, thus avoiding raising exceptions. However, this approach may result in files generated during git downloads in the temporary directory not being deleted automatically, requiring manual deletion. [On the issues page, I found that someone raised this question in 23 years, and I read his reply, but I still don't understand the reason for this question UwU. Perhaps in the official version, it's better not to modify theignore_cleanup_errorsparameter ofTemporaryDirectory, and instead let the users experiencing the problem modifyignore_cleanup_errorstoTrueand manually delete the files in the temporary directory?### ]