coursera-dl / edx-dl

A simple tool to download video lectures from edx.org (and other openedx sites)
GNU Lesser General Public License v3.0
1.92k stars 638 forks source link

ERROR: cannot download videos when local path is too long #597

Open walterzielony opened 4 years ago

walterzielony commented 4 years ago

Problems with download of youtuve videos. Stack:

[download] https://youtube.com/watch?v=kv47JO-xEcs => Downloaded\Product_Management_with_Lean_Agile_and_System_Design_Thinking\02-Part_I-_Product_Management_ABC D-_Analytics_Business_Model_CoordinationDesign_Thinking\01-%(title)s-%(id)s.%(ext)s Downloading video with URL https://youtube.com/watch?v=kv47JO-xEcs from YouTube. [youtube] kv47JO-xEcs: Downloading webpage [youtube] kv47JO-xEcs: Downloading video info webpage ERROR: unable to open for writing: [Errno 2] No such file or directory: 'Downloaded\Product_Management_with_Lean_Agile_and_System_Design_Thinking\02-Part_I-_P roduct_Management_ABCD-_Analytics_Business_Model_Coordination__Design_Thinking\01-QD503x - P111 - Part Introduction - Product Management ABCD-kv47JO-xEcs.mp4.p art' Traceback (most recent call last): File "c:\program files (x86)\python37-32\lib\runpy.py", line 193, in _run_module_as_main "main", mod_spec) File "c:\program files (x86)\python37-32\lib\runpy.py", line 85, in _run_code exec(code, run_globals) File "C:\Program Files (x86)\Python37-32\Scripts\edx-dl.exe\main.py", line 7, in File "c:\program files (x86)\python37-32\lib\site-packages\edx_dl\edx_dl.py", line 1073, in main download(args, selections, filtered_units, headers) File "c:\program files (x86)\python37-32\lib\site-packages\edx_dl\edx_dl.py", line 850, in download headers) File "c:\program files (x86)\python37-32\lib\site-packages\edx_dl\edx_dl.py", line 812, in download_unit headers) File "c:\program files (x86)\python37-32\lib\site-packages\edx_dl\edx_dl.py", line 794, in download_video skip_or_download(youtube_downloads, headers, args) File "c:\program files (x86)\python37-32\lib\site-packages\edx_dl\edx_dl.py", line 781, in skip_or_download f(url, filename, headers, args) File "c:\program files (x86)\python37-32\lib\site-packages\edx_dl\edx_dl.py", line 707, in download_url download_youtube_url(url, filename, headers, args) File "c:\program files (x86)\python37-32\lib\site-packages\edx_dl\edx_dl.py", line 754, in download_youtube_url execute_command(cmd, args) File "c:\program files (x86)\python37-32\lib\site-packages\edx_dl\utils.py", line 42, in execute_command raise e File "c:\program files (x86)\python37-32\lib\site-packages\edx_dl\utils.py", line 37, in execute_command subprocess.check_call(cmd) File "c:\program files (x86)\python37-32\lib\subprocess.py", line 341, in check_call raise CalledProcessError(retcode, cmd) subprocess.CalledProcessError: Command '['youtube-dl', '--ignore-config', '-o', 'Downloaded\Product_Management_with_Lean_Agile_and_System_Design_Thinking\02-P art_I-_Product_Management_ABCD-_Analytics_Business_Model_CoordinationDesign_Thinking\01-%(title)s-%(id)s.%(ext)s', '-f', 'mp4', 'https://youtube.com/watch?v= kv47JO-xEcs']' returned non-zero exit status 1.

walterzielony commented 4 years ago

Apparently it's a problem with the long paths. We need a fix for this ASAP !

hillierdani commented 4 years ago

Thanks a lot, I am also encountering the same for https://courses.edx.org/courses/course-v1:NewcastleX+NHI101x+1T2020/course/

Lezrith commented 4 years ago

This is a Windows specific issue. It can be resolved by enabling long paths in NTFS https://docs.microsoft.com/en-us/windows/win32/fileio/naming-a-file#enable-long-paths-in-windows-10-version-1607-and-later