@@ -42,6 +42,12 @@ def parse_args() -> argparse.Namespace:
42
42
help = "Get at most this many problems (decrease if leetcode API times out)" ,
43
43
default = 1000 ,
44
44
)
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
+ )
45
51
parser .add_argument (
46
52
"--output-file" ,
47
53
type = str ,
@@ -103,7 +109,7 @@ async def generate_anki_note(
103
109
)
104
110
105
111
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 :
107
113
"""
108
114
Generate an Anki deck
109
115
"""
@@ -170,7 +176,7 @@ async def generate(start: int, stop: int, page_size: int, output_file: str) -> N
170
176
)
171
177
leetcode_deck = genanki .Deck (LEETCODE_ANKI_DECK_ID , Path (output_file ).stem )
172
178
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 )
174
180
175
181
note_generators : List [Coroutine [Any , Any , LeetcodeNote ]] = []
176
182
@@ -198,8 +204,8 @@ async def main() -> None:
198
204
"""
199
205
args = parse_args ()
200
206
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 )
203
209
204
210
205
211
if __name__ == "__main__" :
0 commit comments