sigrok decoder for caliper
[mirrors/Programs.git] / php / skripty / wmvbot.php
CommitLineData
8de51304
H
1<?php\r
2//Jyxo seek\r
3//<-Harvie (2oo7)\r
4\r
5function url_bot($url) {\r
6 $file = file($url);\r
7 $file = implode("\n", $file);\r
8 $file = spliti("http://", $file);\r
9 //print_r($file);\r
10 $urls[-1] = "";\r
11 $i = 0;\r
12 foreach($file as $url) {\r
13 $url = split(">| ", $url);\r
14 //print_r($url);\r
15 $url = $url[0];\r
16 if(eregi(".com", $url)) {\r
17 $urls[$i] = "http://".$url;\r
18 $i++;\r
19 }\r
20 }\r
21 //print_r($urls);\r
22 return($urls);\r
23}\r
24\r
25function wmv_bot($url, $ext) {\r
26 foreach(url_bot($url) as $url) {\r
27 $file = file($url);\r
28 $file[-1] = "";\r
29 $file = implode("\n", $file);\r
30 $file = spliti("http://", $file);\r
31 //print_r($file);\r
32 $urlz[-1] = "";\r
33 $i = 0;\r
34 foreach($file as $url) {\r
35 $url = explode(">", $url);\r
36 $url = $url[0];\r
37 if(eregi(".com", $url) && eregi($ext, $url) && !eregi(" |\"", $url)) {\r
38 $urlz[$i] = "http://".$url;\r
39 $i++;\r
40 }\r
41 }\r
42 print_r($urlz);\r
43 }\r
44 return($urlz);\r
45}\r
46\r
47//\r
48function download_url_array($results, $download_dir) {\r
49 //$download_dir = $GLOBALS["download_dir"];\r
50 $fails = 0; $done = 0;\r
51 echo("\nDownloading to $download_dir ...\n");\r
52 if(!is_dir($download_dir)) {\r
53 echo("Creating directory: $download_dir\n\n");\r
54 mkdir($download_dir);\r
55 } else { echo("\n"); }\r
56 foreach($results as $id => $url) {\r
57 $file = url2filename($url);\r
58 echo("Downloading $file (#$id)... ");\r
59 $file = "$download_dir\\$file";\r
60 if(!is_file($file) && @copy($url, $file)) {\r
61 echo("Done.\n");\r
62 $done++;\r
63 } else {\r
64 if(is_file($file)) { echo("File already exists "); }\r
65 echo("Failed!\n");\r
66 $fails++;\r
67 }\r
68 }\r
69 $totaldls = ($fails+$done);\r
70 echo("\n$done/$totaldls files successfully downloaded to $download_dir ($fails failed)\n");\r
71}\r
72\r
73///CODE//////////////////////////////////////////////////////////////////////////////////////\r
74$results = wmv_bot("http://www.loliti.com/cz/m/bonde19e_s_vodou_0.php", ".wmv");\r
75print_r($results);\r
76//download_url_array($results, "X:\\wmvBot"); //Automatic Download\r
77\r
78?>\r
This page took 0.281269 seconds and 4 git commands to generate.