@@ -148,7 +148,7 @@ def format_excel(url: str, slug: str, data: dict) -> List[Union[str, date]]:
148148 The Excel problem for the given URL and data. The problem
149149 is formatted as a list of strings, where each string is a
150150 column in the Excel file. This row will have the ordering:
151- [id, title, url, date attempted, tags, neetcode , solutions, companies]
151+ [id, title, difficulty, url, date attempted, tags, video_url, short_url , solutions, companies]
152152 """
153153 row = []
154154 row .append (data ["id" ])
@@ -158,10 +158,16 @@ def format_excel(url: str, slug: str, data: dict) -> List[Union[str, date]]:
158158 row .append (date .today ())
159159 row .append (", " .join ([tag ["name" ] for tag in data ["tags" ]]))
160160 if str (data ["id" ]) in LEETCODE_TO_NEETCODE :
161- neetcode = LEETCODE_TO_NEETCODE [str (data ["id" ])]
162- row .append (neetcode ["url" ])
161+ neetcode_data = LEETCODE_TO_NEETCODE [str (data ["id" ])]
162+ # Add regular video URL
163+ video_url = neetcode_data .get ("video" , {}).get ("url" , "" )
164+ row .append (video_url )
165+ # Add shorts URL in new column
166+ short_url = neetcode_data .get ("short" , {}).get ("url" , "" )
167+ row .append (short_url )
163168 else :
164- row .append ("" )
169+ row .append ("" ) # No regular video
170+ row .append ("" ) # No short
165171 row .append (data .get ("neetcode_solution" , "" ))
166172 row .append (
167173 "\n " .join (
0 commit comments