snarfed / huffduff-video

📺 Extract the audio from videos on YouTube, Vimeo, and other sites and send it to Huffduffer.
https://huffduff-video.snarfed.org/
95 stars 6 forks source link

truncate download filenames when they're too long #5

Closed snarfed closed 9 years ago

snarfed commented 9 years ago

saw this in the wild on http://www.lightreading.com/mobile/carrier-wifi/whats-up-with-wifi/v/d-id/714374:

DownloadError: ERROR: unable to open for writing: [Errno 36] File name too long: '/tmp/http_-_c.brightcove.com_services_viewer_htmlFederatedplayerID=3639434099001_%40videoPlayer=4104889826001_playerKey=AQ%7E%7E%2CAAADPjcRqUE%7E%2CTq347XBYAnbIZWisdUFfTPqlIVJWTQel_youtubedl_smuggle=%7B%22Referer%22%3A+%22http%3A%2F%2Fwww.lightreading.com%2Fmobile%2Fcarrier-wifi%2Fwhats-up-with-wifi%2Fv%2Fd-id%2F714374%22%7D.mp4.part'

we need to truncate the download filename when it gets too long like this. may not be easy with outtmpl, but hopefully possible.