ytdl-org / youtube-dl

Command-line program to download videos from YouTube.com and other video sites
http://ytdl-org.github.io/youtube-dl/
The Unlicense
132.03k stars 10.01k forks source link

[Errno 36] File name too long #7765

Open UnveilTech opened 8 years ago

UnveilTech commented 8 years ago

Hi,

./youtube-dl --ignore-errors --no-playlist --all-formats "http://www.hardsextube.com/video/1152690/Lovely-Arabian-Muslim-Kareemah-fucked-by-Small-Four-Inch-Oriental-Arab-Dick-on-Webcam" [generic] Lovely-Arabian-Muslim-Kareemah-fucked-by-Small-Four-Inch-Oriental-Arab-Dick-on-Webcam: Requesting header WARNING: Falling back on generic information extractor. [generic] Lovely-Arabian-Muslim-Kareemah-fucked-by-Small-Four-Inch-Oriental-Arab-Dick-on-Webcam: Downloading webpage [generic] Lovely-Arabian-Muslim-Kareemah-fucked-by-Small-Four-Inch-Oriental-Arab-Dick-on-Webcam: Extracting information ERROR: unable to open for writing: [Errno 36] File name too long: 'Lovely Arabian Muslim Kareemah fucked by Small Four Inch Oriental Arab Dick on Webcam - Hardsextube-s7krq56ztqlqv0bv3bcnm5c0hht455zA5n6687k84bzc4qx3y2q84wchgbnrcj8qzvk1vtzlqkAxzA6y5qb57Aq2cw8rrkgb2t6cfvpl2blm0pcnA5A9zAgA04Ahs3kgs3tfv6ykyh6qjl92d4tzhb536036h8dn912skkd1zqq4jp1wv51y4n003vcrjgl2rjwq3n155222hkshrv5zfpx28560jwpl66jnsh7z1jj36mAjkjq9dAdzqgAm207x57bn8n05pmh68b5xq82n39kpzft8w44lj40z69sch6p98gwAghsrt8lx5vzmcd7n8mAtd3s07dc0hsxstnsk5tsq4k427y0fk95gqjqyqvs1xdhg1l00c45bf0hvtlc4.unknown_video.part'

agicquel commented 8 years ago

size doesn't matter ;)

nicolas-raoul commented 8 years ago

Probably same issue as #5908 UnveilTech, I guess you have en encrypted home folder?

Zefling commented 6 years ago

With long japanese title, I have this message:

