Skip to content

Commit

Permalink
add size filters
Browse files Browse the repository at this point in the history
  • Loading branch information
datawhores committed Aug 27, 2024
1 parent f5b3340 commit 068adfb
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
5 changes: 5 additions & 0 deletions ofscraper/commands/managers/db.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,11 @@ def filter_media(self) :
medias=[media for media in medias if media["unlocked"]]
elif args.locked:
medias=[media for media in medias if not media["unlocked"]]
#size
if settings.get_size_max():
medias=[media for media in medias if media["size"] <= settings.get_size_max()]
if settings.get_size_min():
medias=[media for media in medias if media["size"] >= settings.get_size_min()]
# media type
if all(element in settings.get_mediatypes() for element in ["Audios", "Videos", "Images"]):
pass
Expand Down
4 changes: 4 additions & 0 deletions ofscraper/utils/args/parse/group_bundles/db.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
)
from ofscraper.utils.args.parse.groups.media_filter import(
media_type_option,
max_size_option,
min_size_option,
media_filter_options_desc,
media_id_filter,
media_filter_options_help
Expand Down Expand Up @@ -96,6 +98,8 @@ def db_args(func):
@click.option_group(
media_filter_options_desc,
media_type_option,
max_size_option,
min_size_option,
media_id_filter,
help=media_filter_options_help
)
Expand Down

0 comments on commit 068adfb

Please sign in to comment.