[phpBB Debug] PHP Notice: in file /viewtopic.php on line 981: date(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'UTC' for 'UTC/0.0/no DST' instead
[phpBB Debug] PHP Notice: in file /viewtopic.php on line 981: getdate(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'UTC' for 'UTC/0.0/no DST' instead

Generating podcasts

Discussions regarding the development of get_iplayer

Generating podcasts

Postby dmcg » 14 Feb 2010 12:49

So now I've installed the web pvr, I see that this is the place that podcast support should live!

Basically I'd like to generate podcast rss files in place of the playlists currently generated, so that I can point iTunes at a URL and have the programs delivered to my phone.

Is this functionality that is of interest, and if so, can you give me any pointers?

Also, connected, is there any way to work out which programmes were downloaded as part of which PVR search? It would be nice to automatically build a playlist / podcast from the PVR entry rather than reiterating the search.

Great project BTW

Thanks in anticipation

Duncan
dmcg
 
Posts: 7
Joined: 13 Feb 2010 12:33
Top

Re: Generating podcasts

Postby linuxcentre » 14 Feb 2010 13:13

There is currently no easy way to tell which progs came from which PVR search. This would require extending the info in the recording history.
For the podcast functionality in the web PVR manager, I'll have a think about it. Does this only make sense for podcast and radio programme types or is it also relevant for tv progs?
linuxcentre
Site Admin
 
Posts: 306
Joined: 31 Dec 2009 17:29
Top

Re: Generating podcasts

Postby dmcg » 14 Feb 2010 16:20

linuxcentre wrote:There is currently no easy way to tell which progs came from which PVR search. This would require extending the info in the recording history.


That's what I figured when I wrote a parser for the history. With the script that I posted I kind of squared the circle by assuming that different pvr searches dump into different directories, and then starting from listing the directory. But you have to specifically set this up with your pvradd. Might make a useful default to record into subdirs with the name of the PVR search.

linuxcentre wrote:For the podcast functionality in the web PVR manager, I'll have a think about it. Does this only make sense for podcast and radio programme types or is it also relevant for tv progs?


I think that if I'm recording a series (tv or radio), which the PVR mainly is I guess, then it is very logical to want a playlist of that series. I know I can reproduce it by creating a playlist with the same search as the PVR search (at least to an approximation) but much nicer to click on the PVR search and have all its recordings delivered in one go. And if delivered as a podcast rss feed, then I can send it straight to my player.

Duncan
dmcg
 
Posts: 7
Joined: 13 Feb 2010 12:33
Top

Re: Generating podcasts

Postby linuxcentre » 14 Feb 2010 18:11

Can you not use m3u playlists as they are already supported?
linuxcentre
Site Admin
 
Posts: 306
Joined: 31 Dec 2009 17:29
Top

Re: Generating podcasts

Postby dmcg » 14 Feb 2010 19:35

linuxcentre wrote:Can you not use m3u playlists as they are already supported?


So here is my scenario. For the past 20 years I have been listening to a recording of The Archers on my way to work in the morning. It started as tape with a timer, but as soon as the BBC started their RealAudio streaming I used StreamBox VCR to record them and Switch to transcode to MP3. Before the advent of podcasting I then used iTunes scripting interface to create playlists and transfer them to my iPod. All this glued together with bits of Python, Ruby and some Windows GUI scripter I can't remember the name of.

When podcasting came along I switched to generating a podcast file instead of driving the scripting interface - the huge advantage being that iPods then managed the 'listened-to' status, the disadvantage being that for some reason file: urls don't work, so I have to run a web server.

Of course the BBC started podcasting the Archers themselves, but I still use this method to produce my own podcast of the Radio 4 18:30 comedy.

get_iplayer would let me replace at lot of this infrastructure, and the web-pvr makes a much better GUI than my manual editing of scripts, but as you will appreciate, podcasts are a much better way of getting recordings onto an iPod than an m3u playlists.

Duncan
dmcg
 
Posts: 7
Joined: 13 Feb 2010 12:33
Top

Re: Generating podcasts

Postby dinkypumpkin » 15 Feb 2010 15:47

FWIW, I've had success with using a custom user command to add get_iplayer downloads directly into iTunes as podcasts (assuming they are on the same machine). I like to review all my new PVR downloads in the iTunes podcast view, so I integrated the podcast-isation into the download process. My scheme doesn't help with matching files to PVR searches, but for me it's always 1 search = 1 series, so the podcast catalogue in iTunes is good enough to keep track of things. I use Python, Appscript, and Mutagen on OSX, and it works for both MP3 and MP4 files. I can post an example if you're interested.
dinkypumpkin
 
Posts: 2
Joined: 15 Feb 2010 13:06
Top

Re: Generating podcasts

Postby dmcg » 15 Feb 2010 18:07

I'd certainly be very interested, thank you, although I suspect that I would end up running on 2 different machines.

Duncan
dmcg
 
Posts: 7
Joined: 13 Feb 2010 12:33
Top

Re: Generating podcasts

Postby dinkypumpkin » 15 Feb 2010 19:26

dmcg wrote:I'd certainly be very interested, thank you, although I suspect that I would end up running on 2 different machines.


At the end of this post is an example of a custom user command script that could be used to add get_iplayer downloads to iTunes as podcasts. It's from an early experiment so it doesn't cover all the metadata issues you run into when moving get_iplayer downloads to iTunes. It just writes the ID3 frames/MP4 atoms for podcasts (according to iTunes) and then adds the file to iTunes, relying on get_iplayer to fill in most of the metadata with id3v2 or AtomicParsley.

The downloaded files appear in iTunes as podcasts grouped by album. TV shows usually come out of get_iplayer without the album atom set, thus the inclusion of a hack to copy show name to album name for MP4 files. The resulting podcasts have no feed URLs, thus a "subscription" disappears when you remove all its episodes.

The example script needs Python, Mutagen, and Appscript (thus OSX). I would guess the iTunes COM interfaces can be used in Windows. Regardless of the toolset employed, these are the basics: PCST and TGID ID3 frames (pcst and egid MP4 atoms) appear to be absolutely required and the TDRL ID3 frame (\xa9day MP4 atom) is necessary for episode sorting. The description frames/atoms aren't necessary, but make for a nicer default iTunes podcast listing.

If you want to apply this script to every get_iplayer download, you can add the following to your options file:

Code: Select all
command /path/to/add_itunes_podcast_episode.py "<filename>" "<pid>" "<firstbcast>" "<descshort>" "<desc>"


Example script:

Code: Select all
#!/usr/bin/env python

import sys
import os
from appscript import *
import mutagen.id3
from mutagen.id3 import ID3, TDRL, TIT3
from mutagen.mp4 import MP4

class PCST(mutagen.id3.TextFrame): "Podcast Flag"
class TGID(mutagen.id3.TextFrame): "Podcast GID"
class TDES(mutagen.id3.TextFrame): "Podcast Description"

PODCAST_FRAMES = dict()
PODCAST_FRAMES["PCST"] = PCST
PODCAST_FRAMES["TGID"] = TGID
PODCAST_FRAMES["TDES"] = TDES

mutagen.id3.Frames.update(PODCAST_FRAMES)

def add_itunes_podcast_episode(argv):
   filename, pid, firstbcast, descshort, desc = argv[1:]
   ext = os.path.splitext(filename)[1].lower()[1:]
   if ext == "mp3":
      add_itunes_podcast_episode_mp3(filename, pid, firstbcast, descshort, desc)
   elif ext == "mp4":
      add_itunes_podcast_episode_mp4(filename, pid, firstbcast, descshort, desc)

def add_itunes_podcast_episode_mp3(filename, pid, firstbcast, descshort, desc):
   tag = ID3(filename)
   tag['PCST'] = PCST(3, u"\x00")
   tag['TGID'] = TGID(3, pid)
   tag['TDRL'] = TDRL(3, firstbcast)
   tag['TIT3'] = TIT3(3, descshort)
   tag['TDES'] = TDES(3, desc)
   tag.save()
   itunes = app('iTunes')
   track = itunes.add(mactypes.File(filename))
   print "INFO: added iTunes podcast episode: {0} / {1} / {2}".format(track.artist(), track.album(), track.name())

def add_itunes_podcast_episode_mp4(filename, pid, firstbcast, descshort, desc):
   tag = MP4(filename)
   tag['pcst'] = True
   tag['egid'] = pid
   tag['\xa9alb'] = tag['tvsh'] # assume video and force album = show for podcast
   tag['\xa9day'] = firstbcast # probably already exists in file, but force anyway
   tag['desc'] = descshort # probably already exists in file, but force anyway
   tag['ldes'] = desc
   tag.save()
   itunes = app('iTunes')
   track = itunes.add(mactypes.File(filename))
   print "INFO: added iTunes podcast episode: {0} / {1} / {2}".format(track.artist(), track.album(), track.name())

if __name__ == "__main__":
   if len(sys.argv) == 6:
      add_itunes_podcast_episode(sys.argv)
   else:
      print "ERROR: cannot add iTunes podcast episode: missing arguments"
dinkypumpkin
 
Posts: 2
Joined: 15 Feb 2010 13:06
Top

Re: Generating podcasts

Postby dmcg » 16 Feb 2010 09:08

Thank you, I had wondered about setting ID tags rather than passing the info through the podcast.rss file - you've given me lots to work on.

And thanks also for joining the forum just to post a reply!

Duncan
dmcg
 
Posts: 7
Joined: 13 Feb 2010 12:33
Top


Return to development



Who is online

Users browsing this forum: No registered users and 1 guest

cron
./cache/ is NOT writable.