Author: sparky
Date: Thu Feb 25 01:30:14 2010
New Revision: 11176

Modified:
   toys/rsget.pl/Link/YouTube
Log:
- uniq uris on the list


Modified: toys/rsget.pl/Link/YouTube
==============================================================================
--- toys/rsget.pl/Link/YouTube  (original)
+++ toys/rsget.pl/Link/YouTube  Thu Feb 25 01:30:14 2010
@@ -1,5 +1,5 @@
 # $Id$
-# Link::YouTube - Link decrypter plugin for rsget.pl
+# Link::YouTube - Link retriever plugin for rsget.pl
 #
 # 2010 (c) Przemysław Iskra <[email protected]>
 #              This program is free software,
@@ -20,12 +20,21 @@
        GET( $-{_uri} );
 
 stage_morelinks:
-       push @{$-{list}}, $1 while s#<a class="video-thumb-120" 
href="(/watch\?v=.*?)\&feature=PlayList##;
+       push @{$-{list}}, $1 while s# href="(/watch\?v=.*?)\&feature=PlayList##;
 
        if ( m{class="pagerCurrent".*<a 
href='(.*/view_play_list\?p=.{16}&page=\d+)' class="pagerNotCurrent" >}s ) {
                GET_NEXT( stage_morelinks, $1 );
        }
 
-       LINK( map "http://www.youtube.com$_";, @{$-{list}} );
+       my @list = @{$-{list}};
+       my %list;
+       my @outlist;
+       foreach ( @list ) {
+               next if exists $list{ $_ };
+               push @outlist, "http://www.youtube.com$_";;
+               $list{ $_ } = 1;
+       }
+
+       LINK( @outlist );
 
 # vim: filetype=perl:ts=4:sw=4
_______________________________________________
pld-cvs-commit mailing list
[email protected]
http://lists.pld-linux.org/mailman/listinfo/pld-cvs-commit

Reply via email to