I am using threading to download,convert videos and delete it. However, when I use threading, it gives me an error AssertionError: group argument must be None for now
Threading worked fine until 3 runs before but it is suddenly showing this error.
I thought the group argument was default None but I just added 'group = None' into the parameter. Now it shows an error saying TypeError: __init__() got multiple values for argument 'group'
def video_download(parent_file, url):
#checking if it succeed or not for logging
fail = []
success = []
#which number in the list the program is in
check = 1
#check if the url is playlist or single video
if url.find("list") != -1:
pl = Playlist(url)
links = pl.parse_links()
#length of list
total = len(links)
print("\n start download")
for l in links:
t1 = threading.Thread(l,target= download_multi, group = None, args=(l,check,parent_file,success,fail,total))
t1.start()
time.sleep(1)
t2 = threading.Thread(target= download_multi, group = None, args=(l,check,parent_file,success,fail,total))
t2.start()
time.sleep(1)
t3 = threading.Thread(target= download_multi, group = None, args=(l,check,parent_file,success,fail,total))
t3.start()
time.sleep(1)
t1.join()
t2.join()
t3.join()
Error code without group = None
File "C:\Program Files\JetBrains\PyCharm Community Edition 2019.2\helpers\pydev\pydevd.py", line 2060, in <module>
main()
File "C:\Program Files\JetBrains\PyCharm Community Edition 2019.2\helpers\pydev\pydevd.py", line 2054, in main
globals = debugger.run(setup['file'], None, None, is_module)
File "C:\Program Files\JetBrains\PyCharm Community Edition 2019.2\helpers\pydev\pydevd.py", line 1405, in run
return self._exec(is_module, entry_point_fn, module_name, file, globals, locals)
File "C:\Program Files\JetBrains\PyCharm Community Edition 2019.2\helpers\pydev\pydevd.py", line 1412, in _exec
pydev_imports.execfile(file, globals, locals) # execute the script
File "C:\Program Files\JetBrains\PyCharm Community Edition 2019.2\helpers\pydev\_pydev_imps\_pydev_execfile.py", line 18, in execfile
exec(compile(contents+"\n", file, 'exec'), glob, loc)
File "C:/Users/paulm/Desktop/Github/git/YoutubeDownloader/main.py", line 179, in <module>
recieve_input()
File "C:/Users/paulm/Desktop/Github/git/YoutubeDownloader/main.py", line 37, in recieve_input
video_download(parent_file, url)
File "C:/Users/paulm/Desktop/Github/git/YoutubeDownloader/main.py", line 102, in video_download
t1 = threading.Thread(l,target= download_multi, args=(l,check,parent_file,success,fail,total))
File "C:\Users\paulm\AppData\Local\Programs\Python\Python37-32\lib\threading.py", line 786, in __init__
assert group is None, "group argument must be None for now"
AssertionError: group argument must be None for now
Error code with group = None
Traceback (most recent call last):
File "C:/Users/paulm/Desktop/Github/git/YoutubeDownloader/main.py", line 179, in <module>
recieve_input()
File "C:/Users/paulm/Desktop/Github/git/YoutubeDownloader/main.py", line 37, in recieve_input
video_download(parent_file, url)
File "C:/Users/paulm/Desktop/Github/git/YoutubeDownloader/main.py", line 102, in video_download
t1 = threading.Thread(l,target= download_multi, group = None, args=(l,check,parent_file,success,fail,total))
TypeError: __init__() got multiple values for argument 'group'
Problem solved. The first thread had an typo and after fixing that it worked perfectly.
the t1 = threading.Thread(l,target=
line is not consistent with t2 and t3
the extra l
was wrongly taken as the default value for group arg
typo?