Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PHP URL Problems #6

Closed
heywoodlh opened this issue Feb 23, 2022 · 6 comments
Closed

PHP URL Problems #6

heywoodlh opened this issue Feb 23, 2022 · 6 comments
Labels
bug Something isn't working

Comments

@heywoodlh
Copy link
Contributor

So I'm running Spodcast on my own server at home -- it is not accessible to the world.

I use FreshRSS for aggregating feeds. For some reason (I'm sure a misconfiguration on my end) the URLs for the media are all messed up when I try the default configuration and subscribing via FreshRSS.

This is what one of the media URLs looks like when I subscribe via FreshRSS (which is a web app running at http://freshrss.local):
http://freshrss.local/i/spodcast.local/The_Joe_Rogan_Experience/The_Joe_Rogan_Experience_-_1782_-_Daniel_Holzman.ogg

What it actually should be is this (notice that the freshrss.local piece is missing):
http://spodcast.local/The_Joe_Rogan_Experience/The_Joe_Rogan_Experience_-_1782_-_Daniel_Holzman.ogg

So for some reason it is prepending the URL of my FreshRSS web app to the media URL when I attempt to subscribe to the RSS feed.

I was able to workaround this by modifying The_Joe_Rogan_Experience's .index.php file and hardcoding the URL I use into the generated media URL:

$hardcoded_url = "http://spodcast.local{$_SERVER['REQUEST_URI']}";
...
...
echo "            <media:content url=\"".$hardcoded_url.$info->filename."\" medium=\"".$info->medium."\" duration=\"".$info->duration."\" type=\"".$info->mimetype."\" />\n";
...
...

I'm not proficient with PHP at all so is there a better way to solve this problem?

@Yetangitu
Copy link
Owner

(seems to be some problems with the new release, one moment...)

@Yetangitu
Copy link
Owner

OK, try again with the latest release, v0.3.7, available through pip install -U spodcast or from the repo.

@Yetangitu
Copy link
Owner

Yetangitu commented Feb 23, 2022

By the way, you'll want to either re-subscribe to your feeds in Spodcast or manually correct the feed .index.php to each show directory. Here's the required change:

--- a/spodcast/feedgenerator.py
+++ b/spodcast/feedgenerator.py
@@ -6,7 +6,7 @@ def RSS_FEED_CODE():
     return r'''<?php
 const SHOW_INDEX = "''' + RSS_FEED_SHOW_INDEX + r'''";
 const INFO = "''' + RSS_FEED_INFO_EXTENSION + r'''";
-$PROTOCOL + ($HTTPS) ? "https://" : "http://";
+$PROTOCOL = ($HTTPS) ? "https://" : "http://";
 header("Content-type: text/xml");
 $feed_name = "Spodcast autofeed";
 $feed_description = "Spodcast autofeed";

So, change that + after $PROTOCOL into an =. The problem was caused by a sticking Shift key on my (ancient) Model-M keyboard (Shift-= produces +), and this being PHP it happily accepted the nonsensical line as valid.

I tested with FreshRSS, it Works For Me™ using the default install of FreshRSS. If you still have problems they are caused by something else...

@Yetangitu Yetangitu added the bug Something isn't working label Feb 23, 2022
@Yetangitu
Copy link
Owner

Have you tried the latest release? Did it work?

@heywoodlh
Copy link
Contributor Author

Yes, it worked perfectly! Sorry I forgot to follow up.

@Yetangitu
Copy link
Owner

OK, thanks for letting me know, this issue can remain closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants