Closed (duplicate)
Project:
FileField Podcaster
Version:
6.x-0.7
Component:
Miscellaneous
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
5 Aug 2009 at 15:20 UTC
Updated:
17 Aug 2012 at 17:19 UTC
Is anyone else having trouble figuring out how to get the iTunes "Explicit" ID3 information into the file? There is some talk about "converting the file in iTunes" then setting the ID3 explicit. But I cannot figure it out! I see everything else BUT explicit.
I have everything else working now, but I am stuck here. Anyone figured it out already?
Comments
Comment #1
flickerfly commentedI'm also having this problem.
Comment #2
pribeh commentedsubscribe.
Comment #3
gruber76 commentedNo, the Explicit or Clean tags are in the RSS feed, not on the mp3 files themselves. ("Clean") The tag exists on both the Channel level and on the individual Items, so it would need to be supported for each.
I might be willing to throw a patch together, but it doesn't look like this module is still being maintained.
Comment #4
pribeh commentedI will definitely bug test if you're up to it gruber76. There really isn't another module such as this so if need be I'm sure someone could ask to takeover maintainership.
Comment #5
richardtmorgan commentedI got an email about the comment I left on the ffpc documentation page: http://drupal.org/node/313322 about customising the output of this module.
The output is defined within the module, rather than in template files, so changes to the output require changing (hacking) the module. While I can see that this is not best practice, the output of the template file (ffpc-view-podcast-feed.tpl.php) mostly just prints a variable - $channel. $channel is built inside the ffpc.module file from an array ($args) which does not have scope outside the function that creates it. It seems that there is really no way of customising the output to the extent that is required without really essentially re-doing all the work that is done by the module. An alternative approach would be give up on the module altogether and build an rss feed the way you want it, with all the heavy lifting done in template files - since one perfectly good methodology for creating a podcast feed has already been established by ffpc, it seems a duplication of effort to look for a different solution.
My fix to this issue, then, was to say 'I want a module very like ffpc, but with a different set of itunes tags outputted'. My solution was to clone ffpc, but to change all the ffpc output for output that suited me. I called my new module (which is just to create a talks podcast for my church) ffpcstpauls. Alternatively, you could just hack the ffpc module - only it would then be hard to tell what was original and what was your modifications.
As a rough and ready solution to getting the itunes feed you want this is quite easy (it took me an afternoon to read all the itunes specifications, decide what I wanted my feed to look like, figure out how ffpc delivered the feed it did, and then go through the code so that it delivered what we wanted instead). A better fix would be to provide an administration interface for ffpc, so that the options that you want are available there - or to make a module that was somehow more dependent on .tpl.php files which could easily be themed. Either of those would have taken several days (and then could have been buggy etc...).
So... let me go through the module files, and explain how to use them as the template for a module that will produce a specific feed in the format you want. The module has 6 files - the .info file which is needed to see and load your module in the module administration page, a .tpl.php file - which is the template file for the feed, a .module file, which builds the feed from the various rows and adds the feed meta data, a .views.inc file which defines the classes and template used to build the rows and style the feed.
Creating a custom ffpc module
Decide on a name for your module - I chose ffpcstpauls - when I refer to this, use your own name instead
Make a copy of the ffpc.info file and name it ffpcstpauls.info. Change the name and description (Name - St Paul's FileField Podcast; Description: A clone of ffpc, with the iTunes tags customised for St Paul's iTunes feed) to suit your feed.
Make a copy of the ffpc.views.inc file and name it ffpcstpauls.views.inc. This file defines the call to the theme file ('theme' => 'ffpcstpauls_view_podcast_feed') and the handlers for styling in general, and more specifically the row formats ('handler' => 'ffpcstpauls_plugin_style_podcast' and 'handler' => 'ffpcstpauls_plugin_row_podcast' respectively). You must ensure that you rename these three references (which will be defined in the next four files) with the names that you use in your files (following the principle of replacing the 'ffpc' part of the name with your new name.
Here is my ffpcstpauls.views.inc file:
The style plugin file is ffpc_plugin_style_podcast.inc copy it and rename it ffpcstpauls_plugin_style_podcast.inc. This file simply defines the overall style of the feed as an rss feed. It does that by 'extending' the view_plugin_style_rss class - but in fact it doesn't add anything to that class, so its really just copying its functionality to a different names class. All we need to do is make sure that we rename the class we are defining with our name.
The template file (ffpc-view-podcast-feed.tpl.php) is copied and named 'ffpcstpauls-view-podcast-feed.tpl.php'. In the original template, the xml:base property is pulled from the $link variable (you could put that back safely) and the two namespace definitions (xmlns:...) are produced by the variable $namespaces. I've explicitly defined them. You could leave this file alone (apart from the changing the file name); I was happy that I was writing this for a specific instance and wanted to be sure that I was writing the namespaces as the iTunes stuff asked.
The heavy lifting happens in the next two files. In fact if you just wanted to hack the module as is you could leave the four previous files entirely alone, not bother creating a new module and just overwrite these two files.
The first file is ffpc_plugin_row_podcast.inc - copy it and rename it ffpcstpauls_plugin_row_podcast.inc - this defines the class which extends the regular rss item class (make sure you rename this in line 2) and this is what formats each item in the podcast - by picking the items you want to include and sending them through the drupal function format_rss_item(). You need to go through the iTunes spec and decide how you want your feed items to look - Apple give a really good description of how each item in the feed displays in iTunes - you can choose exactly what you want where. The heavy lifting is done by loading the node of that row of your view - you then need to pull all the data out of that item by directly describing the property of the node object (i.e. $item->body). This is exactly the same as any other (advanced) rows theming and there are lots of examples of this. You need to know what the properties of the object are - the easiest way to do this is to set up a test page where you load a node as (say) $item, and then print_r($item); to output the object on the screen - it's easier to see this clearly by viewing the source. There is lots of supplemental advice about how to do this, and it is an essential technique for theming anything in Drupal - so if you've got this far, I guess you can probably already do this. The id3 tags are included by GetID3 - all of that stuff is pretty self evident in the code below.
Anyway, sufficient to say that the following code relates to the specific way in which a 'sermon' node type is set up (via CCK) on our website - your application of this principle will be entirely different. So here is the code - read it, compare it to the original and go bake your own:
The final file is the module file itself (ffpc.module - copied and re-named as ffpcstpauls.module). Make sure that both functions (mine are named: ffpcstpauls_views_api() and template_preprocess_ffpcstpauls_view_podcast_feed()) are renamed with your module name replacing the original ffpc name. The first function allows views to call all the .inc files in this module folder, and works with views 2 - all the files for your module must be in the same folder - as in the original ffpc, otherwise you will also need to specify a path within this function. The preprocess function is responsible for building the whole feed channel - with the function format_rss_channel(), and includes all the channel information (which is where the 'explicit' tag is, and a link to an image for the channel). Here you simply hard code your own channel information - again the Apple website has very good information about categories etc...
There we are - look at the Apple info on how an iTunes feed should be formatted - decide what information you want in summaries and descriptions etc... - make sure that your node has somewhere to enter that extra information, and then bake your own module exactly following the pattern used by ffpc.
Once you have your six files - you put them in a folder with your module name, upload it to sites/all/modules and then install it as you would any other module. To create your feed in Views you follow exactly the instructions as for ffpc.
There is some work involved - it's not difficult, especially if you are used to theming Drupal nodes by directly pulling the node properties.
Have fun - I hope this is helpful.
Comment #6
pribeh commentedThis is super amazing Richard! Thanks so much. You don't know how much this helps.
Comment #7
richardtmorgan commentedGlad to know it's helpful - hope you get the feed up and running soon...
Comment #8
mfer commentedFunctionally, I would love to be able to add in custom elements and patch that together. Beyond adding an explicit tag there are several other customizations what would be nice.
Soon I'll be adding some hooks and template file functionality in which should accommodate that. There are other issues open for these tasks.
See:
#520122: Add row style template (tpl.php)
#362082: Patch that fixes a couple typos and introduces two hooks
Comment #9
drjonez commentedNEED THIS!
Comment #10
hankpalan.com commentedIs this still being worked on?
Comment #11
dopey_1 commentedGo to dis website and follow their instructions, its easy to add the explicit tags.
http://www.warezfox.org/f5/add-explicit-clean-red-tags-m4a-files-itunes-...
you also need IZar to unzip the zipped folder
Comment #12
steven-spencerThe link above goes to a advertisement redirect.