Skip to content

Commit

Permalink
add unlocked and lock
Browse files Browse the repository at this point in the history
  • Loading branch information
datawhores committed Aug 27, 2024
1 parent 4392643 commit f5b3340
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
6 changes: 6 additions & 0 deletions ofscraper/commands/managers/db.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,11 +86,17 @@ def filter_media(self) :
medias=[media for media in medias if media["downloaded"]]
elif args.not_downloaded:
medias=[media for media in medias if not media["downloaded"]]
#unlocked
if args.unlocked:
medias=[media for media in medias if media["unlocked"]]
elif args.locked:
medias=[media for media in medias if not media["unlocked"]]
# media type
if all(element in settings.get_mediatypes() for element in ["Audios", "Videos", "Images"]):
pass
else:
medias=[media for media in medias if media["media_type"] in settings.get_mediatypes()]
#id filters
if args.post_id:
medias=[media for media in medias if media["post_id"] in args.post_id]
if args.media_id:
Expand Down
17 changes: 17 additions & 0 deletions ofscraper/utils/args/parse/group_bundles/db.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,23 @@ def db_args(func):
is_flag=True,
default=False
))
@click.constraints.mutually_exclusive(
click.option(
"-ul",
"--unlocked",
"unlocked",
is_flag=True,
default=False
),
click.option(
"-l",
"--locked",
"locked",
is_flag=True,
default=False
))
@program_options
@logging_options
Expand Down

0 comments on commit f5b3340

Please sign in to comment.