Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upGitHub is where the world builds software
Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world.
So im attempting to download a playlist and when i have download set to True it downloads a file with the name of the video's id but with 'webm' appended to it and with the file extension '.f248' ("6GJO_RpBnEgwebm.f248") another file with the same name is downloaded but with the extension '.f251' ("6GJO_RpBnEgwebm.f251") and finally before returning an error it merges the 2 files into "6GJO_RpBnEgwebm.webm"
I am using this code:
import youtube_dl
ytdl = youtube_dl.YoutubeDL({'outtmpl': '%(id)s%(ext)s'})
ytdl.extract_info("https://www.youtube.com/watch?v=6GJO_RpBnEg&index=1&list=PLZlppmGv_GIKfcd4t6odoAB9a7aUBMBZi", download=True)
And this is the full log from when i run it:
[youtube:playlist] Downloading playlist PLZlppmGv_GIKfcd4t6odoAB9a7aUBMBZi - add --no-playlist to just download video 6GJO_RpBnEg
[youtube:playlist] PLZlppmGv_GIKfcd4t6odoAB9a7aUBMBZi: Downloading webpage
[download] Downloading playlist: Life Is Strange
[youtube:playlist] playlist Life Is Strange: Downloading 15 videos
[download] Downloading video 1 of 15
[youtube] 6GJO_RpBnEg: Downloading webpage
[youtube] 6GJO_RpBnEg: Downloading video info webpage
[youtube] 6GJO_RpBnEg: Extracting video information
[youtube] 6GJO_RpBnEg: Downloading MPD manifest
[download] 6GJO_RpBnEgwebm.f248 has already been downloaded
[download] 100% of 11.43MiB
[download] 6GJO_RpBnEgwebm.f251 has already been downloaded
[download] 100% of 6.54MiB
[ffmpeg] Merging formats into "6GJO_RpBnEgwebm.webm"
ERROR: Could not write header for output file #0 (incorrect codec parameters ?): Error number -22 occurred
Traceback (most recent call last):
File "C:\Users\adam\AppData\Local\Programs\Python\Python36-32\lib\site-packages\youtube_dl\YoutubeDL.py", line 2031, in post_process
files_to_delete, info = pp.run(info)
File "C:\Users\adam\AppData\Local\Programs\Python\Python36-32\lib\site-packages\youtube_dl\postprocessor\ffmpeg.py", line 479, in run
self.run_ffmpeg_multiple_files(info['__files_to_merge'], temp_filename, args)
File "C:\Users\adam\AppData\Local\Programs\Python\Python36-32\lib\site-packages\youtube_dl\postprocessor\ffmpeg.py", line 204, in run_ffmpeg_multiple_files
raise FFmpegPostProcessorError(msg)
youtube_dl.postprocessor.ffmpeg.FFmpegPostProcessorError: Could not write header for output file #0 (incorrect codec parameters ?): Error number -22 occurred
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Users\adam\Desktop\Programs\YouTube_MusicDownloader\Main.py", line 5, in
ytdl.extract_info("https://www.youtube.com/watch?v=6GJO_RpBnEg&index=1&list=PLZlppmGv_GIKfcd4t6odoAB9a7aUBMBZi", download=True)
File "C:\Users\adam\AppData\Local\Programs\Python\Python36-32\lib\site-packages\youtube_dl\YoutubeDL.py", line 795, in extract_info
return self.process_ie_result(ie_result, download, extra_info)
File "C:\Users\adam\AppData\Local\Programs\Python\Python36-32\lib\site-packages\youtube_dl\YoutubeDL.py", line 991, in process_ie_result
extra_info=extra)
File "C:\Users\adam\AppData\Local\Programs\Python\Python36-32\lib\site-packages\youtube_dl\YoutubeDL.py", line 856, in process_ie_result
extra_info=extra_info)
File "C:\Users\adam\AppData\Local\Programs\Python\Python36-32\lib\site-packages\youtube_dl\YoutubeDL.py", line 795, in extract_info
return self.process_ie_result(ie_result, download, extra_info)
File "C:\Users\adam\AppData\Local\Programs\Python\Python36-32\lib\site-packages\youtube_dl\YoutubeDL.py", line 849, in process_ie_result
return self.process_video_result(ie_result, download=download)
File "C:\Users\adam\AppData\Local\Programs\Python\Python36-32\lib\site-packages\youtube_dl\YoutubeDL.py", line 1619, in process_video_result
self.process_info(new_info)
File "C:\Users\adam\AppData\Local\Programs\Python\Python36-32\lib\site-packages\youtube_dl\YoutubeDL.py", line 1966, in process_info
self.post_process(filename, info_dict)
File "C:\Users\adam\AppData\Local\Programs\Python\Python36-32\lib\site-packages\youtube_dl\YoutubeDL.py", line 2033, in post_process
self.report_error(e.msg)
File "C:\Users\adam\AppData\Local\Programs\Python\Python36-32\lib\site-packages\youtube_dl\YoutubeDL.py", line 612, in report_error
self.trouble(error_message, tb)
File "C:\Users\adam\AppData\Local\Programs\Python\Python36-32\lib\site-packages\youtube_dl\YoutubeDL.py", line 582, in trouble
raise DownloadError(message, exc_info)
youtube_dl.utils.DownloadError: ERROR: Could not write header for output file #0 (incorrect codec parameters ?): Error number -22 occurred