Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Re: tru_podcast: A podcasting plugin for Textpattern
Maybe for this stage of development we can test these ideas with a secret “tru_podcast_fileurl_test” variable that, if passed in the query string, produces one or the other kind of URLs. Also, we should probably test some podcast clients besides iTunes.
I’ve emailed you a link to a “beta” version :) It currently defaults to using filenames (rather than ID numbers), but you can change it back by editing a setting in the plugin. It also has a setting (in the code) that you can change to tell it to use direct URLs. Please give both a try and let me know how they work.
Have I read correctly? If the custom field contains a number, it’s interpreted as a reference to the uploaded file with that number. Not shifty at all. Then you internally cook up a direct link to the real home of the file and pass that to the existing header-fetch function so Textpattern isn’t involved in the header-reading, just the web server, which won’t lie about MIME types like Textpattern does. Yes shifty! But that’s an implementation secret; the podcast still gets the Textpattern-generated file URL (or the external URL, as before).
You have read correctly. And I gave the podcast the txp-generated url because that url knows how to do download-count logging, and that seemed like a good feature to preserve.
A niggle: instead of the literal “files”, tru_podcast_rss_handler() should probably honor the “File directory path” preference, yes?
I hadn’t thought about the “file directory path” preference. Crap. The problem is, that path is a local filesystem path, and I need a webserver-accessible path (to get the header info). I could try to be sneaky and figure out the webserver path, but that’s not guaranteed to work, because people can make that path point to a place outside of the webserver’s scope, and TXP will still work (I think). !@#$%^
To work around this, I added a third configurable parameter that lets you specify the URL path (what a web user would see) to the “files” directory, and defaulted it appropriately. If someone uses a custom directory, they can set the parameter.
Thoughts?
Offline
Re: tru_podcast: A podcasting plugin for Textpattern
I installed the beta as is on my dev site. Went back to iTunes and told it to refresh the podcast feed. Now it sees my Txp-uploaded episode. Clicking “GET” downloads it, double-clicking plays it, everything’s normal. The download results in an incremented counter. Also, Safari’s feed view shows the proper media icon, and downloading increments the counter. Also, downloading the link with Mac OS X lukemftp gives the right filename (semi-obviously, but still good) and increments the counter. All good!
I then set TRU_PODCAST_USE_DIRECT_LINKS=1 and TRU_PODCAST_USE_FILENAMES=0. The former seems to override the latter, which makes sense (the direct link without the direct filename wouldn’t be too helpful!). The counter is never incremented, since Textpattern isn’t involved, but this also works in iTunes and Safari and manually downloads to the right filename.
Finally I set TRU_PODCAST_USE_DIRECT_LINKS=0 and TRU_PODCAST_USE_FILENAMES=0. Safari stops having the media icon, iTunes once again sees no episodes, and lukemftp downloads “2”.
So I like the new defaults a lot! My next episode can be published entirely within Textpattern. If you think those config variables might still be helpful for another release or two while things shake out, leave them in, but I didn’t need to tweak them.
Re: “File directory path” pref, how does Textpattern know that the URL path “/files/” corresponds to the right filesystem directory? Does it know, or does it rely on the web server being configured such that that’s true? From a very quick glance at the Txp source, it looks like the latter — “files” occurs literally in a few places. In other words, Textpattern seems to already demand that “/files/” point where it needs to point. So if you agree with my reading of the code, tru_podcast doesn’t need to do anything special here after all.
Offline
Re: tru_podcast: A podcasting plugin for Textpattern
All – thanks to schmonz, I’m happy to announce the release of tru_podcast v1.1. This release fixes/improves support for using Textpattern’s “Files” features in conjunction with iTunes and other podcast clients. Please see the last few posts on this forum for details. There are no new user-visible features, but I recommend that you upgrade to make sure that iTunes works correctly.
schmonz – your results are very interesting. iTunes and friends must just be using the file extension, and ignoring the mime-type. Not that I can blame them, with software like Textpattern doing the wrong thing, but still, it’s crappy that they break when the spec is followed.
On a separate note, I tried changing my “/files/” directory, and it breaks the URLs. Oh well – at least that means that my code wasn’t a waste of time…
And finally – thanks for your help!
Last edited by truist (2008-07-03 11:54:16)
Offline
Re: tru_podcast: A podcasting plugin for Textpattern
I’ve retrofitted my half-dozen existing podcast posts to use Textpattern’s Files (uploaded the MP3 files, replaced external URLs in the tru_podcast custom field with numeric references, replaced external URLs in article text with tru_podcast_link, set up HTTP redirects pointing the old file locations to the new ones, and removed the old files).
Thanks very much for the update — this will make using tru_podcast even nicer.
Offline
Re: tru_podcast: A podcasting plugin for Textpattern
Just posted my first episode using the new Files stuff. Weeee! I’m noticing that when I Preview an article I’m about to post, the <txp:tru_podcast_link linktext="foo" /> tag survives, unprocessed, in the HTML (and so renders to zilch). The tag DTRT in the published article, of course. This may not be anything new: I wasn’t using tru_podcast_link until I moved everything to Files. Is this fixable in tru_podcast, a more general problem with Preview, or what, yo?
Offline
Re: tru_podcast: A podcasting plugin for Textpattern
It appears to be a general problem with preview. I tried out of TXP’s built-in tags, and they all exhibited the same problem.
Offline
Re: tru_podcast: A podcasting plugin for Textpattern
Feature request! Unless Textpattern can do this itself, which would surprise me.
I recently gave a talk, lasting over half an hour, of which I have a 128kbps MP3 audio recording (35MB). I’d like to podcast it. Even if I reencode it as 64kbps, it’ll still be too large to upload through Textpattern without setting absurdly high PHP and Txp file upload limits.
I’m thinking that most uses of Txp (and PHP, for that matter) specifically don’t want gigantic file upload limits, and that this issue is specific to publishing large media files. Sure, I could tweak the file upload limits temporarily for such uploads, but that has the suck quality about it. So I propose that tru_podcast be extended to also support either or both of the following workflows:
- Not using Txp, upload a media file to an arbitrary location on the server filesystem.
- In Txp -> Files, specify this filesystem location.
- Have the file copied into Txp’s “files” directory and added to the list of files.
AND/OR
- Not using Txp, upload a media file directly into Txp’s “files” directory.
- In Txp -> Files, specify the file’s name (or maybe click a button to scan for unknown files in “files”).
- Have the file added to the list of files.
This would add further awesome to tru_podcast. Most of the time my audio is small enough that this isn’t an issue, but imagine Ze trying to do his thing with tru_podcast. He would definitely want this. :-)
Offline
Re: tru_podcast: A podcasting plugin for Textpattern
It appears this plugin does not support the iTunes specific tags, like <itunes:author> etc…
How would I go about including them in my podcast feed?
Any help much appreciated;-)
Offline
Re: tru_podcast: A podcasting plugin for Textpattern
raveoli – it’s true, it doesn’t. It’s probably somewhat difficult to include all those things in the plugin, because each of them would require their own custom field, or I’d have to make some sort of hack-ish solution where it dug the extra data out of the article body, embedded in special tags. I think the “right” solution is probably to make the plugin have an admin-side component that let you manage all the metadata for a given media file, but that’s a lot of work, so I’m not planning on doing it soon.
In the short term, do you have a handy list of all the itunes-specific tags? Are there specific tags that are most important to you? Are there any tags that can be automatically guessed? If so, I’ll see what I can do to make something work.
Offline
Re: tru_podcast: A podcasting plugin for Textpattern
Hi Nathan
Yes they’re here: iTunes RSS Tags
Currently I’m using “Loudblog“http://www.loudblog.com but recently development was handed over til a third party that I don’t have a lot of faith in. So currently I’m wondering whether I should go back to Textpattern og use Drupal, for my podcast site.
If you feel the iTunes tags are a lot of work, I may be better off going to Drupal on this one?
Thank you for your efforts;-)
Offline
Re: tru_podcast: A podcasting plugin for Textpattern
schmonz >
You could jut upload your large files via FTP to your files directory, after that the files can be tied to Textpattern in the files-tab, just choose them from the dropdown/popup menu;-)
Nathan >
I’ve decided to go with Textpattern for this. The iTunes-tags I need to specify are quite static (author, image, description, language, copyright, etc), so they could be hardcoded into publish/rss.php, or your plugin, getting the input from a form, if possible.
However, not being a php-programmer, would you be kind to point me in the right direction? ie. best practices, and where in the php to input what…
The reason I wanna have the iTunes-tags in my podcast feed is because they make my podcasts appearance at the iTunes Store look much better, and only those podcasts utilizing the iTunes-tags are eligible to be featured of the iTunes podcast frontpage, which is of course my big dream (weep and whine;-)
Last edited by raveoli (2007-05-11 20:38:49)
Offline
Re: tru_podcast: A podcasting plugin for Textpattern
raveoli – a few thoughts.
First, according to the itunes feed spec (that you linked to earlier), you have to add a line to the top of the RSS feed for the itunes tags to work. To do that, you’d need to modify /textpattern/publish/rss.php. Assuming that you’re using TXP 4.0.4, you should look at line 202 (I think…) as a good place to insert the new line. (This is also something that a plugin simply wouldn’t be able to do, today. You’d have to patch TXP. That means that there’s no real point in me trying to support this in the plugin.) rss.php will change to feeds.php in TXP 4.0.5, so you’ll need to re-apply your change there, when you upgrade (if 4.0.5 ever comes out…)
To add things like copyright, author, image, etc. to the “channel” (rather than the “item”), you’d also need to modify rss.php. I’d look at adding a few lines around line 35.
If you need to add things to each individual “item” (article), your best best is probably to install tru_tags and create a tru_tags_feed_tags form (in the TXP admin). See Step 7 of the instructions for details on what that means. You should be able to put HTML or PHP into that form that adds whatever itunes tags you want to your feeds. If you want it to dynamically get the right description, etc, you could probably pull those values from custom keyword fields. (I know there’s a TXP tag that can do that, but I don’t remember what it is.)
Ping me if you have questions. I can’t promise speedy responses, but I will help.
Offline
Re: tru_podcast: A podcasting plugin for Textpattern
truist wrote:
You’d have to patch TXP. That means that there’s no real point in me trying to support this in the plugin.) rss.php will change to feeds.php in TXP 4.0.5, so you’ll need to re-apply your change there, when you upgrade (if 4.0.5 ever comes out…)
That makes sense. Thank you for the directions. I’ll also experiment with Tru_Tags, I’ll let you know how it all goes.
PS: What do you mean with the “if 4.0.5 ever comes out…”? Do you think we will rather see 4.1 instead of a 4.0.x update, or not see anything at all?
Offline
Re: tru_podcast: A podcasting plugin for Textpattern
raveoli wrote:
PS: What do you mean with the “if 4.0.5 ever comes out…”? Do you think we will rather see 4.1 instead of a 4.0.x update, or not see anything at all?
I was just letting my frustrations show. 4.0.5 will eventually come out, I’m sure.
Offline
Re: tru_podcast: A podcasting plugin for Textpattern
raveoli wrote:
You could jut upload your large files via FTP to your files directory, after that the files can be tied to Textpattern in the files-tab, just choose them from the dropdown/popup menu;-)
That worked! Textpattern sure is clever. My feature request is hereby sheepishly rescinded. truist, could you add a note about this upload trick to the tru_podcast docs?
Offline