Newsboat: Download in podboat fails because filename is too long

Created on 1 Oct 2020  Â·  3Comments  Â·  Source: newsboat/newsboat

Newsboat version (copy the output of newsboat -v or the first line of git show):

newsboat 2.21.0 - https://newsboat.org/
Copyright (C) 2006-2015 Andreas Krennmair
Copyright (C) 2015-2020 Alexander Batischev
Copyright (C) 2006-2017 Newsbeuter contributors
Copyright (C) 2017-2020 Newsboat contributors

Newsboat is free software licensed under the MIT License. (Type `newsboat -vv' to see the full text.)
It bundles:
- JSON for Modern C++ library, licensed under the MIT License: https://github.com/nlohmann/json
- optional-lite library, licensed under the Boost Software License: https://github.com/martinmoene/optional-lite
- expected-lite library, licensed under the Boost Software License: https://github.com/martinmoene/expected-lite

newsboat 2.21.0
System: Linux 5.4.0-48-generic (x86_64)
Compiler: g++ 9.3.0
ncurses: ncurses 6.2.20200212 (compiled with 6.2)
libcurl: libcurl/7.68.0 GnuTLS/3.6.13 zlib/1.2.11 brotli/1.0.7 libidn2/2.3.0 libpsl/0.21.0 (+libidn2/2.2.0) libssh/0.9.3/openssl/zlib nghttp2/1.40.0 librtmp/2.3 (compiled with 7.68.0)
SQLite: 3.31.1 (compiled with 3.31.1)
libxml2: compiled with 2.9.10

Config file (copy from ~/.newsboat/config or ~/.config/newsboat/config):

download-path "/home/edgar/Podcasts/%n"
podlist-format "%t %T %N %4i [%6dMB/%6tMB] [%5p %%] [%7k kb/s] %-20S -> %F"
download-filename-format "%N-%F - %t.%e"

Steps to reproduce the issue:

  1. With just the following feed : https://feeds.backtracks.fm/indiehackers/indie-hackers-podcast/feed.xml

  2. When enqueuing the podcast #174, From Millions in Revenue to Staring Bankruptcy in the Face with Aline Lerner of Interviewing.io.mp3

  3. Then opening podboat to download the file

I get the status "failed" for the download.

From my investigation, this happens because the filename is too long for the system. ie I can reproduce the same issue if I try to do :

touch 'The Indie Hackers Podcast-2020-07-09 #174 – From Millions in Revenue to Staring Bankruptcy in the Face with Aline Lerner of Interviewing.io.mp3'

Ideally, I would be able to change the name of the file when such a failure occurs manually.

It could also be possible to drop characters at the end until the write succeeds.

What do you think ?

bug podboat

Most helpful comment

Just so that you know, the limitation on my system is 140 characters because the folder is in an encrypted ecryptfs partition : https://unix.stackexchange.com/a/32834

You might not be able to reproduce on an unencrypted fs, since usually the limit is higher (255 characters).

All 3 comments

At least showing the reason for the error would be better than to just mark the status as failed.

Thank you for the report! Podboat doesn't get as much developer attention as Newsboat proper, so I have no idea if/when this would be fixed. PRs welcome!

Ideally, I would be able to change the name of the file when such a failure occurs manually. It could also be possible to drop characters at the end until the write succeeds.

Either approach sound acceptable to me. I leave the decision to whoever wants to implement this.

Note though that Podboat operates on a full path, not just a filename. If shortening the filename is not enough, it might be necessary to shorten the names of intermediate directories as well. (Hint, hint: Rust has handy Path and PathBuf types that make writing this sort of code easier than in C++; so consider putting the "meat" of the algorithm into the libnewsboat crate.)

At least showing the reason for the error would be better than to just mark the status as failed.

Definitely. This enhancement doesn't depend on manual/automatic renaming, so I turned it into #1209 — perhaps it'll be implemented sooner then.

Just so that you know, the limitation on my system is 140 characters because the folder is in an encrypted ecryptfs partition : https://unix.stackexchange.com/a/32834

You might not be able to reproduce on an unencrypted fs, since usually the limit is higher (255 characters).

Was this page helpful?
0 / 5 - 0 ratings