Forum

This forum is now read-only. Support is provided at https://wordpress.org/support/plugin/sermon-browser/

Please consider registering
guest
sp_LogInOut Log Insp_Registration Register
Register | Lost password?
Advanced Search
Forum Scope


Match



Forum Options



Minimum search word length is 3 characters - maximum search word length is 84 characters
sp_Feed Topic RSSsp_TopicIcon
iTunes not accepting podcast feed
23 January, 2015
7:15 am
Kenna
Member
Members
Forum Posts: 5
Member Since:
14 January, 2015
sp_UserOfflineSmall Offline

I'm having an issue submitting my podcast feed url to iTunes. I found this video which was very helpful and have updated my podcast.php file as suggested: http://benandjacq.com/2013/06/.....-tutorial/

This is the website: followchurch.com.au and this is the public podcast feed: http://www.followchurch.com.au/?podcast

When I check the feed here feedvalidator.org I get errors that suggest that the url to the audio file is is not correct and I assume this is the issue "url must be full URL” see here is the screen shot. It seems that the url being generated by SB is http%3A%2F%2Fwww.followchurch.com.au%2Fwp-content%2Fuploads%2F2015%2F01%2Fluke-williams-follow.mp3 which is not correct the url is http://www.followchurch.com.au.....follow.mp3

I’m not sure what to do to fix this? I’ve tried uploading to Sound Cloud and to dropbox and I get the same result. The podcast feed does not reflect the actual file path to the url.

Any advice you could give me would be great!

23 January, 2015
7:44 pm
Extrafino
Enthusiast
Members
Forum Posts: 43
Member Since:
5 July, 2013
sp_UserOfflineSmall Offline

Maybe you could post the code of your modified podcast.php... otherwise it's kind of hard, I guess.

I use the original version of the SermonBrowser-Version of podcast.php and run the whole feed through FeedBurner, which optimises it for iTunes. Works for me...

29 January, 2015
3:29 am
Kenna
Member
Members
Forum Posts: 5
Member Since:
14 January, 2015
sp_UserOfflineSmall Offline

Ok sure here is my entire podcast.php code. Thanks for your help!

 

<?php
//Prints ISO date for podcast
function sb_print_iso_date($sermon) {
if (is_object($sermon)) {
echo date('D, d M Y H:i:s O', strtotime($sermon->datetime));
} else
echo date('D, d M Y H:i:s O', strtotime($sermon));
}

//Prints size of file
function sb_media_size($media_name, $media_type) {
if ($media_type == 'URLs') {
if(ini_get('allow_url_fopen')) {
$headers = array_change_key_case(@get_headers($media_name, 1),CASE_LOWER);
$filesize = $headers['content-length'];
if ($filesize)
return "length=\"{$filesize}\"";
}
} else
return 'length="'.@filesize(SB_ABSPATH.sb_get_option('upload_dir').$media_name).'"';
}

//Returns duration of .mp3 file
function sb_mp3_duration($media_name, $media_type) {
global $wpdb;
if (strtolower(substr($media_name, -3)) == 'mp3' && $media_type == 'Files') {
$duration = $wpdb->get_var("SELECT duration FROM {$wpdb->prefix}sb_stuff WHERE type = 'file' AND name = '".esc_sql($media_name)."'");
if ($duration)
return $duration;
else {
if ( ! class_exists( 'getID3' ) ) {
if ( version_compare(get_bloginfo('version'), '3.6', '<') )
require(SB_INCLUDES_DIR.'/getid3/getid3.php');
else
require( ABSPATH . WPINC . '/ID3/getid3.php' );
}
$getID3 = new getID3;
$MediaFileInfo = $getID3->analyze(SB_ABSPATH.sb_get_option('upload_dir').$media_name);
$duration = isset($MediaFileInfo['playtime_string']) ? $MediaFileInfo['playtime_string'] : '';
$wpdb->query("UPDATE {$wpdb->prefix}sb_stuff SET duration = '".esc_sql($duration)."' WHERE type = 'file' AND name = '".esc_sql($media_name)."'");
return $duration;
}
}
}

