Commit c0251030 authored by Cody Zacharias's avatar Cody Zacharias

Add --images, --videos, --media options

parent bc167049
...@@ -176,6 +176,9 @@ def options(): ...@@ -176,6 +176,9 @@ def options():
ap.add_argument("-iu", "--index-users", help="Custom Elasticsearch Index name for Users.") ap.add_argument("-iu", "--index-users", help="Custom Elasticsearch Index name for Users.")
ap.add_argument("--debug", help="Store information in debug logs", action="store_true") ap.add_argument("--debug", help="Store information in debug logs", action="store_true")
ap.add_argument("--resume", help="Resume from Tweet ID.") ap.add_argument("--resume", help="Resume from Tweet ID.")
ap.add_argument("--videos", help="Display only Tweets with videos.")
ap.add_argument("--images", help="Display only Tweets with images.")
ap.add_argument("--media", help="Display Tweets with only images or videos.")
args = ap.parse_args() args = ap.parse_args()
return args return args
......
...@@ -43,3 +43,6 @@ class Config: ...@@ -43,3 +43,6 @@ class Config:
Index_users = "twintUser" Index_users = "twintUser"
Debug = False Debug = False
Resume = None Resume = None
Images = False
Videos = False
Media = False
...@@ -80,5 +80,11 @@ async def Search(config, init): ...@@ -80,5 +80,11 @@ async def Search(config, init):
config.Near = config.Near.replace(" ", "%20") config.Near = config.Near.replace(" ", "%20")
config.Near = config.Near.replace(",", "%2C") config.Near = config.Near.replace(",", "%2C")
url += f"%20near%3A%22{config.Near}%22" url += f"%20near%3A%22{config.Near}%22"
if config.Images:
url += f"%20filter%3Aimages"
if config.Videos:
url += f"%20filter%3Avideos"
if config.Media:
url += f"%20filter%3Amedia"
return url return url
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment