• Resolved ralphsk

    (@ralphsk)


    Hi team,

    I am adding the URL to the media file while editing the post in the “podcast Episode Details” as follows: …com/wp-content/uploads/media.mp3

    When I publish and open the page and I try to play the podcast I get an error in the page console (404). Media file not found.

    The URL is changing from
    /wp-content/uploads/media.mp3
    to
    /podcast-player/51284/media.mp3

    Note that the number is the post ID number.

    Furthermore, on the feed page, when I click on the “Download Episode” I am redirected to this url: …com/podcast-download/52320/media.mp3 instead of the actual media file URL. I get the same 404 not found error.

    How can I fix this?

Viewing 15 replies - 1 through 15 (of 15 total)
  • Thread Starter ralphsk

    (@ralphsk)

    Hi team, any update on this? my podcasts are still not working, I need to get this fixed.

    Plugin Author Serhiy Zakharchenko

    (@zahardoc)

    Hi @ralphsk!

    I just tried to reproduce your issue on my site, and it works well for me. It means something goes wrong with either your server settings or the file path you provide.

    Regarding the /podcast-player/51284/media.mp3 and /podcast-download/51284/media.mp3 – it’s the correct behavior, these URLs should be automatically redirected to the real path (/podcast-player/51284/media.mp3).

    Questions:
    1. Did you try to upload the file in the standard way via the “Select file” upload button?
    2. Does it work when you use the upload button?
    3. Why do you want to put your audio files directly into the uploads folder?
    4. Could you please provide the file URL or feed example, so I could check what goes wrong?

    Best regards,
    Sergiy, development team.

    Hell @zahardoc ,

    I have the same problem. Can you help-me, please ?

    To answer your questions :

    1. I’ve always used standard import when creating a podcast. And until then it was always uploading my files to wp-content/upload/* and it was working fine. There were no issues until this week.

    2. The episodes are therefore uploaded in /wp-content/upload/*, but recently (after an update?), the code of the episode page indicates /player-podcast/ (and inevitably, it does not work)

    3. I want to put them in the right folder, but how?

    4. Of course, here is an example:

    (For the last podcast posted yesterday, I manually created a “podcast-player/23898” folder in which I put my renamed mp3, waiting for the problem to be solved)

    Thank you in advance !

    • This reply was modified 2 years, 2 months ago by kaeshohenheim. Reason: Additionnal info
    • This reply was modified 2 years, 2 months ago by kaeshohenheim. Reason: additionnal info

    (Well, since buggy podcasts cause problems for listeners, I also manually created a folder for the example given above and all other podcasts, manually put the mp3 in there after renaming them, waiting for your help. But the problem remains…)

    Plugin Author Serhiy Zakharchenko

    (@zahardoc)

    @ralphsk @kaeshohenheim

    Could you please try to put the following code in your functions.php file?

    add_filter('ssp_episode_download_link', function($link){
    	return str_replace( '.mp3', '', $link  );
    });

    @zahardoc Thank you for your quick response ! And Merry Christmas ! ??</img>

    Unfortunately, it doesn’t work… The URL in the code always targets the “podcast-player” folder (but when I start playback, nothing happens: the folder created manually while waiting for the fix is not taken into account) ??</img>

    Two more bugs have occurred: no podcast seems to be readable on Apple Podcast, and on Spotify, the podcast added after the appearance of the bug is not added to the list (but you can still listen old podcasts) ??</img> I don’t know if it’s related to the first bug, I I will advise once this one is fixed. It’s just for information.

    • This reply was modified 2 years, 2 months ago by kaeshohenheim. Reason: syntax fix
    Plugin Author Serhiy Zakharchenko

    (@zahardoc)

    @kaeshohenheim

    Did you remove the podcast-player folder that you created before? You don’t need to have that folder, that URL is just needed to have the possibility to count file downloads and listens with the Seriously Simple Stats plugin (and maybe other third party plugins). So, typically, that URL should be just automatically redirected to your real audio file.

    @zahardoc Thank you ! I just tested without the folder “podcast-player”. It still doesn’t work, but with your fix, I just saw “.mp3” no longer appears in the URL in the code. Now :

    It’s as if the redirection wasn’t done, but I haven’t changed anything on the site in the meantime… I just tried to put a clean htaccess back, without success. I also tried changing the slug, same thing, nothing works. And I also tried disabling all the other plugins before my very first post, with no result :/

    (I’m putting my provisional solution back in place while waiting for your response ?? )

    Plugin Author Serhiy Zakharchenko

    (@zahardoc)

    @kaeshohenheim

    It looks like you have not the same issue as @ralphsk.


    I’ll try to explain how it should work. When a browser hits the path like /podcast-player/2222/name-of-episode.mp3 , a server doesn’t find this path, and sends this request to PHP, which redirects the browser to the real audio file path (and, if the analytics plugin is enabled, counts the play hit). But in your case, for some reason, it looks like the request doesn’t reach PHP.

    So, I can see the following variants to solve it:

    1. Ask a developer to check the problem and fix it ( I guess it’s Apache settings ).
    2. Change hosting.
    3. Quick and dirty – use direct audio file links in the player. For it, put the following code in your functions.php file ( and remove the previous one ):

    add_filter( 'ssp_episode_download_link', function ( $link ) {
    	preg_match( '#\/podcast-download/([^/]*)/([^/]*)/?#', $link, $match );
    
    	if ( ! empty( $match[1] ) && is_numeric( $match[1] ) ) {
    		return ssp_frontend_controller()->episode_repository->get_enclosure( (int) $match[1] );
    	}
    
    	return $link;
    } );

    Hope this helps.

    Thank you very much for your detailed feedback! This therefore also explains why my hits stop at December 20, probably the date the problem appeared. Could this also have something to do with my Spotify page not updating anymore?

    The hosting in question is a shared hosting and I am the creator of the site (there is no developer, even if I have the fundamentals). Is there a specific PHP module that could be causing the problem?

    I applied your fix while waiting. For my part, I will contact the host immediately to find out if they have changed anything.

    (PS: Spotify is finally up to date with the use of your fix!)

    Plugin Author Serhiy Zakharchenko

    (@zahardoc)

    @kaeshohenheim

    Yes, maybe it’s a good idea to ask your hosting support to check it. Or maybe just move your site to another hosting.

    Thread Starter ralphsk

    (@ralphsk)

    couldn’t wait a week for a reply to my initial inquiry. I am using a different plugin now.

    Plugin Author Serhiy Zakharchenko

    (@zahardoc)

    @ralphsk

    Sorry to hear it. Hope that plugin fits your needs.

Viewing 15 replies - 1 through 15 (of 15 total)
  • The topic ‘Media file URL redirect’ is closed to new replies.