Forum
Podcasts Episode URL
Hi, I was wondering if there was a way that Perch would rename the mp3 files as it's being uploaded. The default tracked URL is:
/podcasts/play/{showSlug}/{episodeNumber}.mp3
The only way to get the page to link to the file correctly is if I change the file name to the episode number .mp3 (for example 1.mp3, 2.mp3, etc.)
Am I not using this addon correctly? I would like to title each podcast with the date (2016-02-04) and upload my file as 2016-02-04.mp3 (if Perch cannot rename this file automatically, that's fine. I will manually rename the file before each upload). But then I'd like to have Perch create the appropriate link (/podcasts/play/slug/2016-02-04.mp3)
I tried editing the tracked URL to:
/podcasts/play/{showSlug}/{episodeTitle}.mp3
But that just broke the link and the episode title does not appear where it's supposed to. I end up getting:
/podcasts/play/slug/.mp3
There are two factors:
These shouldn't be the same - they need to be different in order to track downloads.
Is there additional documentation somewhere that explains how to do this? I checked through all those in the Perch documentation and it's not very helpful.
I used all the default example pages and everything works except for the play button on the actual podcast page. The html output URL is showing as:
/podcasts/play/slug/1.mp3
The play works just fine from the Perch admin side and is showing the actual URL as:
/perch/resources/uploaded-file-name.mp3
I guess my question is how do you link the tracked URL to play from the MP3 file in my resources folder (since the URLs are different)?
Are you using the example files that come with the app? The page function that tracks the play and redirects to the real file is
perch_podcasts_track_play()
https://docs.grabaperch.com/addons/podcasts/page-functions/perch-podcasts-track-play/
Yes, I am using the example files that come with the app. Where does the play.php file come into use (since that is where the perch_podcasts_track_play() function is located)?
The podcasts are showing up on episode.php as they should be, but the play button is grayed out. This is the html output I'm getting on this page:
I'm using all the default templates by the way.
Is the path correct?
The path matches the tracked URL, although that path does not actually exist because the actual file is located in /perch/resources/symphony_8.mp3
Do you have a rewrite rule in place to serve the tracked URL?
I do and although I'm not very familiar with rewrite rules (although I just read up on it), everything seems to be redirecting as it should.
I first tried entering in the address bar "https://www.pbbcgroton.org/podcasts/play.php?show=show1&ep=1" and that correctly directs me to the location of the mp3 file "https://www.pbbcgroton.org/perch/resources/symphony_8.mp3"
And my .htaccess has the correct entries:
Yet when I try "https://www.pbbcgroton.org/podcasts/play/show1/1.mp3" it cannot find the appropriate link.
As a test, I tried the following example and it redirected correctly to the mp3 file when I went to the contact page:
It makes me think the problem is within the first half of the rewrite rule.
Your rule begins with
play
but the example you gave is/podcasts/play
.Thank you so much! :)
That did it. Just a side note - that rule example was copied from the example .htaccess file from the download. And of course I didn't know enough to change it. But thanks again!
If you have trouble with rewrite rules, Perch Runway eliminates the need to create them.