[0.0%] 2018/06: Downloading video 1....ERROR: unable to open for writing: [Errno 36] File name too long: '\xe3\x80\x90\xe5\x85\xac\xe5\xbc\x8f\xe3\x80\x91TV\xe3\x82\xa2\xe3\x83\x8b\xe3\x83\xa1\xe3\x80\x8e\xe8\xbb\xa2\xe7\x94\x9f\xe3\x81\x97\xe3\x81\x9f\xe3\x82\x89\xe3\x82\xb9\xe3\x83\xa9\xe3\x82\xa4\xe3\x83\xa0\xe3\x81\xa0\xe3\x81\xa3\xe3\x81\x9f\xe4\xbb\xb6\xe3\x80\x8f - \xe3\x80\x8e\xe8\xbb\xa2\xe7\x94\x9f\xe3\x81\x97\xe3\x81\x9f\xe3\x82\x89\xe3\x82\xb9\xe3\x83\xa9\xe3\x82\xa4\xe3\x83\xa0\xe3\x81\xa0\xe3\x81\xa3\xe3\x81\x9f\xe4\xbb\xb6\xe3\x80\x8f2018\xe5\xb9\xb4\xe7\xa7\x8bTV\xe3\x82\xa2\xe3\x83\x8b\xe3\x83\xa1\xe6\x94\xbe\xe9\x80\x81\xe9\x96\x8b\xe5\xa7\x8b\xef\xbc\x81  \xef\xbd\x9e\xe3\x83\xaa\xe3\x83\xa0\xe3\x83\xab\xe6\xa7\x98\xe3\x81\xae\xe8\x8f\xaf\xe9\xba\x97\xe3\x81\xaa\xe3\x82\x8b\xe5\xa4\x89\xe8\xba\xab\xe3\x82\x92\xe3\x81\x94\xe8\xa6\xa7\xe3\x81\x8f\xe3\x81\xa0\xe3\x81\x95\xe3\x81\x84\xef\xbd\x9e  \xe3\x82\xb9\xe3\x83\xa9\xe3\x82\xa4\xe3\x83\xa0\xe2\x87\x94\xe4\xba\xba\xe5\x9e\x8b  \xe5\x85\xac\xe5\xbc\x8f\xe3\x82\xb5\xe3\x82\xa4\xe3\x83\x88\xef\xbc\x9ahttps -_t.co_O5x8HRa0At  \xe5\xae\xa3\xe4\xbc\x9dT #\xe8\xbb\xa2\xe3\x82\xb9\xe3\x83\xa9-1004997002927616000.mp4.part'
ERROR: unable to open for writing: [Errno 36] File name too long: '\xe3\x80\x90\xe5\x85\xac\xe5\xbc\x8f\xe3\x80\x91TV\xe3\x82\xa2\xe3\x83\x8b\xe3\x83\xa1\xe3\x80\x8e\xe8\xbb\xa2\xe7\x94\x9f\xe3\x81\x97\xe3\x81\x9f\xe3\x82\x89\xe3\x82\xb9\xe3\x83\xa9\xe3\x82\xa4\xe3\x83\xa0\xe3\x81\xa0\xe3\x81\xa3\xe3\x81\x9f\xe4\xbb\xb6\xe3\x80\x8f - \xe3\x80\x8e\xe8\xbb\xa2\xe7\x94\x9f\xe3\x81\x97\xe3\x81\x9f\xe3\x82\x89\xe3\x82\xb9\xe3\x83\xa9\xe3\x82\xa4\xe3\x83\xa0\xe3\x81\xa0\xe3\x81\xa3\xe3\x81\x9f\xe4\xbb\xb6\xe3\x80\x8f2018\xe5\xb9\xb4\xe7\xa7\x8bTV\xe3\x82\xa2\xe3\x83\x8b\xe3\x83\xa1\xe6\x94\xbe\xe9\x80\x81\xe9\x96\x8b\xe5\xa7\x8b\xef\xbc\x81  \xef\xbd\x9e\xe3\x83\xaa\xe3\x83\xa0\xe3\x83\xab\xe6\xa7\x98\xe3\x81\xae\xe8\x8f\xaf\xe9\xba\x97\xe3\x81\xaa\xe3\x82\x8b\xe5\xa4\x89\xe8\xba\xab\xe3\x82\x92\xe3\x81\x94\xe8\xa6\xa7\xe3\x81\x8f\xe3\x81\xa0\xe3\x81\x95\xe3\x81\x84\xef\xbd\x9e  \xe3\x82\xb9\xe3\x83\xa9\xe3\x82\xa4\xe3\x83\xa0\xe2\x87\x94\xe4\xba\xba\xe5\x9e\x8b  \xe5\x85\xac\xe5\xbc\x8f\xe3\x82\xb5\xe3\x82\xa4\xe3\x83\x88\xef\xbc\x9ahttps -_t.co_O5x8HRa0At  \xe5\xae\xa3\xe4\xbc\x9dT #\xe8\xbb\xa2\xe3\x82\xb9\xe3\x83\xa9-1004997002927616000.mp4.part'
[0.0%] 2018/06: Downloading video 1...ERROR: unable to open for writing: [Errno 36] File name too long: '\xe3\x80\x90\xe5\x85\xac\xe5\xbc\x8f\xe3\x80\x91TV\xe3\x82\xa2\xe3\x83\x8b\xe3\x83\xa1\xe3\x80\x8e\xe8\xbb\xa2\xe7\x94\x9f\xe3\x81\x97\xe3\x81\x9f\xe3\x82\x89\xe3\x82\xb9\xe3\x83\xa9\xe3\x82\xa4\xe3\x83\xa0\xe3\x81\xa0\xe3\x81\xa3\xe3\x81\x9f\xe4\xbb\xb6\xe3\x80\x8f - \xe3\x80\x8e\xe8\xbb\xa2\xe7\x94\x9f\xe3\x81\x97\xe3\x81\x9f\xe3\x82\x89\xe3\x82\xb9\xe3\x83\xa9\xe3\x82\xa4\xe3\x83\xa0\xe3\x81\xa0\xe3\x81\xa3\xe3\x81\x9f\xe4\xbb\xb6\xe3\x80\x8f2018\xe5\xb9\xb4\xe7\xa7\x8bTV\xe3\x82\xa2\xe3\x83\x8b\xe3\x83\xa1\xe6\x94\xbe\xe9\x80\x81\xe9\x96\x8b\xe5\xa7\x8b\xef\xbc\x81  \xef\xbd\x9e\xe3\x83\xaa\xe3\x83\xa0\xe3\x83\xab\xe6\xa7\x98\xe3\x81\xae\xe8\x8f\xaf\xe9\xba\x97\xe3\x81\xaa\xe3\x82\x8b\xe5\xa4\x89\xe8\xba\xab\xe3\x82\x92\xe3\x81\x94\xe8\xa6\xa7\xe3\x81\x8f\xe3\x81\xa0\xe3\x81\x95\xe3\x81\x84\xef\xbd\x9e  \xe3\x82\xb9\xe3\x83\xa9\xe3\x82\xa4\xe3\x83\xa0\xe2\x87\x94\xe4\xba\xba\xe5\x9e\x8b  \xe5\x85\xac\xe5\xbc\x8f\xe3\x82\xb5\xe3\x82\xa4\xe3\x83\x88\xef\xbc\x9ahttps -_t.co_O5x8HRa0At  \xe5\xae\xa3\xe4\xbc\x9dT #\xe8\xbb\xa2\xe3\x82\xb9\xe3\x83\xa9-1004997002927616000.mp4.part'
temporaryrespite commented 4 years ago

