Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [PHP] uploader na megavideo - nie dziala..
chez
post
Post #1





Grupa: Zarejestrowani
Postów: 18
Pomógł: 0
Dołączył: 2.06.2008

Ostrzeżenie: (0%)
-----


witam,
próbuję napisać w PHP uploader który będzie wrzucał mi filmy z dysku (Linux) na megavideo, ale cos nie wychodzi :/
moze ktos pomoze? o to co juz napisalem:

  1. <?php
  2.        $COOKIE_FILE = '/tmp/cookie.txt';
  3.        $url = 'http://megavideo.com/?s=signup';
  4.        $ch = curl_init();
  5.        curl_setopt($ch, CURLOPT_URL,$url);
  6.        curl_setopt($ch, CURLOPT_COOKIEFILE, $COOKIE_FILE);
  7.        curl_setopt($ch, CURLOPT_COOKIEJAR, $COOKIE_FILE);
  8.        curl_setopt($ch, CURLOPT_FAILONERROR, 1);
  9.        curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
  10.        curl_setopt($ch, CURLOPT_TIMEOUT, 50);
  11.        curl_setopt($ch, CURLOPT_POST, 1);
  12.        curl_setopt($ch, CURLOPT_POSTFIELDS, 'action=login&cnext=&snext=&touser=&user=&nickname=LOGIN&password=HASLO');
  13.        $buffer = curl_exec($ch);
  14.        curl_close($ch);
  15.        echo $buffer;
  16.  
  17.        $url = 'http://megavideo.com/?c=upload';
  18.        $ch = curl_init();
  19.        curl_setopt($ch, CURLOPT_URL,$url);
  20.        curl_setopt($ch, CURLOPT_COOKIEFILE, $COOKIE_FILE);
  21.        curl_setopt($ch, CURLOPT_COOKIEJAR, $COOKIE_FILE);
  22.        curl_setopt($ch, CURLOPT_FAILONERROR, 1);
  23.        curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
  24.        curl_setopt($ch, CURLOPT_TIMEOUT, 50);        
  25.        curl_setopt($ch, CURLOPT_POST, 1);
  26.        curl_setopt($ch, CURLOPT_POSTFIELDS, 'action=step2&title=tytul&description=opis&tags=tagi&language=1&channel=23');
  27.        $buffer = curl_exec($ch);
  28.        curl_close($ch);
  29.        //echo $buffer;
  30.  
  31.        $url = 'http://www130.megavideo.com/upload_video.php';
  32.        $ch = curl_init();
  33.        curl_setopt($ch, CURLOPT_URL,$url);
  34.        curl_setopt($ch, CURLOPT_COOKIEFILE, $COOKIE_FILE);
  35.        curl_setopt($ch, CURLOPT_COOKIEJAR, $COOKIE_FILE);
  36.        curl_setopt($ch, CURLOPT_FAILONERROR, 1);
  37.        curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
  38.        curl_setopt($ch, CURLOPT_TIMEOUT, 50);        
  39.        curl_setopt($ch, CURLOPT_POST, 1);
  40.        curl_setopt($ch, CURLOPT_POSTFIELDS, '-----------------------------25542761920913r\n
  41. Content-Disposition: form-data; name="action"r\n
  42. r\n
  43. submitr\n
  44. -----------------------------25542761920913r\n
  45. Content-Disposition: form-data; name="tags"r\n
  46. r\n
  47. tagir\n
  48. -----------------------------25542761920913r\n
  49. Content-Disposition: form-data; name="title"r\n
  50. r\n
  51. tytulr\n
  52. -----------------------------25542761920913r\n
  53. Content-Disposition: form-data; name="language"r\n
  54. r\n
  55. 1r\n
  56. -----------------------------25542761920913r\n
  57. Content-Disposition: form-data; name="message"r\n
  58. r\n
  59. opisr\n
  60. -----------------------------25542761920913r\n
  61. Content-Disposition: form-data; name="channels"r\n
  62. r\n
  63. 23;r\n
  64. -----------------------------25542761920913r\n
  65. Content-Disposition: form-data; name="file"; filename="August3i.avi"r\n
  66. Content-Type: video/x-msvideor\n
  67. r\n
  68. RIFFe:x02');
  69.        $buffer = curl_exec($ch);
  70.        curl_close($ch);
  71.        echo $buffer;
  72.  
  73.  
  74. ?>


Login i Hasło podałem dla tych którzy chcą mi pomóc, aby zaoszczędzić czas na rejestracji.
Powód edycji: [erix] skasowałem dane dostępowe
Go to the top of the page
+Quote Post

Posty w temacie


Reply to this topicStart new topic
2 Użytkowników czyta ten temat (2 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 22.08.2025 - 21:03