![]() ![]() The cookie is used to store the user consent for the cookies in the category "Analytics". This cookie is set by GDPR Cookie Consent plugin. These cookies ensure basic functionalities and security features of the website, anonymously. Necessary cookies are absolutely essential for the website to function properly. The final source code can be found in my GitHub repository. ![]() Even though having some offline podcasts stored locally is not a common use case, I had to implement my solution to solve the issue and decided to make it public and share it in case anyone else would like to use the same approach or build on it and make it better. I love hosting my own content in my own network. The downside of this approach is if this podcast is an active one and you want to refresh the feed, you will need to delete and re-add the feed because the ngrok address will have changed the next time you try to get the updates. You can stop ngrok and continue to play the episodes. The only thing that’s left is to open the podcast and play the episodes:Įven though Overcast cannot fetch the RSS feed over the local network, it can still play the episodes locally. In Overcast, I add the URL by clicking the + button on the top right and then clicking Add URL link.Īfter it fetches and parses the RSS feed, it should appear in your podcast list. GetFiles("*.mp3", SearchOption.AllDirectories) Var allMp3s = new DirectoryInfo(contentFullPath) Var feedFullPath = "/Temp/webroot/feed.rss" ĭescription = "Testing generating RSS feed from local MP3 files", Var contentFullPath = "/Temp/webroot/content" Now, update Program.cs with the code below: using ![]() The biggest change I made to the auto-generated version is to replace the single Item property in the Channel class with a List, as you will need multiple entries per podcast. Licensed under the Apache License, Version 2.0Ĭreate a file called Rss.cs in your project and paste the above code. The result looks like this (after a bit of formatting): /* There are tools that can generate C# classes from a sample XML, so you don’t have to manually create the classes yourself. To serialize to the XML above, you will need a data structure. If this feed were meant to be published publicly, you would add more details such as icons, categories, iTunes-specific tags etc., but for personal consumption, the following format is sufficient: Ĭreate a new dotnet console application: dotnet new console -name RssFeedGenerator -output. It includes the name and description of the show, as well as the titles and URLs of the individual episodes. Implement the RSS GeneratorĪn RSS feed is simply an XML file. In the next section, you will implement the application that creates the RSS feed so that you can consume the feed via your podcatcher too. you should be able to hear the MP3 playing. Now, if you request one of these files in your browser (e.g. So the root of your web server should look like this: Go to and download 2 MP3 files and rename them as “episode1.mp3” and “episode2.mp3”. To test the application, let’s start with a small amount of content. This is expected because you haven’t put any files to serve yet. If you open a browser tab and go to you should get a 403 Forbidden response from the web server. This way, you can manage the content without going into the container’s file system. This means when Nginx serves content in its HTML directory, it looks into the ~/Temp/webroot directory. Mounts the ~/Temp/webroot directory on your machine to the /usr/share/nginx/html directory on the container.Runs the container in the background as a daemon (-d).Maps port 9876 on your machine to the internal port 80 in the container. ![]() Run the following command to start your podcast server: docker run -name podcast-server -p 9876:80 -v ~/Temp/webroot:/usr/share/nginx/html:ro -d nginx In the tutorial, I will use the following path: ~/Temp/webroot. Since you will host only static files (RSS feed which is an XML file and some audio files), an Nginx instance running in a Docker container is sufficient.įirst, designate a local directory on your computer to put the files. To follow this tutorial, you need the following software installed: ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |