Autor | Zpráva | ||
---|---|---|---|
msigmund Profil |
#1 · Zasláno: 4. 2. 2011, 00:37:31
Dobrý den,
trápím se s jedním skriptem pro přidávání videí z youtube. Skript jsem našel někde na internetu. Když vložím url videa a odešlu ho vyběhne mi: Warning: ereg() [function.ereg]: REG_EMPTY in ............url k souboru.............. on line 736 řádek 736 je tady číslo 6. if (isset($_POST['submit_file'])) { if (ereg('^(http://|http://www.)youtube.com/watch\?v=', $_POST['url'])) { $youtube_source = @file_get_contents($_POST['url']); @preg_match('#/watch_fullscreen\?video_id=([a-z0-9-_]+)&l=([0-9]+)&t=([a-z0-9-_]+)#i', $youtube_source, $video_codes); if (ereg($video_codes[1], $_POST['url'])) { if (file_exists('../files/'. $settings['filesdir'] .'/'. $video_codes[1] .'.flv') || file_exists('../files/image/'. $video_codes[1] .'.jpg')) { $random_key = substr(md5(uniqid(rand())), 0, 4 ); $file_name = $random_key .'_'. $video_codes[1] .'.flv'; $image_name = $random_key .'_'. $video_codes[1] .'.jpg'; } else { $file_name = $video_codes[1] .'.flv'; $image_name = $video_codes[1] .'.jpg'; } // Download file copy_file ('http://www.youtube.com/get_video?video_id='. $video_codes[1] .'&l='. $video_codes[2] .'&t='. $video_codes[3], '../files/'. $settings['filesdir'] .'/'. $file_name); // Download image copy_file ('http://img.youtube.com/vi/'. $video_codes[1] .'/default.jpg', '../files/image/'. $image_name); // Redirect redirect_page($settings['siteurl'] .'/admin/content.php?a=add_file&f='. $video_codes[1] .'.flv&i='. $video_codes[1] .'.jpg', $lang['file_downloaded']); } else { $youtube_error = $lang['invalid_url']; } } else { $youtube_error = $lang['invalid_url']; } } Děkuji všem za pomoc. |
||
Lamicz Profil |
#2 · Zasláno: 4. 2. 2011, 01:02:47 · Upravil/a: Lamicz
Začal bych asi tím, co je v tom poli z toho preg_match
var_dump($video_codes); |
||
msigmund Profil |
#3 · Zasláno: 4. 2. 2011, 10:06:25
Moc tomu nerozumím, ale nechal jsem si vypsat tu proměnou "$video_codes" a je tam array.
|
||
Časová prodleva: 13 let
|
0