m3u playlist search script

Discuss and share scripts and script files...
kotlmg
Posts: 298
Joined: 30 Jun 2010 17:14

m3u playlist search script

Post by kotlmg »

can any one please give me a script to list all the files in the selected m3u file or pls files. these two are playlist files. the moment i single click on the above files, all the contents of above files to be shown file wise , so that i can play the selected files in those contents. if any one can help me please.
basically i want m3u and pls file searching script in xyplorer.
thanks a lot.

CodeLobster

Re: m3u playlist search script

Post by CodeLobster »

in hopes i got your idea right heres something for you.

dont have .pls files but if they have the same fashion of .m3us it should be enough 4 ya either!

Code: Select all

 $d = readfile(<curitem>);
 $e = regexreplace ($d, "#(.*?)(.*)", "");
 replace $e, $e, "<crlf>", "|";
 replace $e, $e, "<crlf>", "";
 $f = substr("$e", 0, 1);
 replace $g, $e, "$f", "";
 open inputselect("Pick the file you want to play", $g);

highend
Posts: 13277
Joined: 06 Feb 2011 00:33

Re: m3u playlist search script

Post by highend »

@CodeLobster

It would try to open a filename without a path and this doesn't work (at least here).
One of my scripts helped you out? Please donate via Paypal

CodeLobster

Re: m3u playlist search script

Post by CodeLobster »

format of list im working with:

Code: Select all

#EXTM3U
#EXTINF:304,Hardknox 01 Coz I Can
C:\Music\Hardknox_01 Coz I Can.mp3
#EXTINF:346,Hardknox 11 Attitude  The Strongroom Mix
C:\Music\Hardknox_11 Attitude _The Strongroom Mix.mp3
post yours and i see what i can do.

kotlmg
Posts: 298
Joined: 30 Jun 2010 17:14

Re: m3u playlist search script

Post by kotlmg »

remove this
Last edited by kotlmg on 22 Jul 2011 10:42, edited 2 times in total.

kotlmg
Posts: 298
Joined: 30 Jun 2010 17:14

Re: m3u playlist search script

Post by kotlmg »

remove this
Last edited by kotlmg on 22 Jul 2011 10:41, edited 1 time in total.

kotlmg
Posts: 298
Joined: 30 Jun 2010 17:14

Re: m3u playlist search script

Post by kotlmg »

remove this.
Last edited by kotlmg on 22 Jul 2011 10:41, edited 1 time in total.

CodeLobster

Re: m3u playlist search script

Post by CodeLobster »

kotlmg wrote:hello sir,
you can do one thing. just extract the path names and show them as a list in xyplorer. using xyplorer's in built search command i can search for specific file in these playlists.
to execute a script you must ensure itll have at least one blank space before each line otherwise itll fail exactly as your screenshot displays.

see if this is what you want:

Code: Select all

   $d = readfile(<curitem>);
   $e = regexreplace ($d, "#(.*?)(.*)", "");
   $f = substr("$e", 0, 1);
   replace $g, $e, "$f", "";
   text $g, , , , w;
i added extra spacing so you may not be confused.

but: try the first code as i told you in this post, youll certainly like it more because then youll have a live filter small box at the bottom, left of the window.

j_c_hallgren
XY Blog Master
Posts: 5824
Joined: 02 Jan 2006 19:34
Location: So. Chatham MA/Clearwater FL
Contact:

Re: m3u playlist search script

Post by j_c_hallgren »

kotlmg wrote:hello sir i am using both the playlists .m3u and .pls.
the structure of m3u files on my system is as follows.

#EXTM3U
#EXTINF:0,Aata 1
D:\Latest Telugu Songs\Aata\Aata 1.wmv
--- and hundreds more ----

i tried your sample code, but it didn't work for me. please help me.
In the interests of keeping thread more readable for all, could you possibly please edit above post and delete the unneeded items? A sample of about 5-10 items in total showing various cases is more than sufficient in cases like this...thanks for your understanding!
Still spending WAY TOO much time here! But it's such a pleasure helping XY be a treasure!
(XP on laptop with touchpad and thus NO mouse!) Using latest beta vers when possible.

kotlmg
Posts: 298
Joined: 30 Jun 2010 17:14

