I finally had a chance to dig into this a bit further, and devised a more permanent fix (see the gist, below).

If you have been experiencing ‘Cannot write’ errors when trying to download Twitter videos with youtube-dl, it could be due to the number of characters in the tweet. Twitter now allows 280 characters per tweet, while many file systems have a 255-character limit for filenames.

There is a simple patch to fix this issue, as follows: