2022-10-14 14:55:23 +00:00
|
|
|
import metadata
|
2022-10-17 12:56:32 +00:00
|
|
|
import download_links
|
2022-10-14 14:55:23 +00:00
|
|
|
|
|
|
|
|
|
|
|
def search_for_metadata(query: str):
|
|
|
|
search = metadata.Search(query=query)
|
|
|
|
|
|
|
|
print(search.options)
|
|
|
|
while True:
|
|
|
|
input_ = input("q to quit, ok to download, .. for previous options, . for current options, int for this element: ").lower()
|
|
|
|
input_.strip()
|
|
|
|
if input_ == "q":
|
|
|
|
exit(0)
|
|
|
|
if input_ == "ok":
|
|
|
|
return search
|
|
|
|
if input_ == ".":
|
|
|
|
print(search.options)
|
|
|
|
continue
|
|
|
|
if input_ == "..":
|
|
|
|
print(search.get_previous_options())
|
|
|
|
continue
|
|
|
|
if input_.isdigit():
|
|
|
|
print(search.choose(int(input_)))
|
|
|
|
continue
|
|
|
|
|
|
|
|
|
|
|
|
def cli():
|
|
|
|
search = search_for_metadata(query=input("initial query: "))
|
2022-10-17 12:24:08 +00:00
|
|
|
search.download()
|
2022-10-14 14:55:23 +00:00
|
|
|
|
2022-10-17 12:56:32 +00:00
|
|
|
download = download_links.Download()
|
|
|
|
|
2022-10-14 14:55:23 +00:00
|
|
|
|
|
|
|
if __name__ == "__main__":
|
|
|
|
cli()
|