mirror of
https://github.com/ytdl-org/youtube-dl.git
synced 2024-11-21 17:51:51 +00:00
Find max path length on current system
Needed for https://github.com/ytdl-org/youtube-dl/issues/29912
This commit is contained in:
parent
c5098961b0
commit
8172e74caf
1 changed files with 13 additions and 0 deletions
|
@ -2,5 +2,18 @@
|
|||
|
||||
import youtube_dl
|
||||
|
||||
import os
|
||||
|
||||
MAX_LENGTH = 0
|
||||
|
||||
for i in range(1000):
|
||||
try:
|
||||
os.stat('a' * i)
|
||||
except FileNotFoundError:
|
||||
pass
|
||||
except OSError:
|
||||
MAX_LENGTH = i - 1
|
||||
break
|
||||
|
||||
if __name__ == '__main__':
|
||||
youtube_dl.main()
|
||||
|
|
Loading…
Reference in a new issue