deniscerri / ytdlnis

Android Video/Audio Downloader app using yt-dlp
GNU General Public License v3.0
3.62k stars 123 forks source link

[BUG] Unable to download file. File name too long #404

Closed ksi closed 6 months ago

ksi commented 6 months ago

Some videos cannot be saves because have too long title so the app generates too long filename.

To Reproduce Try to download file: https://youtube.com/watch?v=zoF9NUpoiEU&si=Ke8LKUJBx6gQgYEo I use default command to download

(please complete the following information):

Additional context You will get an error with following log:

 -N "3" --cookies "/data/user/0/com.deniscerri.ytdl/cache/cookies.txt" --trim-filenames "202" --no-mtime --sponsorblock-remove "music_offtopic,selfpromo,preview,sponsor,intro,outro,filler,interaction" --parse-metadata "%(channel,uploader,creator,artist|null)s:%(uploader)s" --parse-metadata "%(uploader)s:%(album_artist)s" --parse-metadata "%(release_year,release_date>%Y,upload_date>%Y)s:%(meta_date)s" --parse-metadata "video:%(uploader)s:%(album_artist)s" --parse-metadata "%(album,title)s:%(meta_album)s" -x --audio-format "m4a" -P "/data/user/0/com.deniscerri.ytdl/cache/downloads/675" -S "hasaud,acodec:aac,ext:m4a" --embed-metadata --embed-thumbnail --convert-thumbnails "jpg" -o "%(uploader,channel)s - %(title)s.%(ext)s" "https://youtube.com/watch?v=zoF9NUpoiEU&si=Ke8LKUJBx6gQgYEo"

ERROR: unable to open for writing: [Errno 36] File name too long: '/data/user/0/com.deniscerri.ytdl/cache/downloads/675/Инвестиции, Экономика, Трейдинг - Кречетов. - Когда доллар по 200. Природный газ и палладий. Поднимут ли налоги? Золото. Счета под 15% годовых.m4a.part'
tusharchopra07 commented 6 months ago

just enable restrict filename from settings -> Folders -> Restrict Filenames

ksi commented 6 months ago

Yes this helped! But it removed all non-latin symbols from file name. It became: . - 200._._._15%_.m4a. I'm afraid it will corrupt files with non-latin symbols in names only. Or will make duplicates. Cannot the app just abbreviate long file names?

tusharchopra07 commented 6 months ago

try using %(title).200B in your filename template, just do not use restrict filenames

ksi commented 6 months ago

Did I make it right?

` -N "3" --cookies "/data/user/0/com.deniscerri.ytdl/cache/cookies.txt" --trim-filenames "202" --no-mtime --sponsorblock-remove "music_offtopic,selfpromo,preview,sponsor,intro,outro,filler,interaction" --parse-metadata "%(channel,uploader,creator,artist|null)s:%(uploader)s" --parse-metadata "%(uploader)s:%(album_artist)s" --parse-metadata "%(release_year,release_date>%Y,upload_date>%Y)s:%(meta_date)s" --parse-metadata "video:%(uploader)s:%(album_artist)s" --parse-metadata "%(album,title)s:%(meta_album)s" -x --audio-format "m4a" -P "/data/user/0/com.deniscerri.ytdl/cache/downloads/686" -S "hasaud,acodec:aac,ext:m4a" --embed-metadata --embed-thumbnail --convert-thumbnails "jpg" -o "%(uploader,channel)s - %(title).200B.%(ext)s" "https://www.youtube.com/watch?v=zoF9NUpoiEU"

ERROR: unable to open for writing: [Errno 36] File name too long: '/data/user/0/com.deniscerri.ytdl/cache/downloads/686/Инвестиции, Экономика, Трейдинг - Кречетов. - Когда доллар по 200. Природный газ и палладий. Поднимут ли налоги? Золото. Счета под 15% годовых.m4a.part'

`

ksi commented 6 months ago

%(uploader).30s - %(title).150s works for me. This channel has too long uploader name too. My only confusion here is: how Seal (another app based on yt-dlp) hadles it automatically? May be it worth to make some default limits in default command to avoid manual configuration?

ksi commented 6 months ago

Oh I got it. It uses %(title).200B [%(id)s].%(ext)s by default.

zaednasr commented 6 months ago

I'll try to find a way out of this so you don't have to do it manually

zaednasr commented 6 months ago

Fixed in 1.7.3