Advertisement
Guest User

Télécharger vidéos "vod-fms.canalplus.fr"

a guest
Dec 23rd, 2010
884
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 3.58 KB | None | 0 0
  1. <!--
  2.  
  3. Télécharger vidéos "vod-fms.canalplus.fr"
  4. -----------------------------------------
  5.  
  6. 1) Télécharger et installer un lecteur de flux RSS, par exemple ici :
  7. http://www.feedreader.com/releases/FeedReader314Setup.exe
  8.  
  9. 2) Télécharger et installer un simulateur de Apache, par exemple ici :
  10. http://sourceforge.net/projects/quickeasyphp/files/EasyPHP/5.3.4.0/EasyPHP-5.3.4.0-setup.exe/download
  11.  
  12. 3) Télécharger et installer de quoi télécharger les vidéos "vod-fms.canalplus.fr", par exemple ici :
  13. http://www.xi-soft.com/downloads/NXSetup_x86.zip
  14. (shareware gratuit 30 jours)
  15.  
  16. 4) (Si EasyPHP est installé et Apache démarré)
  17. Enregistrer ce code avec comme nom de fichier "index.php" dans le dossier "www" du dossier temporaire correspondant à EasyPHP (par exemple : "C:\Program Files\EasyPHP-5.3.3\www\index.php")
  18.  
  19. 5) (Si FeedReader est installé)
  20. Ajouter l'adresse "http://127.0.0.1/?rss=1" du flux RSS généré par ce code dans FeedReader
  21.  
  22. 6) Selectionner/Copier l'adresse dans les champs de texte des articles
  23.  
  24. 7) (Si NetTransport est installé)
  25. Ajouter le téléchargement avec les touches CTRL+U sur la fenêtre de NetTransport
  26.  
  27. 8) Valider
  28. Ca télécharge ! ;)
  29.  
  30. -->
  31. <?xml version="1.0" encoding="utf-8"?>
  32. <rss version="2.0">
  33. <channel>
  34. <title>http://127.0.0.1/?rss=1</title>
  35.  
  36. <?php
  37. function totext($string) {
  38. $string = htmlentities(str_replace(" "," ",str_replace("<","",str_replace(">","",$string))),ENT_NOQUOTES);
  39. return($string);
  40. }
  41. function nbsptosp($string) {
  42. $string = str_replace("&nbsp;"," ",$string);
  43. return($string);
  44. }
  45. if (@$_GET["rss"] == 1) {
  46. $url         = array("http://www.canalplus.fr/c-divertissement/pid3349-le-grand-journal.html","http://www.canalplus.fr/c-divertissement/pid3355-l-edition-speciale.html","http://www.canalplus.fr/c-divertissement/pid3350-salut-les-terriens.html","http://www.canalplus.fr/c-divertissement/pid3351-le-petit-journal.html","http://www.canalplus.fr/c-divertissement/pid3565-c-le-news-show.html","http://www.canalplus.fr/c-infos-documentaires/pid3353-la-matinale.html","http://www.canalplus.fr/c-infos-documentaires/pid1830-zapping.html");
  47. $search1_a   = totext('var videoId = "');
  48. $search1_b   = totext('";');
  49. $search1_c   = totext('<title>');
  50. $search1_d   = totext(' - CANALPLUS.FR</title>');
  51. $search2_a   = totext('<HAUT_DEBIT>');
  52. $search2_b   = totext('</HAUT_DEBIT>');
  53. $var1        = 0;
  54. while ($var1 < count($url)) {
  55. $code1       = totext(file_get_contents($url[$var1]));
  56. $code1_ab    = substr($code1,strpos($code1,$search1_a)+strlen($search1_a));
  57. $id          = substr($code1_ab,0,-(strlen($code1_ab)-strpos($code1_ab,$search1_b)));
  58. $code1_cd    = substr($code1,strpos($code1,$search1_c)+strlen($search1_c));
  59. $title       = substr($code1_cd,0,-(strlen($code1_cd)-strpos($code1_cd,$search1_d)));
  60. $code2       = file_get_contents("http://service.canal-plus.com/video/rest/getVideosLiees/cplus/".$id);
  61. $line        = explode("<HD>",$code2);
  62. $var2        = 0;
  63. $var3        = 1;
  64. while ($var2 < count($line)) {
  65. $line[$var2] = totext($line[$var2]);
  66. if (strpos($line[$var2],$search2_a) && strpos($line[$var2],$search2_b)) {
  67. $link = substr($line[$var2],strpos($line[$var2],$search2_a)+strlen($search2_a),-(strlen($line[$var2])-strpos($line[$var2],$search2_b)));
  68. echo "<item>
  69. <title><![CDATA[[".nbsptosp($title)."] [".date("d/m/Y")."] [Partie ".$var3."]]]></title>
  70. <description><![CDATA[<input type=\"text\" value=\"".$link."\" size=\"150\" />]]></description>
  71. </item>
  72. ";
  73. $var3++;
  74. }
  75. $var2++;
  76. }
  77. $var1++;
  78. }
  79. ?>
  80.  
  81. </channel>
  82. </rss>
  83. <?php
  84. }
  85. else {
  86. ?>
  87. <link href="?rss=1" rel="alternate" type="application/rss+xml" />
  88. <?php
  89. }
  90. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement