Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rename episodes #9

Open
pavelbenisek opened this issue Sep 3, 2016 · 10 comments
Open

rename episodes #9

pavelbenisek opened this issue Sep 3, 2016 · 10 comments

Comments

@pavelbenisek
Copy link

Please add an option to rename episodes to real names (possibly shorten ones), then you could keep the filenames as links or symlinks.

I'm thinking of naming it as something like:
S01E03-real_name_of_the_episode.mp3

thanks

@shiribailem
Copy link
Contributor

Just to clarify, are you wanting podfox to read ID3 tags to generate filenames?

It's possible, just requires additional libraries and some additional code centered around checking to see if the tag exists first.

@brtmr
Copy link
Owner

brtmr commented Sep 4, 2016

I assume he is referring to the title tag in the feed. I have not implemented a feature to do this, because podcasts are inconsistent about this.

@pavelbenisek
Copy link
Author

It could be taken from the original RSS file too I guess. i'm not sure how
reliable the id3 tags would be - depending on source, but in RSS it must be
given always which should make it easier to implement; also all the
necessary libraries are already loaded.

On 4 Sep 2016 4:19 a.m., "tmajibon" [email protected] wrote:

Just to clarify, are you wanting podfox to read ID3 tags to generate
filenames?

It's possible, just requires additional libraries and some additional code
centered around checking to see if the tag exists first.


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
#9 (comment), or mute
the thread
https://github.com/notifications/unsubscribe-auth/ADl2m8i2AbZYJjFVxMGosdqtUq3VMzayks5qmiqygaJpZM4J0a_L
.

@lv2eof
Copy link

lv2eof commented Sep 4, 2016

Hi,
I made it by hand.
What did I do:
I downloaded all podcast files with "PodFox".
Then I moved all files but "feed.json" to another directory.
Then with the help of a spreadsheet, I renamed all files to the field "title" of the "json" file.
This way I can browse the directory where the files are and select the one I want to listen.
It didn't take too much time but it would be much more better if the program could do it for me.
But like we use to say: "who doesn't have dog hunts with the cat" :)
Cheers,
Luis

@pavelbenisek
Copy link
Author

yep, of course the manual way is not the preferred one :)
I could write up something in bash/perl/php, but I am unable to manage it in python :(

Pavel

On 04 Sep 2016, at 20:43, Luis Vital [email protected] wrote:

Hi,
I made it by hand.
What did I do:
I downloaded all podcast files with "PodFox".
Then I moved all files but "feed.json" to another directory.
Then with the help of a spreadsheet, I renamed all files to the field "title" of the "json" file.
This way I can browse the directory where the files are and select the one I want to listen.
It didn't take too much time but it would be much more better if the program could do it for me.
But like we use to say: "who doesn't have dog hunts with the cat" :)
Cheers,
Luis


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub #9 (comment), or mute the thread https://github.com/notifications/unsubscribe-auth/ADl2m6OWGtyIJQiBrj21HCylHPXfUWn4ks5qmxFIgaJpZM4J0a_L.

@brtmr
Copy link
Owner

brtmr commented Sep 4, 2016

Hmm... Let me explain why I did not go down this route - Mostly to avoid naming collisions. To convert every possible title (which might contain lots punctuation & unusual characters) to a filename, you have to reduce them to a sensible charset - which introduces the possibility that titles only differ in some small sense, like adding a question mark. These would be mapped to the same filename on disk.

I therefore prefer to have the filename the original author chose, which may or may not be named in a consistent way.

I am gonna take some time later this week to properly implement a feature like this, which on a collision will either warn the user, or silently add a number to the end of the filename.

@shiribailem
Copy link
Contributor

Simple collision avoidance option: generate a timestamp, either from the time in the feed, or a datetime.now().isoformat()?

@pavelbenisek
Copy link
Author

You can simply add an episode number to the beginning of you human-readable-name, which has two advantages.
1/ it distinguishes possible collisions
2/ it also helps when you listen (as I am) podcasts elsewhere using dumb player. - it gives you the right order.

thanks
Pavel

On 04 Sep 2016, at 22:32, brtmr [email protected] wrote:

Hmm... Let me explain why I did not go down this route - Mostly to avoid naming collisions. To convert every possible title (which might contain lots punctuation & unusual characters) to a filename, you have to reduce them to a sensible charset - which introduces the possibility that titles only differ in some small sense, like adding a question mark. These would be mapped to the same filename on disk.

I therefore prefer to have the filename the original author chose, which may or may not be named in a consistent way.

I am gonna take some time later this week to properly implement a feature like this, which on a collision will either warn the user, or silently add a number to the end of the filename.


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub #9 (comment), or mute the thread https://github.com/notifications/unsubscribe-auth/ADl2m8DMvIY9-F2OSWrc8uvKBEaRtAkKks5qmyr0gaJpZM4J0a_L.

@pavelbenisek
Copy link
Author

what about something like this for getting the unique names?

#!/usr/bin/python3

from os.path import expanduser
from sys import exit
import feedparser
import os
import os.path
import requests
import sys
from email.utils import parsedate
from dateutil.parser import parse
from datetime import datetime

url = 'http://www.bbc.co.uk/programmes/b00snr0w/episodes/downloads.rss'

feed = feedparser.parse(url)
for entry in feed['entries']:
cdate = parse(entry['published'])
print( cdate.strftime('%Y-%d-%m_%H:%M:%S') + "-" + os.path.basename(entry['link']))

thanks
Pavel

On 04 Sep 2016, at 22:43, tmajibon [email protected] wrote:

Simple collision avoidance option: generate a timestamp, either from the time in the feed, or a datetime.now().isoformat()?


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub #9 (comment), or mute the thread https://github.com/notifications/unsubscribe-auth/ADl2m07uxK-Ej2WMeD94mYlAlNAox76Oks5qmy2JgaJpZM4J0a_L.

@shiribailem
Copy link
Contributor

Yeah, that bit is basically what I was thinking. Just add some code to bypass it if there is no "published" tag. Also needs to be code for conflicting published tags too.

It's useful to recognize that the following is entirely possible:

  • Two entries have the same published time
  • Two entries have the same title
  • There is no episode number attached

You also can't use it by position in the feed because many places use rolling feeds (older things are removed from the feed).

The simplest answer I can see is, the following in order:

  1. Published date + converted title
  2. Published date + file name (if the title's match, then they're clearly not informative)
  3. Current Date + title
  4. Current Date + file name

dalepotter added a commit to dalepotter/podfox that referenced this issue Oct 2, 2022
dalepotter added a commit to dalepotter/podfox that referenced this issue Oct 2, 2022
dalepotter added a commit to dalepotter/podfox that referenced this issue Oct 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants