Задать вопрос

Тел: +7 965 3737 888

450

Просмотров

3

Ответов

iTunes Podcast RSS Feed

The syndication documentation gives a very basic beginning to creating an iTunes Podcast Feed, but leaves a lot of work left to be figured out. This is a completed example. Because I needed to obtain the duration of the podcast file programmatically (not part of this code) I limit the podcast to mp3 files. If you want to obtain durations some other way you can set the mime_type in the same manner as the other properties.

This is what I'm using and should be plenty for you to customize from.

Вопрос полезен? Да0/Нет0
file_2325.py(3.7Кб)
None

Ответы (3):

Ответmlissner:17.09.2014
Ответ полезен? Да0/Нет0

Super useful snippet, thank you very much.

If others are interested in an example of this that'll soon be deployed, you can see our code at:

https://github.com/freelawproject/courtlistener/blob/multi-doc/alert/audio/feeds.py

You may notice that we didn't end up using iTunesPodcastPost from above. Seemed unnecessary and added unneeded complexity. I also ran into the issue with the capital iTunes breaking things.

Ответsojimmyso:28.09.2010
Ответ полезен? Да0/Нет0

You have one bug in add_item_elements method - name space iTunes with capital "T" - it doesn't work in iTunes app. Need to use 'itunes'.

Ответgregb:14.09.2010
Ответ полезен? Да0/Нет0

You need a from django.db.models import permalink at the top there. Otherwise, very handy - cheers.