User friendly stream URL's

Announcements and description of general changes in kPlaylist

User friendly stream URL's

Postby aba » Mon May 28, 2007 3:21 am

From build 443 kP supports 'free form' urls such as:

http://kpsite/music/streamsid_5888/c_99 ... myfile.mp3

replacing the original form:

http://kpsite/index.php?sid=5878&c=99-1111818111

This new form improves the functionality in a few audio players, especially WMP.

Enabling this feature consists of the following (recipe for Apache only)
Code: Select all
    RewriteEngine on
    RewriteCond %{REQUEST_URI} ^/music/.*
    RewriteRule ^(.+)          /index.php?path=$1


(Put this in a virtualhost or directory context.)

And enable in the script:

Code: Select all
$cfg['filepathurl'] = true;



If the name 'music' is occupied for your setup, change it in both the apache setting and this parameter inside kP: $cfg['filepathurlprepend']

It's recommend to put the above apache settings in a .htaccess file and this file should (must) reside in the same directory as the kPlaylist script.

Åge
Last edited by aba on Tue May 29, 2007 4:55 pm, edited 1 time in total.
aba
Site Admin
 
Posts: 2325
Joined: Wed May 08, 2002 9:19 am

Postby StephanD » Tue May 29, 2007 8:56 am

Hi,

i cant make it work, i have test both settings

$cfg['filepathurl'] = true;
and
$cfg['filepathurl'] = false;


this is what i get:



Image

any ideas?


Version 1.7.438 works fine and i use kpconfig.php also i did not change anything inside the script 1.7.445


my system:
Windows NT 5.1 build 2600 (incl. all service packs and patches)
MySQL 3.23.49
Apache 2.0.59 (Win32)
PHP 4.4.3

Thanks
StephanD
 
Posts: 10
Joined: Sun Aug 20, 2006 10:07 pm
Location: Germany

Postby aba » Tue May 29, 2007 11:08 am

StephanD wrote:Hi,

i cant make it work, i have test both settings

$cfg['filepathurl'] = true;
and
$cfg['filepathurl'] = false;


Add ini_set('display_errors', 'On'); in the top of the script (after <?php) and refresh the page. It should display the reason for the error.

Åge
aba
Site Admin
 
Posts: 2325
Joined: Wed May 08, 2002 9:19 am

Postby StephanD » Tue May 29, 2007 2:52 pm

Thank you, here is the error:

Fatal error: Call to undefined function: mb_strlen() in E:\htdocs\kplaylist.1.7.445.php on line 8265
StephanD
 
Posts: 10
Joined: Sun Aug 20, 2006 10:07 pm
Location: Germany

Postby aba » Tue May 29, 2007 3:03 pm

StephanD wrote:Thank you, here is the error:

Fatal error: Call to undefined function: mb_strlen() in E:\htdocs\kplaylist.1.7.445.php on line 8265


Ahh, found the bug, get 446 and try again please.
aba
Site Admin
 
Posts: 2325
Joined: Wed May 08, 2002 9:19 am

Postby StephanD » Tue May 29, 2007 4:29 pm

great, works fine now, thx :D
StephanD
 
Posts: 10
Joined: Sun Aug 20, 2006 10:07 pm
Location: Germany

