diff --git a/commands/pygg.py b/commands/pygg.py index 893e797..08a7825 100644 --- a/commands/pygg.py +++ b/commands/pygg.py @@ -82,7 +82,7 @@ def get_files(id): return len(trs) -def search_ygg(query, multi): +def search_ygg(query, multi, full): ygg_params = { "name": query, "description": "", @@ -95,6 +95,9 @@ def search_ygg(query, multi): "sort": "publish_date", } + if full and args.year: + ygg_params["name"] += f" {args.year}" + if multi: ygg_params["option_langue:multiple[]"] = "4" @@ -164,11 +167,19 @@ fra = ( ) -search_ygg(args.query, True) -search_ygg(fra, True) -search_ygg(eng, True) -search_ygg(args.query, False) -search_ygg(fra, False) -search_ygg(eng, False) +search_ygg(args.query, True, True) +search_ygg(fra, True, True) +search_ygg(eng, True, True) +search_ygg(args.query, False, True) +search_ygg(fra, False, True) +search_ygg(eng, False, True) + +if args.year: + search_ygg(args.query, True, False) + search_ygg(fra, True, False) + search_ygg(eng, True, False) + search_ygg(args.query, False, False) + search_ygg(fra, False, False) + search_ygg(eng, False, False) print("No results :(")