Welcome Guest.   Make a donation to an author on the site September 02, 2010, 12:54:19 PM  *

Please login or register.
Or did you miss your validation email?


Login with username and password (forgot your password?)
Why not become a lifetime supporting member of the site with a one-time donation of any amount? Your donation entitles you to a ton of additional benefits, including access to exclusive discounts and downloads, the ability to enter monthly free software drawings, and a single non-expiring license key for all of our programs.


You must sign up here before you can post and access some areas of the site. Registration is totally free and confidential.
 
The N.A.N.Y. Challenge 2010! Download 24 new programs!
   
   Forum Home   Thread Marks Chat! Downloads Search Login Register  
Pages: [1]   Go Down
  Print  
Author Topic: tiny http server with podcast feeds?  (Read 1671 times)
electronixtar
Member
**
Posts: 138


View Profile WWW Give some DonationCredits to this forum member
« on: July 06, 2009, 07:15:44 PM »

Hi all,

I have a Windows Mobile phone with wifi, there's a CorePlayer which could play podcast feeds, now I need a tiny HTTP server under Windows for my laptop, that I specify a movies/mp3 folder, it starts up as a http server, and generate a podcast feed as well as deliver the .avi/.mp3 files. So my phone connect to my laptop via wifi, and I can listening to my mp3 lib everywhere at home.

I know IIS/apache could make it, it's just too big. Any tiny solutions?

Thanks in advance.
Logged

Ehtyar
Supporting Member
**
Posts: 1,194



That News Guy

see users location on a map View Profile Read user's biography. Give some DonationCredits to this forum member
« Reply #1 on: July 06, 2009, 07:40:42 PM »

I can recommend nginx and mongoose. I've had more experience with nginx, and it's quite a widely used, but little known web sever. Let us know what you decide on and if you run into trouble.

Ehtyar.
Logged
electronixtar
Member
**
Posts: 138


View Profile WWW Give some DonationCredits to this forum member
« Reply #2 on: July 06, 2009, 08:48:44 PM »

I can recommend nginx and mongoose. I've had more experience with nginx, and it's quite a widely used, but little known web sever. Let us know what you decide on and if you run into trouble.

Ehtyar.

mongoose is super cool. Thanks

I need to extend Mongoose to something like
http://127.0.0.1:8080/E/mp3/?format=podcast
or
http://127.0.0.1:8080/E/mp3/?format=m3u

any ideas?

Fixed it with some python script:

[copy or print]
#!/usr/bin/env python
#coding:utf-8

import os
import mongoose
import sys


def m3u_handler(conn, info, data):
    conn.printf('%s', 'HTTP/1.0 200 OK\r\n')
    conn.printf('%s', 'Content-Type: audio/x-mpegurl\r\n')
    r = '#EXTM3U\n\n' + '\n'.join( os.listdir(os.path.join(server.root,info.uri.replace('/:m3u', ''))))
    conn.printf('%s', 'Content-Length: %d\r\n\r\n' % len(r))
    conn.printf(r)

server = mongoose.Mongoose(ports='80', root='E:/Media') #os.getcwd())

server.set_uri_callback(r'*/:m3u', m3u_handler, 0)
#server.set_error_callback(404, error_404_handler, 0)

# Mongoose options can be retrieved by asking an attribute
print 'Starting Mongoose %s on port(s) %s ' % (server.version, server.ports)
print 'CGI extensions: %s' % server.cgi_ext

# Serve connections until 'enter' key is pressed on a console
sys.stdin.read(1)

# Deleting server object stops all serving threads
print 'Stopping server.'
del server

Usage: run the python script, it will share your E:\Media folder on http://127.0.0.1/

use http://127.0.0.1/:m3u to change the output format to .m3u with correct MIME
« Last Edit: July 07, 2009, 04:48:57 AM by electronixtar » Logged

4wd
Supporting Member
**
Posts: 885


...and then I lit the blue touchpaper.....

see users location on a map View Profile Read user's biography. Give some DonationCredits to this forum member
« Reply #3 on: July 07, 2009, 12:53:43 AM »

There's also the always handy HFS and in the forum there's a templates board where people share ones they've made - like the Thunderchicken of Glory.
Logged

Australia: The worlds newest dictatorship....or not after election 2010.
Ehtyar
Supporting Member
**
Posts: 1,194



That News Guy

see users location on a map View Profile Read user's biography. Give some DonationCredits to this forum member
« Reply #4 on: July 07, 2009, 01:28:44 AM »

electronixtar: niiiiice Thmbsup

Ehtyar.
Logged
electronixtar
Member
**
Posts: 138


View Profile WWW Give some DonationCredits to this forum member
« Reply #5 on: July 07, 2009, 04:17:55 AM »

There's also the always handy HFS and in the forum there's a templates board where people share ones they've made - like the Thunderchicken of Glory.

Wow, I didn't expect HFS has a template feature. Thanks.

Update:

HFS template seems to be HTML only, the players having a MIME trouble while parsing it as .m3u I believe.
« Last Edit: July 07, 2009, 04:49:58 AM by electronixtar » Logged

4wd
Supporting Member
**
Posts: 885


...and then I lit the blue touchpaper.....

see users location on a map View Profile Read user's biography. Give some DonationCredits to this forum member
« Reply #6 on: July 07, 2009, 06:37:23 AM »

HFS template seems to be HTML only, the players having a MIME trouble while parsing it as .m3u I believe.

A search for m3u turned up these:
.m3u or rss templates for HFS (customize MIME needed)
generate m3u playlist - folder-streaming

You might need to grab the latest beta for some of the new functions.
« Last Edit: July 07, 2009, 06:40:44 AM by 4wd » Logged

Australia: The worlds newest dictatorship....or not after election 2010.
electronixtar
Member
**
Posts: 138


View Profile WWW Give some DonationCredits to this forum member
« Reply #7 on: July 07, 2009, 07:38:12 AM »

HFS template seems to be HTML only, the players having a MIME trouble while parsing it as .m3u I believe.

A search for m3u turned up these:
.m3u or rss templates for HFS (customize MIME needed)
generate m3u playlist - folder-streaming

You might need to grab the latest beta for some of the new functions.

Thanks 4wd.

place this filelist.tpl under the same dir as hfs242.exe,

[copy or print]
#EXTM3U
%files%
[style]

[files]
{.mime|audio/x-mpegurl.}

%list%

[file]
%item-url%

[folder]
%item-name%/

http://localhost/mp3/~files.lst.m3u

works great!
Logged

Pages: [1]   Go Up
  Print  
 
Jump to:  
   Forum Home   Thread Marks Chat! Downloads Search Login Register  

DonationCoder.com | About Us
DonationCoder.com Forum | Powered by SMF
SMF © 2006-2009, Simple Machines LLC

social bookmark this page