File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed
Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -157,6 +157,11 @@ def sync_playlist(client, playlist_id):
157157
158158def main ():
159159 arg_parser = argparse .ArgumentParser ()
160+ arg_parser .add_argument (
161+ "browser_data_dir" ,
162+ help = "Browser user data directory" ,
163+ type = Path ,
164+ )
160165 subparsers = arg_parser .add_subparsers (dest = "command" , required = True )
161166 subparsers .add_parser (
162167 "download-library" ,
@@ -179,9 +184,7 @@ def main():
179184
180185 with sync_playwright () as p :
181186 browser = p .chromium .launch_persistent_context (
182- # Must not be Default.
183- # TODO: Load from CLI.
184- user_data_dir = "/home/lubo/.config/google-chrome/Profile 13" ,
187+ user_data_dir = args .browser_data_dir ,
185188 executable_path = shutil .which ("google-chrome-stable" ),
186189 args = [
187190 # Required for Google authentication.
@@ -196,7 +199,7 @@ def main():
196199 with page .expect_response (
197200 lambda response : (
198201 response .request .method == "POST"
199- and urlsplit (response .url )[0 :3 ]
202+ and urlsplit (response .url )[:3 ]
200203 == ("https" , "music.youtube.com" , "/youtubei/v1/browse" )
201204 ),
202205 timeout = PLATWRIGHT_TIMEOUT ,
You can’t perform that action at this time.
0 commit comments