Textpattern CMS support forum

You are not logged in. Register | Login | Help

#11 2007-03-18 22:36:17

schmonz
Member
From: Bloomington, IN
Registered: 2007-01-27
Posts: 13
Website

Re: tru_podcast: A podcasting plugin for Textpattern

You mean tru_podcast, of course. Looking forward to seeing how you did it!

Offline

#12 2007-03-18 23:56:00

schmonz
Member
From: Bloomington, IN
Registered: 2007-01-27
Posts: 13
Website

Re: tru_podcast: A podcasting plugin for Textpattern

I’ve tested a bit and will probably stick with external URLs for now. Reasons:

  • iTunes doesn’t see episodes where media was uploaded within Txp and referred to by number (just like it ignores articles without media)
  • Safari’s feed view, which tries to show a representative icon for media files, comes up with its “missing image” image
  • Some browsers and fetchers will store downloaded media with the Txp file number as filename and no extension (if this happens to my parents, woe is me!)

Textpattern sure is weird about file downloads.

Offline

#13 2007-03-19 00:18:20

truist
Plugin Author
From: Ohio, USA
Registered: 2004-11-09
Posts: 256
Website

Re: tru_podcast: A podcasting plugin for Textpattern

Gaaa! I hate that stupid file upload system.

In order with the issues you raised:

  1. This is very strange – are you sure? iTunes will find the episode if you post the file manually, but not if you use TXP’s interface? The only difference (feed-wise) is that TXP is serving up the file (with it’s funny redirection and broken mime-type) – I wonder if iTunes is trying to grab the file directly and being annoyed by TXP’s broken implementation.
  2. Also strange about Safari. Maybe the same problem?
  3. This specific problem could be worked around by changing the URL slightly. TXP will work correctly (ha!) with either of these URLs: /file_download/1 or /file_download/test.mp3. I could auto-rewrite the URL to have the filename in it, given the number in the custom field.

The only solution I see to all three of these problems is to include the “direct” links in the RSS feed (e.g. /files/test.mp3). I’ll bet that solves all three problems, but it would break download counting on the “Files” tab (in the admin interface).

I suppose I should really implement both options. Do you have thoughts about the custom URL solution? Would you use it? (I suppose you don’t have download counting now…)

Offline

#14 2007-03-19 00:44:18

schmonz
Member
From: Bloomington, IN
Registered: 2007-01-27
Posts: 13
Website

Re: tru_podcast: A podcasting plugin for Textpattern

  1. Pretty sure, yes. For my “production” podcast feed, which has made iTunes happy from day 0, I:
    1. scp an MP3 to a dumb virtual host (outside Txp)
    2. web-browse to that directory (letting Apache generate the directory listing)
    3. right-click the MP3 link and copy the URL
    4. go into Txp and paste the URL into the “tru_podcast” field.
  2. Also Safari likes the feed that results from the above workflow, and finds the right icons for media enclosures.
  3. This would certainly help the “naive download tool + naive user” case. If it also fixes the iTunes case, I think I can switch. (Safari’s behavior isn’t critical for me, just interesting.) You’re right, I don’t have download counting now (I could analyze Dumb Virtual Host’s server logs, I guess). So if download counting works with this trick, bonus.

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.

Offline

#15 2007-03-19 00:49:17

schmonz
Member
From: Bloomington, IN
Registered: 2007-01-27
Posts: 13
Website

Re: tru_podcast: A podcasting plugin for Textpattern

schmonz wrote:

You mean tru_podcast, of course. Looking forward to seeing how you did it!

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).

A niggle: instead of the literal “files”, tru_podcast_rss_handler() should probably honor the “File directory path” preference, yes?

Offline

#16 2007-03-19 01:55:19

truist
Plugin Author
From: Ohio, USA
Registered: 2004-11-09
Posts: 256
Website

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

#17 2007-03-19 02:34:01

schmonz
Member
From: Bloomington, IN
Registered: 2007-01-27
Posts: 13
Website

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

#18 2007-03-19 05:33:49

truist
Plugin Author
From: Ohio, USA
Registered: 2004-11-09
Posts: 256
Website

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

#19 2007-03-19 06:39:34

schmonz
Member
From: Bloomington, IN
Registered: 2007-01-27
Posts: 13
Website

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

#20 2007-03-27 02:16:29

schmonz
Member
From: Bloomington, IN
Registered: 2007-01-27
Posts: 13
Website

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

Board footer

Powered by FluxBB