SamTV12345 / PodFetch

A sleek and efficient podcast downloader.
https://samtv12345.github.io/PodFetch
Apache License 2.0
347 stars 25 forks source link

Directory name with duplicated single/double quotes #335

Closed bastgau closed 1 month ago

bastgau commented 1 year ago

Describe the bug

Hello.

Sorry, I found three new bugs related to the episode downloads.

1/ For the following feed : https://feeds.libsyn.com/126127/rss, the directory name containing the episodes contain additional single quote. It seems that the issue is existing for some other podcasts when the episode title containing one or somes space characters.

The name seems to be correct for the podcasts.

Example :

$ ls -la
drwxr-xr-x  2 root root 4096 Sep 21 21:34 "'Gaijinsan - Episode 35'"
drwxr-xr-x  2 root root 4096 Sep 21 21:33 "'Gaijinsan - Episode 36'"
drwxr-xr-x  2 root root 4096 Sep 21 21:33 "'Gaijinsan - Episode 37'"

2/ When an episode is deleted, then download again, the initial directory is not removed and the second directory related to the second download is suffixed with a number.

$ ls -la
drwxr-xr-x  2 root root 4096 Sep 21 21:45 "'Gaijinsan - Episode 28'"
drwxr-xr-x  2 root root 4096 Sep 21 21:45 "'Gaijinsan - Episode 28'-0"
drwxr-xr-x  2 root root 4096 Sep 21 21:41 "'Gaijinsan - Episode 29'"
drwxr-xr-x  2 root root 4096 Sep 21 21:41 "'Gaijinsan - Episode 29'-0"

The file is not listenable because the GUI do a reference on the initial directory.

3/ On the RSS feed, the audio files are referenced with this tag :

<enclosure length="122217012" type="audio/mpeg" url="https://traffic.libsyn.com/secure/gaijinsan/Gaijinsan_-_Episode_44.mp3?dest-id=753038" />

When the file is downloaded, the episode file name is "podcast.mpeg". It should be : podcast.mp3

"audio/mpeg" should be considered as "audio/mp3"

Best.

Reproduction

...

System Info

...

Used Package Manager

n/a

Validations

SamTV12345 commented 1 year ago

Regarding the first issue: image I get this on a Windows machine. It is important to put quotation marks on the file as otherwise things can get messy on the file system. A / can be interpreted as a separator and there were also issues with whitespaces on Windows. So there must be a single quotation mark for that. Regading the second issue: I can't really reproduce this. This only happens if an episode is present, it is not yet registered in the database and there is another episode that is downloaded. So the use case would be that a podcaster releases two episodes with two identical names. Otherwise they would overwrite each other.

bastgau commented 1 year ago

For the point 2/ I only used the GUI to delete and download an episode again on an instance running on Linux with Docker.

lvfh3078 commented 1 year ago

I have also noticed that podcasts are now being downloaded in the .MPEG format.

Is there a way to specify the format for podcast downloads? I would like to download my podcasts in .MP3 only.

Thanks

bastgau commented 11 months ago

Sorry but I persist. There is an issue with the episode names and file names.

bastien@srv:~/podfetch/data/podcasts$ ls -l
total 20
drwxr-xr-x 7 root root 4096 Nov  4 17:14 '20 minutes avant la fin du monde'
drwxr-xr-x 7 root root 4096 Nov  4 14:02 "C'est votre argent"
drwxr-xr-x 7 root root 4096 Nov  4 17:35 'Gaijin San'
drwxr-xr-x 7 root root 4096 Nov  4 14:01 'La Revue de Presse'
drwxr-xr-x 7 root root 4096 Nov  4 14:02 'Un bonbon sur la langue'

Everything is ok with the podcast names.

bastien@srv:~/docker-containers/podfetch/data/podcasts$ cd Gaijin\ San/
bastien@srv:~/docker-containers/podfetch/data/podcasts/Gaijin San$ ls -l
total 940
drwxr-xr-x 2 root root   4096 Nov  4 15:01 "'Gaijinsan - Episode 44'"
drwxr-xr-x 2 root root   4096 Nov  4 15:00 "'Gaijinsan - Episode 45'"
-rw-r--r-- 1 root root 939658 Nov  4 14:02  image.jpeg

For me in this example, at the episode level directory, there is additional single quote.

bastien@srv:~/docker-containers/podfetch/data/podcasts/Gaijin San$ sudo touch "'Gaijinsan - Episode 48_test'"
bastien@srv:~/docker-containers/podfetch/data/podcasts/Gaijin San$ sudo touch "Gaijinsan - Episode 48_test"

I can reproduce the error creating file in the file system.

bastien@srv:~/docker-containers/podfetch/data/podcasts/Gaijin San$ ls -l
total 940
drwxr-xr-x 2 root root   4096 Nov  4 15:01 "'Gaijinsan - Episode 44'"
drwxr-xr-x 2 root root   4096 Nov  4 15:00 "'Gaijinsan - Episode 45'"
-rw-r--r-- 1 root root      0 Nov  4 17:38 "'Gaijinsan - Episode 48_test'"
-rw-r--r-- 1 root root      0 Nov  4 17:38 'Gaijinsan - Episode 48_test'
-rw-r--r-- 1 root root 939658 Nov  4 14:02  image.jpeg

The first command has generated the 3rd file. The second has generated the 4th line with the correct quotes.

It seems that now the episode title is not mentioned anymore in the mp3 file.

SamTV12345 commented 1 month ago

This is fixed. I removed the single double quotes requirement. I just replace all illegal characters