//Replaces & with &amp;
function sb_xml_entity_encode ($string) {
$string = str_replace('&amp;amp;', '&amp;', str_replace('&', '&amp;', $string));
$string = str_replace('"', '&quot;', $string);
$string = str_replace("'", '&apos;', $string);
$string = str_replace('<', '&lt;', $string);
$string = str_replace('>', '&gt;', $string);
return $string;
}

// Convert filename to URL, perhaps with stats
// Stats have to be turned off for iTunes compatibility
function sb_podcast_file_url($media_name, $media_type) {
$user_agent = isset($_SERVER['HTTP_USER_AGENT']) ? $_SERVER['HTTP_USER_AGENT'] : '';
if (stripos($user_agent, 'itunes') !== FALSE | stripos($user_agent, 'FeedBurner') !== FALSE)
$stats = FALSE;
else
$stats = TRUE;
if ($media_type == 'URLs') {
if ($stats)
$media_name=sb_display_url().sb_query_char().'show&amp;url='.rawurlencode($media_name);
} else {
if (!$stats)
$media_name=trailingslashit(site_url()).ltrim(sb_get_option('upload_dir'), '/').rawurlencode($media_name);
else
$media_name=sb_display_url().sb_query_char().'show&amp;file_name='.rawurlencode($media_name);
}
return sb_xml_entity_encode($media_name);
}

// Returns correct MIME type
function sb_mime_type($media_name) {
require (SB_INCLUDES_DIR.'/filetypes.php');
$extension = strtolower(substr($media_name, strrpos($media_name, '.') + 1));
if (array_key_exists ($extension, $filetypes))
return ' type="'.$filetypes[$extension]['content-type'].'"';
}

$sermons = sb_get_sermons(
array(
'title' => isset($_REQUEST['title']) ? stripslashes($_REQUEST['title']) : '',
'preacher' => isset($_REQUEST['preacher']) ? $_REQUEST['preacher'] : '',
'date' => isset($_REQUEST['date']) ? $_REQUEST['date'] : '',
'enddate' => isset($_REQUEST['enddate']) ? $_REQUEST['enddate'] : '',
'series' => isset($_REQUEST['series']) ? $_REQUEST['series'] : '',
'service' => isset($_REQUEST['service']) ? $_REQUEST['service'] : '',
'book' => isset($_REQUEST['book']) ? stripslashes($_REQUEST['book']) : '',
'tag' => isset($_REQUEST['stag']) ? stripslashes($_REQUEST['stag']) : '',
),
array(
'by' => 'm.datetime',
'dir' => 'desc',
),
1,
1000000
);

if (function_exists('wp_timezone_override_offset'))
wp_timezone_override_offset();

header('Content-Type: application/rss+xml');
echo '<?xml version="1.0" encoding="UTF-8"?>'."
";
?>
<rss xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
<channel>
<atom:link href="<?php echo sb_xml_entity_encode(sb_get_option('podcast_url')) ?>" rel="self" type="application/rss+xml" />
<title>Follow Church Podcast</title>
<itunes:author>Luke Williams</itunes:author>
<itunes:summary>Follow Church - Level 1 of the Toomah Community Centre in Lakeside Square, Pakenham, Victoria</itunes:summary>
<description>Follow Baptist Church Australia. Matthew 16:24: “Then Jesus said to His disciples, If anyone would come after me, he must deny himself and take up his cross and follow me”.</description>
<link><?php echo sb_xml_entity_encode(site_url()) ?></link>
<language>en-us</language>
<copyright>© 2015 Follow Church</copyright>
<itunes:explicit>no</itunes:explicit>
<itunes:owner>
<itunes:name>Pastor Luke Williams - Follow Church</itunes:name>
<itunes:email>lukew@followchurch.com.au</itunes:email>
</itunes:owner>
<itunes:image href="http://www.followchurch.com.au/follow-church-logo.jpg" />

