App-get_flash_videos
view release on metacpan or search on metacpan
lib/FlashVideo/Site/Youku.pm view on Meta::CPAN
# Session ID seems to be just the Unix time + '1' + 7 random digits,
# the _00 part seems to mean something that I can't figure out
my $sID = sprintf "%s1%07d_00", time, rand( 10000000 ) ;
# Now these are funky
my ( $keyA ) = ( $json =~ /"key1":"([^"]+)"/ );
my ( $keyB ) = ( $json =~ /"key2":"([^"]+)"/ );
my $key = sprintf "%s%x", $keyB, hex( $keyA ) ^ hex( 'a55aa5a5' );
# Video title is in escaped unicode format
my ( $title ) = ( $json =~ /"title":"([^"]+)"/ );
$title =~ s/\\u([a-f0-9]{4})/chr(hex $1)/egi;
# Use the video title as the filename when available
my $filename = get_video_filename( $stream );
$filename = title_to_filename( $title, $stream ) if $title;
my ( $stream_info ) = ( $json =~ /"segs":{"$stream":\[([^\]]+)\]/ );
my @urls;
my $part_count = 0;
( run in 0.619 second using v1.01-cache-2.11-cpan-88abd93f124 )