Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

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

truist
Plugin Author
From: Ohio, USA
Registered: 2004-11-09
Posts: 257
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: New York
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: New York
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: 257
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: New York
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: 257
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: New York
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: New York
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

#21 2007-03-28 01:58:54

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

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

#22 2007-05-06 00:57:09

schmonz
Member
From: New York
Registered: 2007-01-27
Posts: 13
Website

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:

  1. Not using Txp, upload a media file to an arbitrary location on the server filesystem.
  2. In Txp -> Files, specify this filesystem location.
  3. Have the file copied into Txp’s “files” directory and added to the list of files.

AND/OR

  1. Not using Txp, upload a media file directly into Txp’s “files” directory.
  2. In Txp -> Files, specify the file’s name (or maybe click a button to scan for unknown files in “files”).
  3. 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

#23 2007-05-08 21:30:55

raveoli
Member
From: Copenhagen
Registered: 2004-03-06
Posts: 205
Website

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

#24 2007-05-09 00:52:30

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

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

Board footer

Powered by FluxBB