Perhaps --restrict-filenames could be changed to also handle the case when filename is too long?

$ youtube-dl --restrict-filenames https://twitter.com/OlgaKay/status/1253444538166738944
[twitter] 1253444538166738944: Downloading guest token
[twitter] 1253444538166738944: Downloading JSON metadata
[twitter] 1253444538166738944: Downloading m3u8 information
ERROR: unable to open for writing: [Errno 36] File name too long: 'Olga_Kay_-_Dear_Internet_Let_s_color_together._19_days_of_quarantine_Get_a_set_for_yourself_and_gift_one_to_a_friend_to_join_you._Tag_us_so_we_can_reshape_MooshWalksJourney_Share_it_with_other_parents_KidActivities_ColoringBook-1253444538166738944.mp4.part'

workaround is to use --id:

$ youtube-dl --id --restrict-filenames https://twitter.com/OlgaKay/status/1253444538166738944
[twitter] 1253444538166738944: Downloading guest token
[twitter] 1253444538166738944: Downloading JSON metadata
[twitter] 1253444538166738944: Downloading m3u8 information
[download] Destination: 1253444538166738944.mp4
[download] 100% of 9.61MiB in 00:00
daniells commented 4 years ago

This issue affects a large number of twitter videos as youtube-dl attempts to use the full tweet as the filename. EXT4, NTFS, and HFS support only 255 characters per filename, but the current max-tweet is 280 characters.

Truncating filenames to 255 characters (including extension) should fix "File name too long" in all conceivable use cases.