#!/usr/bin/perl # version: 0.2 # USAGE: # ./itvp-dl URL # e.g.: # ./itvp-dl 'http://www.itvp.pl/player.html?mode=0&channel=452&video_id=30375' $url1 = $ARGV[0]; #print $url1; $html = `wget -O - '$url1'`; if ($html eq '') { die('Server sent me empty response. Maybe the URL you gave is incorrect?'); } my ($real_video_id, $video_id, $mode) = ($html=~ m//); $url2 = "http://www.itvp.pl/pub/stat/common/materialinfo2?real_video_id=$real_video_id\&video_id=$video_id\&mode=$mode"; $xml = `wget -O - '$url2'`; my ($format_id) = ($xml =~ m/format fsize=\"[0-9]*\" bitrate=\"700\" id=\"([0-9]*)\"/); if ($format_id eq '') { die('Server sent me response I didn\'t expect. Maybe the URL you gave is incorrect?'); } $url3 = "http://www.itvp.pl/pub/sdt/locator?mode=$mode\&format_id=$format_id"; $xml2 = `wget -O - '$url3'`; my ($request_id) = ($xml2 =~ m/([^<]*)<\/request_id>/); my ($session_id) = ($xml2 =~ m/([^<]*)<\/session_id>/); # tu wazny jest jeszcze jeden parametr # $url4 ma wygladac jakos tak: # http://www.itvp.pl/pub/sdt/itvp.asx?request_id=193.238.12.63_aBNk8J6Yyq2t2GASbRzdIxRnJOJapjWW_1210614634363&session_id=1014304866 $url4 = "http://www.itvp.pl/pub/sdt/itvp.asx?request_id=$request_id\&session_id=$session_id"; $xml4 = `wget -O - '$url4'`; my ($url5) = ($xml4 =~ m/(mms:\/\/[^\"]*)/); print("\n\n\n\nmovie URL: $url5\n"); system("mimms $url5");