@@ -42,6 +42,12 @@ def parse_args() -> argparse.Namespace:
4242 help = "Get at most this many problems (decrease if leetcode API times out)" ,
4343 default = 1000 ,
4444 )
45+ parser .add_argument (
46+ "--list-id" ,
47+ type = str ,
48+ help = "Get all questions from a specific list id (https://leetcode.com/list?selectedList=<list_id>" ,
49+ default = "" ,
50+ )
4551 parser .add_argument (
4652 "--output-file" ,
4753 type = str ,
@@ -103,7 +109,7 @@ async def generate_anki_note(
103109 )
104110
105111
106- async def generate (start : int , stop : int , page_size : int , output_file : str ) -> None :
112+ async def generate (start : int , stop : int , page_size : int , list_id : str , output_file : str ) -> None :
107113 """
108114 Generate an Anki deck
109115 """
@@ -170,7 +176,7 @@ async def generate(start: int, stop: int, page_size: int, output_file: str) -> N
170176 )
171177 leetcode_deck = genanki .Deck (LEETCODE_ANKI_DECK_ID , Path (output_file ).stem )
172178
173- leetcode_data = leetcode_anki .helpers .leetcode .LeetcodeData (start , stop , page_size )
179+ leetcode_data = leetcode_anki .helpers .leetcode .LeetcodeData (start , stop , page_size , list_id )
174180
175181 note_generators : List [Coroutine [Any , Any , LeetcodeNote ]] = []
176182
@@ -198,8 +204,8 @@ async def main() -> None:
198204 """
199205 args = parse_args ()
200206
201- start , stop , page_size , output_file = args .start , args .stop , args .page_size , args .output_file
202- await generate (start , stop , page_size , output_file )
207+ start , stop , page_size , list_id , output_file = args .start , args .stop , args .page_size , args . list_id , args .output_file
208+ await generate (start , stop , page_size , list_id , output_file )
203209
204210
205211if __name__ == "__main__" :
0 commit comments