Postby StephanD » Tue May 29, 2007 5:40 pm

]SNAKE[ wrote:Is anyone else having issues playing only one song at a time with this enabled?


nope, works fine

download multiple files by using winrar wont really work, it tells me the archive has been deleted
StephanD
 
Posts: 10
Joined: Sun Aug 20, 2006 10:07 pm
Location: Germany

Postby aba » Tue May 29, 2007 5:41 pm

]SNAKE[ wrote:Is anyone else having issues playing only one song at a time with this enabled?


What audio player are you using? (And are you sure the the apache rewrite is working?)
aba
Site Admin
 
Posts: 2325
Joined: Wed May 08, 2002 9:19 am

Postby StephanD » Wed May 30, 2007 7:29 am

my winrar problem...

V1.7.447 Line 10941
Code: Select all
<input type="hidden" name="file" value="<?php echo kp_basename($f); ?>"/>


should be?
Code: Select all
<input type="hidden" name="file" value="<?php echo basename($f); ?>"/>


on this way it works fine
StephanD
 
Posts: 10
Joined: Sun Aug 20, 2006 10:07 pm
Location: Germany

Postby aba » Wed May 30, 2007 4:08 pm

]SNAKE[ wrote:I may be way off but it seems there is a problem with $script when a playlist is generated with only one file. It looks like the $_SERVER['SCRIPT_NAME']; variable may not be behaving as expected.

Code: Select all
      $phpenv['streamlocation'] = $host.$script;



Here are both M3Us, notice how the URL in the M3U with one file is broken?

Broken:
Code: Select all
#EXTM3U
#EXTINF:234,Incubus - Privilege - Make Yourself
http://mydomain.com/kplaylist/music/sid_179233/c_1-916087986/stag_5c585c4626f0b743/music/streamsid_179233/c_1-916087986/stag_67585c4626f0b743/01-incubus-privilege-eos.mp3




Somehow it duplicates two requests, please try this instead:

Code: Select all
<Directory "/var/www/localhost/htdocs/kplaylist/">
    RewriteEngine on
    RewriteCond %{REQUEST_URI} ^/music/.*
    RewriteRule ^(.+)          /index.php?path=$1
</Directory>


Åge
aba
Site Admin
 
Posts: 2325
Joined: Wed May 08, 2002 9:19 am

Postby aba » Wed May 30, 2007 4:13 pm

StephanD wrote:my winrar problem...

V1.7.447 Line 10941
Code: Select all
<input type="hidden" name="file" value="<?php echo kp_basename($f); ?>"/>



Could you give me an example of what $f is set to? I am not able to reproduce any errors.

Edit: I've found the bug. Will release a new build soon.
aba
Site Admin
 
Posts: 2325
Joined: Wed May 08, 2002 9:19 am

Re: User friendly stream URL's

Postby Eukatae » Sat Oct 25, 2008 7:53 pm

aba wrote:From build 443 kP supports 'free form' urls such as:

http://kpsite/music/streamsid_5888/c_99 ... myfile.mp3

replacing the original form:

http://kpsite/index.php?sid=5878&c=99-1111818111


Åge



I could use a little help understanding how this is supposed to work. Per your example, with my current setup, "http://kpsite/music/streamsid_5888/c_99-1111818111/myfile.mp3" is not exactly "friendly".

If I attempt to use a similar URL my setup ignores everything after streamsid_x (it plays the song that corresponds with the streamsid), this makes perfect sense to me. What I don't understand is how I get to a place where I can intutively write a URL, like:

http://mysite.com/music/a band/an album by a band/ a song by a band.mp3
Eukatae
 
Posts: 8
Joined: Sat Oct 06, 2007 11:56 am

Re: User friendly stream URL's

Postby aba » Sat Oct 25, 2008 7:59 pm

Eukatae wrote:
aba wrote:From build 443 kP supports 'free form' urls such as:

http://kpsite/music/streamsid_5888/c_99 ... myfile.mp3

replacing the original form:

http://kpsite/index.php?sid=5878&c=99-1111818111


Åge



I could use a little help understanding how this is supposed to work. Per your example, with my current setup, "http://kpsite/music/streamsid_5888/c_99-1111818111/myfile.mp3" is not exactly "friendly".

If I attempt to use a similar URL my setup ignores everything after streamsid_x (it plays the song that corresponds with the streamsid), this makes perfect sense to me. What I don't understand is how I get to a place where I can intutively write a URL, like:

http://mysite.com/music/a band/an album by a band/ a song by a band.mp3


Because you wold not have any security with that URL.
aba
Site Admin
 
Posts: 2325
Joined: Wed May 08, 2002 9:19 am

Re: User friendly stream URL's

Postby Eukatae » Sat Oct 25, 2008 9:05 pm

aba wrote:
SNIP!

Because you wold not have any security with that URL.


URL security isn't my concern; even so its not like 'http://kpsite/music/streamsid_5888' is inscrutable. If I wanted to harvest someones MP3 collection it would be much easier to to do it with streamsid #s than guessing artist, album, and song names. I could simply increment the streamsid_#.

Perhaps a URL like http://mysite.com/music/streamsid_21 shouldn't work, but it does, at least the way I have mine set up from following the above directions.
Eukatae
 
Posts: 8
Joined: Sat Oct 06, 2007 11:56 am

Re: User friendly stream URL's

Postby aba » Sat Oct 25, 2008 9:50 pm

Eukatae wrote:URL security isn't my concern; even so its not like 'http://kpsite/music/streamsid_5888' is inscrutable. If I wanted to harvest someones MP3 collection it would be much easier to to do it with streamsid #s than guessing artist, album, and song names. I could simply increment the streamsid_#.

Perhaps a URL like http://mysite.com/music/streamsid_21 shouldn't work, but it does, at least the way I have mine set up from following the above directions.


Well, obviously, you can turn off all security on a per site basis (as you did.) Realizing that, it is
of course possible to support such a streaming location as you mentioned. But, the main idea
behind the feature that came out, was to keep security intact while the audio clients would see
that the URL actually "felt" and looked like a direct file url.
aba
Site Admin
 
Posts: 2325
Joined: Wed May 08, 2002 9:19 am

Next

Return to Announcement



cron