<lastBuildDate><?php sb_print_iso_date(isset($sermons[0]) ? $sermons[0]: time()) ?></lastBuildDate>
<pubDate><?php sb_print_iso_date(isset($sermons[0]) ? $sermons[0]: time()) ?></pubDate>
<generator>Wordpress Sermon Browser plugin <?php echo SB_CURRENT_VERSION ?> (https://www.sermonbrowser.com/)</generator>
<docs>http://blogs.law.harvard.edu/tech/rss</docs&gt;
<category>Religion &amp; Spirituality</category>
<itunes:category text="Religion &amp; Spirituality"></itunes:category>
<?php
$mp3count = 0;
$accepted_extensions = array ('mp3', 'm4a', 'mp4', 'm4v','mov', 'wma', 'wmv');
foreach ($sermons as $sermon) {
if ($mp3count > 15)
break;
$media = sb_get_stuff($sermon);
if (is_array($media['Files']) | is_array($media['URLs'])) {
foreach ($media as $media_type => $media_names)
if (is_array($media_names) && $media_type != 'Code')
foreach ((array)$media_names as $media_name)
if (in_array(strtolower(substr($media_name, -3)), $accepted_extensions)) {
$mp3count++;
?>
<item>
<guid><?php echo sb_podcast_file_url($media_name, $media_type) ?></guid>
<title>Follow Church Podcast</title>
<link><?php echo sb_display_url().sb_query_char().'sermon_id='.$sermon->id ?></link>
<itunes:author><?php echo sb_xml_entity_encode(stripslashes($sermon->preacher)) ?></itunes:author>
<?php if ($sermon->description) { ?>
<description><![CDATA[<?php echo stripslashes($sermon->description) ?>]]></description>
<itunes:summary><![CDATA[<?php echo stripslashes($sermon->description) ?>]]></itunes:summary>
<?php } ?>
<enclosure url="<?php echo sb_podcast_file_url($media_name, $media_type).'" '.sb_media_size($media_name, $media_type).sb_mime_type($media_name); ?> />
<?php $duration = sb_mp3_duration($media_name, $media_type);
if ($duration) { ?>
<itunes:duration><?php echo $duration ?></itunes:duration>
<?php } ?>
<category><?php echo sb_xml_entity_encode(stripslashes($sermon->service)) ?></category>
<pubDate><?php sb_print_iso_date($sermon) ?></pubDate>
</item>
<?php
}
}
}
?>
</channel>
</rss>
<?php die(); ?>

29 January, 2015
3:09 pm
Extrafino
Enthusiast
Members
Forum Posts: 43
Member Since:
5 July, 2013
sp_UserOfflineSmall Offline

Hmm... it seems the url of your site is missing in the guid part. I just have not figured out why...

Did you change any other files?

It looks like sb_display_url is putting out nothing. This function is in sermon.php in the main directory of SermonBrowser.

29 January, 2015
11:01 pm
Kenna
Member
Members
Forum Posts: 5
Member Since:
14 January, 2015
sp_UserOfflineSmall Offline

Unfortunately this podcast has still not been indexed by iTunes and does not appear on their store. We have been in contact with iTunes to ask what the problem is and it seems that there are two problems… the first one was an easy fix, the second I don’t know how to fix…

1. The podcast feed link and audio file names have spaces in them (fixed)
2. The iTunes response tells me that the direct link to the audio file does not work. It’s true! I pulled the direct link from the podcast feed to one of the audio files and it takes me to the websites audio blog page, not directly to the audio file. Here’s an example: http://www.followchurch.com.au.....anuary.mp3 if you go here you don’t go directly to the audio file. The audio file link is actually here: http://www.followchurch.com.au.....anuary.mp3 so why is Sermon browser generating a feed that includes a link to a page on the website rather than linking to the file?

I went searching in the plugin options and I can see these settings, not sure if I need to change something here?
Upload folder: wp-content/uploads/sermons/
http://www.followchurch.com.au.....s/?podcast
Private podcast feed: http://www.followchurch.com.au.....s/?podcast
MP3 shortcode: Default:

Any help would be appreciated, I’m getting pretty desperate to find a fix for this. Thanks.

Forum Timezone: Europe/London
Most Users Ever Online: 381
Currently Online:
Guest(s) 7
Currently Browsing this Page:
1 Guest(s)
Top Posters:
Rich Brown: 358
Matt Schlueter: 93
Mindy: 72
Don Johnson: 65
anointed: 57
0be1: 55
Member Stats:
Guest Posters: 7
Members: 3188
Moderators: 1
Admins: 1
Forum Stats:
Groups: 1
Forums: 2
Topics: 1713
Posts: 7499
Newest Members:
marktest, deatles50, ValeriaGoodriz, dapedPup, oapedPup, Margarettoimb
Moderators: Ben Miller: 1628
Administrators: Mark Barnes: 435