Re: m3u playlist search script

Post by kotlmg »

remove this
Last edited by kotlmg on 22 Jul 2011 10:42, edited 1 time in total.

CodeLobster

Re: m3u playlist search script

Post by CodeLobster »

if you were able to run the second code ill do you a favor and repost the first code which will cover your searching needs partially at least, spacing fixed:

Code: Select all

   $d = readfile(<curitem>);
    $e = regexreplace ($d, "#(.*?)(.*)", "");
    replace $e, $e, "<crlf>", "|";
    replace $e, $e, "<crlf>", "";
    $f = substr("$e", 0, 1);
    replace $g, $e, "$f", "";
    open inputselect("Pick the file you want to play", $g);
the box will also hint on what files are missing if any.

define "multiple search options".

anyway multiple launch of selected items is not supported using script im afraid... (help > adv topics > scripting commands ref > inputselect)

selection of the player is a job for {portable} Open With Menu, refer to the help.

kotlmg
Posts: 298
Joined: 30 Jun 2010 17:14

Re: m3u playlist search script

Post by kotlmg »

remove this
Last edited by kotlmg on 22 Jul 2011 10:44, edited 1 time in total.

CodeLobster

Re: m3u playlist search script

Post by CodeLobster »

kotlmg wrote:hello sir
your code worked perfectly. can you please add in the context menu of search results
1. open with option
2. save the search results as another m3u file.
3. move the selected files on to top or bottom
4. delete selected files
5. how to include the inbuilt search feature of xyplorer with so many options.
6. thumbnail bigger view option
7. drag and drop of results into external applications
8. send to option to external media players etc
9.remove missing files etc
and also extend the above search for pls files also.
thanks a lot.
im afraid right click custom script-ed menus are not currently a feature, sorry.

kotlmg
Posts: 298
Joined: 30 Jun 2010 17:14

Re: m3u playlist search script

Post by kotlmg »

please give me the script for other options.

CodeLobster

Re: m3u playlist search script

Post by CodeLobster »

if your .pls files look like

[playlist]
NumberOfEntries=2
File1=INXS - Disappear.mp3
File2=C:\music\The Kills - Satellite.mp3

{done} ill add basic support for file1 (portable) currently not supported by the script.
{done, 2} the script will check for missing items and report found if any. missing items are not listed on final list anymore.

this is the way to go:

Code: Select all

   $cp = "<curpath>";
   $d = readfile(<curitem>);
   $flux = gettoken($d, "count", "<crlf>");
   $ring = 3;
   $list = "";
   $miss = "";
   WHILE ($ring <= $flux)
   {
   $play = gettoken($d, "$ring", "<crlf>");
   IF ($play == "") { break; }
   $split = gettoken($play, 2, "=");
   $test = substr($split, 1, 1);
   IF ($test == ":") {   }
   ELSEIF ($test != ":") { $split = "$cp\" . "$split"; }
   $exists = exists($split);
   IF ($exists == 1) { $list = "$list" . "$split|"; }
   ELSEIF ($exists == 0) { $miss = "$miss" . "$split<crlf>"; }
   $ring++;
   }
   IF ($miss == "") {   }
   IF ($miss != "") { text "item(s) found missing:<crlf>$miss", , , , w; }
   open inputselect("Pick the file you want to play", $list);
you have interesting options but again: xyplorer wont do the way you want im afraid. experienced users to the rescue?

1. open with option - not doable with script command inputselect, lack of support to custom menus
2. save the search results as another m3u file. - its not a search result, its just reading the actual file. no further options im afraid.
3. move the selected files on to top or bottom - sounds interesting but not doable with script command inputselect
4. delete selected files - not doable with script command inputselect, lack of support to custom menus
5. how to include the inbuilt search feature of xyplorer with so many options. - ask support team or fill in a proper wish topic?
6. thumbnail bigger view option - ask support team or fill in a proper wish topic?
7. drag and drop of results into external applications - why not use the xyplorer regular list? perhaps a script to backup found music in such lists then do what you want from target backup folder?
8. send to option to external media players etc - not doable with script command inputselect, lack of support to custom menus
9.remove missing files etc - i can think on a script to check for existence of files then rewriting a new list. let me know if youre interested.

Post Reply