Page 1 sur 1

aide urgente

Posté : 06 févr. 2016, 22:42
par goldmasterplace
salut tout le monde je suis nouveau ici

j'ai un problème avec un script php qui a pour but convertir les vidéo en mp3

il me donne cette erreur après avoir mis en ligne un web.config

PHP Warning: preg_match(): Delimiter must not be alphanumeric or backslash in F:\Inetpub\vhosts\youtubeconvertermp3.us\httpdocs\robot.php on line 5 PHP Warning: preg_match(): Delimiter must not be alphanumeric or backslash in F:\Inetpub\vhosts\youtubeconvertermp3.us\httpdocs\robot.php on line 7 PHP Warning: preg_match(): Delimiter must not be alphanumeric or backslash in F:\Inetpub\vhosts\youtubeconvertermp3.us\httpdocs\lib\youtube.lib.php on line 18

le script robot.php

<?php
header("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1
header("Expires: Sat, 26 Jul 1997 05:00:00 GMT"); // Date in the past
require_once('lib/youtube.lib.php');
if (!preg_match('youtube.com|localhost', $_GET['url']))
{
if (preg_match('www.', $_GET['url']))
{
$_GET['url'] = str_replace('http://', 'http://www.', $_GET['url']);
}
list($video_id, $download_link) = get_youtube($_GET['url']);
?>
<p>
<img src="http://img.youtube.com/vi/<?php
echo trim($video_id);
?>/1.jpg" alt="Preview 1" class="ythumb" />
<img src="http://img.youtube.com/vi/<?php
echo trim($video_id);
?>/2.jpg" alt="Preview 2" class="ythumb" />
<img src="http://img.youtube.com/vi/<?php
echo trim($video_id);
?>/3.jpg" alt="Preview 3" class="ythumb" />
</p>
<p>
<a href="download.php?url=<?php
echo urlencode($download_link);
?>" class="ydl" title="Download as MP3">Download MP3</a>
<a href="download.php?url=<?php
echo urlencode($download_link . '&fmt=18');
?>" class="ydl" title="Download as MP4">Download MP4</a>
<a href="download.php?url=<?php
echo urlencode($download_link . '&fmt=17');
?>" class="ydl" title="Download as 3GP">Download 3GP</a>
</p>
<?php
}
else
{
die('<span style="color:red;">Sorry, the URL is not recognized..</span>');
}
?>

merci

Re: aide urgente

Posté : 06 févr. 2016, 22:58
par or 1
preg_match exige un caractère délimiteur, / par exemple, qui ne peut pas être une lettre comme c'est le cas à la ligne 5.

Re: aide urgente

Posté : 06 févr. 2016, 23:00
par goldmasterplace
merci or 1 comment je vais corriger svp

Re: aide urgente

Posté : 08 févr. 2016, 14:33
par Berzemus
Ton code vient d'un vieux script PHP qui date de 2009:
https://code.google.com/archive/p/php-y ... ownloader/

Comme il est dit sur la page du projet, il ne fonctionne plus et son développement est arrêté.

Il semblerait qu'au lieu de preg_match on y trouvait eregi, une commande désormais obsolète.

Même en corrigeant l'erreur:
if (!preg_match('/youtube.com|localhost/i', $_GET['url']))
Il est fort probable que le script ne fonctionne pas, et que les accès youtube qu'il offrait sont aujourd'hui périmés.

Lien intéressant: http://stackoverflow.com/questions/8965 ... utube-file

Re: aide urgente

Posté : 09 févr. 2016, 00:07
par @rthur
Modération :
Merci d'utiliser un titre clair et qui correspond bien à ta demande.
Les titres contenant "HELP !", "Aidez-moi", "J'ai un problème", "Ça marche pas",...
n'apportent rien à la compréhension de ta demande.

Par ailleurs, nous savons déjà par ton message que tu as besoin d'aide. ;)