nonsmokingarea.com

michael kamleitner – web-consultant & -developer, vienna

Mobile Mobile
Feed RSS
Live Live

PHPTube – YouTube API for Video Upload & Download

Posted on | June 16, 2007 | 240 Comments

Attention: as of January 29th, I’ve decided to stop support for PHPTube! Due to recent changes in the YouTube uploading-process, uploading with PHPTube won’t work anymore! I recommend using the offical YouTube API, which can do uploads just fine! Since PHPTube is released under GPL, you’re of course free to adapt it!

You may want to try these tools instead:

YouTube’s API – basically a read-only set of RSS-feeds and XML/RPC-calls – currently doesn’t support scripted upload or download ofvideofiles. My quick hack PHPTube offers this featureset in a cleanly encapsulated PHP-class. Special interest goes to the upload-functionality, which virtually allows the integration of YouTube as a video-storage-backend into any other web-app. And while there are several download-scripts out there on the web, I’ve yet to find another uploader.

I’ve originally built PHPTube for using it within PLAY.FM (talking about automated upload of video-footage from our live radio-broadcasts), but since these things take some time I’ld love to hear if anyone out there has some use for my script…a simple digg would do as well ;)

Warning: due to changes in the YouTube’s HTML, all versions prior 0.1.7 are obsolete!

Download: PHPTube 0.1.7 (fixed bug in login)
Requirements: PHP, PEAR/HTTP

Attention: If you’re looking for PEAR, goto http://pear.php.net/ and read http://pear.php.net/manual/en/installation.getting.php!

Ports: Java-port of PHPTube (by James Schopp), Python-Port (by Sylvain Boily), Joomla-Plugin (download-only, by Mohamad Ballouk) – thx!

Using PHPTube? Consider a donation, to keep things rolling…thanks! :)

Comments

240 Responses to “PHPTube – YouTube API for Video Upload & Download”

  1. miob
    June 25th, 2007 @ 6:32 am

    hi !

    i’ve tried your script but, i get errors:

    Warning: require_once(HTTP/Client.php) [function.require-once]: failed to open stream: No such file or directory in ….

    i checked source and see:

    require_once ‘HTTP/Client.php’;
    require_once ‘HTTP/Request.php’;
    require_once ‘HTTP/Client/CookieManager.php’;

    i’m missing these files in that zip pack.

  2. subnet
    June 25th, 2007 @ 9:24 am

    as mentioned, the PEAR/HTTP-module which should include all 3 classes is a pre-requirement. on linux/*nix try these commands:

    pear list
    pear install HTTP

  3. miob
    June 25th, 2007 @ 11:15 am

    oh sorry, i have it installed now.
    even when i go to run demo.php i get

    Download done! File: demo.flv

    can you a little bit explain how it does work ?
    cuz i don’t see any video in my youtube acc.

    what happens in this row:
    $tube->download(“TWZ5j-SNVKs”,”demo.flv”);

    what kind of extension of movies i can use ? or must i have all movies convert to flv before ?

  4. subnet
    June 25th, 2007 @ 11:34 am

    hi miob…

    sorry for the lack of inline documentation… I shall add some comments soon. briefly said there are two main methods (as you can see in demo.php):

    1) Download of existing YouTube-clips

    $tube->download(“TWZ5j-SNVKs”,”demo.flv”);

    parameter 1 (“TWZ5j-SNVKs”) is the unique ID as you find it in the YouTube-URL of a particular video (“http://youtube.com/watch?v=TWZ5j-SNVKs”).
    parameter 2 (“demo.flv”) is the filename the video is stored to locally

    2) Upload of new Clips to YouTube

    $id = $tube->upload (“/path/to/videofile.3gp”,”PHPTube Demo”, “Demo PHP YouTube”, “…”, 10, “DE”);

    Parameters: local path to video-file, video-title, video-tags, description, category, language
    Return: ID of the new Video-Clip

    it’s important to initialize the class with you YouTube username & password to make the upload work!…

    $tube = new PHPTube (“username”,”password”);

  5. miob
    June 25th, 2007 @ 1:26 pm

    yeah perfect,
    so in this case i use only:

    $tube = new PHPTube (“user”,”pass”);
    $id = $tube->upload (“videofile.3gp”,”PHPTube Demo”, “Demo PHP YouTube”, “…”, 10, “DE”);

    i got response “No URL given.”

    videofile.3gp file exists in same directory as is demo.php

    i veven noticed that if i put wrong pass word to youtube it doesn’t tell me that i was wrong…

    let me know what i’m wrong

  6. subnet
    June 25th, 2007 @ 7:58 pm

    hi again..

    Im pretty sure this missleading error-message is a result of wrong username/password (I’ve just tried it mysel). I’ve bugfixed this in 0.1.1 …

    thx!

  7. miob
    June 25th, 2007 @ 8:35 pm

    Perfect, i updated latest version

    my resut was:
    Upload done! ID: BB7AaDZ20bs

    i checked it on the site and found it.
    can you tell me how do i get embedded code if i got id ?

    and tell me please what extensions i can upload to youtube…

    thanx

  8. subnet
    June 25th, 2007 @ 8:44 pm

    cool, glad it worked!

    about the supported file-formats: check this: http://www.google.com/support/youtube/bin/answer.py?answer=55744&topic=10526
    in addition it seems to work with 3GP and some other formats…

    about the embedded code: just use the normal embed-code from any other video, just be sure to replace both occurences of the ID (f.e. “rYOxP_j64vQ”) with the new ID!

  9. miob
    June 25th, 2007 @ 9:40 pm

    AWESOME !!!

    Very excellent job !

    i see you tube allows to upload up to 100mb, i must handle it on my server, do you know any utility what to show to user while he’s waiting for upload , something nice..

    i like dailymotion.com upload graphics, it’s kicking ass, do you know something nice ?

    i think i should donate , with your help ;-)

  10. subnet
    June 26th, 2007 @ 11:41 am

    you might wanna search for flash+file+upload to find some ready-to-use flash solutions for file uploads…

    http://www.google.com/search?q=flash%2Bfile%2Bupload

  11. inthesky
    June 27th, 2007 @ 7:21 pm

    Thx for the script. It works! But when I try to upload a video little bigger(23MB), i have the following warning:

    Maximum execution time of 30 seconds exceeded in phptube.php on line 97

    Is there anyway to fix it?

  12. subnet
    June 27th, 2007 @ 7:30 pm

    @inthesky: increase the setting max_execution_time in your php.ini (usually somewhere like /etc/php5/apache2/php.ini). dont forget to restart apache!

    if you cant edit php.ini (like if you’re no root/admin) you might wanna try ini_set:

    http://at.php.net/manual/en/function.ini-set.php

  13. inthesky
    June 27th, 2007 @ 9:33 pm

    thx:)

  14. inthesky
    June 29th, 2007 @ 2:16 pm

    hi again! I created a upload page in my site. But when i upload, it gives me the following warning (but i get a video ID returned):

    A PHP Error was encountered
    Severity: Warning
    Message: fread() [function.fread]: Length parameter must be greater than 0
    Filename: HTTP/Request.php
    Line Number: 945

    (For uploading the video from client-side to my server, i use php form and put the video in a certain place for using your script.)

    Do you know what is the problem?

  15. inthesky
    June 29th, 2007 @ 2:21 pm

    ah, for the ini_set, i tried it for a public php server, but it seems doesn’t work. Can a server be configurated to reject it?

  16. subnet
    June 29th, 2007 @ 3:13 pm

    @inthesky: sorry, without seeing the code I really can’t tell where’s the problem.

    regarding ini_set: yes, It’s quite likely that public/shared servers disable some of the php.ini-settings for normal users…

  17. elie
    June 30th, 2007 @ 3:49 pm

    Hello,
    I am using PHPTube..
    at first it worked very well…but now I am getting “L PUBLIC” as the ID of the File
    I have uploaded…does anybody know why I am getting this.

    Thanks again Guys..

    Elie

  18. subnet
    July 1st, 2007 @ 12:39 pm

    hi elie, I just investigated on the problem and found the reason… YouTube apparantly has slightly changed their upload-forms (which my class relies on)…PHPTube 0.1.2 should fix the problem!

  19. Elie
    July 1st, 2007 @ 3:57 pm

    Thanks “subnet”. I will test it and then brief you on the results….
    Thanks again for the effort…and keep up the good job..

    Elie

  20. nonsmokingarea.com » Blog Archive » YouTube + Google Maps / PHPTube 0.1.2
    July 1st, 2007 @ 5:13 pm

    [...] a side-effect of this update, some commenters noticed that my video upload-API PHPTube has been broken by these changes. todays release 0.1.2 is [...]

  21. inthesky
    July 2nd, 2007 @ 3:19 pm

    hi, i have changed the new version and it works well. thanks. And I would like to make my page more beautiful. Do you know if youtube gives an API for feeding back the rate of progress for the upload?

  22. subnet
    July 2nd, 2007 @ 3:23 pm

    @intehsky: well done!
    unfortunately there’s no way to get the upload-progress when uploading to youtube :(
    just curious, where do I find your site?

    btw.: if you like PHPTube, don’t forget to vote for it at http://www.phpclasses.org/vote.html – your vote is appreciated very much! (you need to sign up for phpclasses to vote…which is really worth the effort as its a constantly good source for php-code).

  23. nonsmokingarea.com » Blog Archive » PHPTube nominated f. PHP Innovation Award
    July 10th, 2007 @ 1:23 am

    [...] noticed that my YouTube-hack PHPTube has been nominated for June’s PHP Innovation Award at PHP Classes, cool! weither you’re [...]

  24. Tommy
    July 11th, 2007 @ 8:39 am

    Thank you for that great class!!

  25. doga doga
    July 18th, 2007 @ 6:30 pm

    it’s a good class, but the big problem with it is it’s requirness ! of pear, and not
    everybody have it :(

  26. subnet
    July 19th, 2007 @ 8:20 am

    hm, I thought PEAR is pretty much standard nowadays…I might be wrong though…

  27. rick moss
    July 19th, 2007 @ 11:12 am

    hi

    i have downloaded the 0.1.2 version of the class from top of this page and i am getting back ‘L PUBLIC ‘.

    Has youtube changed again or is this link not to new version ?

    Please help.

    Best Regards
    Richard Moss

  28. subnet
    July 19th, 2007 @ 11:28 am

    @rick moss: the link above should be correct, to make sure check phptube.php for the exact version-info.

    also, I just tried it with the supplied demo.3gp-file and it everything seems ok. maybe it’s a matter of your video-file (too large?), my class currently doesn’t parse error message from youtube.

  29. rick moss
    July 19th, 2007 @ 4:16 pm

    no probs got it working now
    thanks

    great class !

  30. markus
    July 21st, 2007 @ 10:04 pm

    does this require PHP 5 ? I am running 4.4.6 and get the following error:

    http://media.d1tv.net/mark/youtube/phptube.php

    thanks
    markus

  31. subnet
    July 22nd, 2007 @ 12:31 pm

    you’re right markus, there are some syntax-problems with PHP 4.x – version 0.1.3 (link above) should fix this… thx!

  32. Derek
    July 28th, 2007 @ 4:53 pm

    Hello everyone, I’m wondering how do I upload videos onto youtube. I have a Youtube account but It is so confusing, I Click the Upload at the top right corner of the site but it doesn’t work.

    Please give me a reason or how i can do it properly

  33. subnet
    July 28th, 2007 @ 7:18 pm

    sorry, derek, if you’re looking for support using youtube, this blog is probably the wrong place ;) … you might wanna try youtube’s helpcenter – http://www.google.com/support/youtube/?hl=en_US

  34. Orlando
    July 29th, 2007 @ 12:47 am

    Hi, it’s possible to add a progress bar? i don’t know using a progress script?

  35. Orlando
    July 29th, 2007 @ 3:46 am

    Hi again, i added my vote to your phpTube, thaks for you code and works perfect but how can i add a progress bar? can i use a flash uploader with your phpTube? | like the original YouTube uploader | thanks and i will wait for your response and good look with the contest.

  36. miob
    July 29th, 2007 @ 10:12 am

    there are more scripts for sale on the internet
    try search on google…

    e.g. this:
    http://www.element-it.com/DEMOMULTIPOW.ASPX

  37. miob
    July 29th, 2007 @ 10:16 am

    even some free if you know flash..

    http://www.codeproject.com/aspnet/FlashUpload.asp

  38. Orlando
    July 31st, 2007 @ 4:35 pm

    emm… yes i know but how can i get the upload progress? it’s possible? i use PHP.. :) thank’s

  39. subnet
    August 1st, 2007 @ 1:15 am

    @orlando: it depends:

    a) do you want a progress bar when users are uploading stuff to _your_ server – go with one of the linked solutions
    b) do you want a progress bar when youre uploading to _youtbue.com_ – I’m pretty sure that’s impossible…

  40. Orlando
    August 1st, 2007 @ 1:30 am

    b) when upload to youtube, but i see in YouTube API support that exist an API to know the uploading progress

  41. subnet
    August 1st, 2007 @ 1:39 am

    can you give me the link to that information?
    I’m wondering, since I though YouTube doesn’t provide any API f. uploads, yet…

  42. guest
    August 2nd, 2007 @ 6:38 am

    how to install PEAR/HTTP-module for windows?

  43. JOCKSTER
    August 6th, 2007 @ 11:59 pm

    i also have that problem. Where can I dind these files?

    require_once ‘HTTP/Client.php’;
    require_once ‘HTTP/Request.php’;
    require_once ‘HTTP/Client/CookieManager.php’;

  44. lupanvi
    August 7th, 2007 @ 12:05 am

    [quote]how to install PEAR/HTTP-module for windows?[/quote]
    lo mismo me pregunto

  45. subnet
    August 7th, 2007 @ 9:36 am

    as already mentioned above, all three files are part of the PEAR/HTTP-module. on linux/*nix try these commands:

    pear list
    pear install HTTP

  46. subnet
    August 7th, 2007 @ 9:46 am

    windows-LAMP packages already contain PEAR, look for go-pear.bat. otherwise you might read:

    http://pear.php.net/manual/en/installation.getting.php

  47. lathes
    August 8th, 2007 @ 11:43 am

    I have your phptube working now on my site.
    Its working excellent.

    thanks

  48. lathes
    August 8th, 2007 @ 11:45 am

    oh and by the way congratualtions on the php award

  49. subnet
    August 8th, 2007 @ 11:48 am

    cool…if it’s a public site, drop us the url!

  50. lathes
    August 8th, 2007 @ 11:55 am

    i would love to show you it working but unfortunately its in a non public area of my site.

    sorry

  51. lathes
    August 8th, 2007 @ 11:59 am

    congratualations on the php award by the way.
    deserved !

  52. subnet
    August 8th, 2007 @ 12:22 pm

    thx! :)

  53. manmoncang
    August 9th, 2007 @ 1:28 pm

    how to setting PEAR in local web server? I try it, but fail.

  54. chandra
    August 16th, 2007 @ 1:22 am

    Hi,
    Sorry I have got a basic question. when we give upload and download interface from our website to upload to youtube whose bandwidth will be consumed?. even though we upload to youtube directly does our web hosting server bandwidth consumed?
    I guess we are making a direct socket connection from client to youtube so our bandwidth should not be used right?

    please clarify.

    thanks
    Chandra

  55. lupanvi
    August 17th, 2007 @ 5:08 am

    how to install PEAR/HTTP-module for windows?

  56. Ankit
    August 17th, 2007 @ 6:42 am

    How can upload video file using php and also convert that file in diffrent formet

  57. subnet
    August 17th, 2007 @ 3:17 pm

    not sure if I understand you correct, but if you’re gonna use phptube on your server for relaying uploads to youtube, you’ll consume bandwidth for every video twice: first, when uploading from the client to your server, and second when transferring the video from your server to youtube using phptube. playback-bandwidth of course is handled by youtube :)

    does that answer your question?

  58. subnet
    August 17th, 2007 @ 3:49 pm

    look out for a LAMP-distribution like XAMPP – this should already contain PEAR. look for go-pear.bat. otherwise you might read:

    http://pear.php.net/manual/en/installation.getting.php

    but I’ve already mentioned that above :(

  59. subnet
    August 17th, 2007 @ 11:04 pm

    ffmpeg is a tool commonly used to convert video…

  60. Chris
    August 20th, 2007 @ 10:05 pm

    I must be a dumb-fark or something but I cannot get HTTP_Client
    HTTP/Client.php to work properly. I’ve installed and uninstalled it
    a hundred different ways and I still get the same G_D D__N error.

    Can’t find HTTP/Client.php

    Even totally reinstalled pear and reloaded all modules..

    running CEntos 4.5

  61. Neo
    August 21st, 2007 @ 11:34 am

    Do u have any Latest release of the Class. I’m having problem with 0.1.3 version. Upload form is having problem… it doesn’t even accepting files been selected from usual ‘File Browse’ control. But it executes smoothly if we pass direct filename in to script itself, with the exception of file sizeupload (‘consta.flv’,”Upload Demo by Neo “, “Neo Demo PHP YouTube TEst”, “This test…”, 10, “EN”);

    and obviously i have to put ‘consta.flv’ to that same dir.

    If we go by Browse button and selecting file to upload from local machine then it fails at this line in PHPTube.php class

    >>>>>>>>>
    function upload ($video_filename, $video_title, $video_tags, $video_description, $video_category, $video_language, $public=true, $family=true, $friends=true)
    {
    if ($this->auth) {
    if (file_exists($video_filename)) {
    /// It’s getting out of the Loop..i dOn’t no why ..
    //isn’t it weired..happening…?
    >>>>>>>>>

    Please some body help me here…i’m relying on this great class for my webSite…unfortunately which is not wOrking for me!!

    I wonder by reading comments above, as most of the people manage to Upload pretty Huge size files!!!

    Please help me for God saKe..i’m having Broadband connection for my server(s..)!!! Still i cant even upload files with too small size.

    !!hOping for a favourable Reply!!
    !!Thanks in advance..!!

  62. subnet
    August 21st, 2007 @ 12:04 pm

    not sure if I’m getting your description of the problem, its rather confusing :(

    I guess you’ve built an upload-form for video-files which are than processed by phptube, right? besides youtube’s built-in size-limit for videos (!), you should also consider that php limits file-uploads with the upload_max_filesize setting (php.ini).

    does your code work with small videofiles at all?

  63. Neo
    August 21st, 2007 @ 12:19 pm

    !!Thank You Very much for Your Reply!!
    yeah i have checked it already and i have set it as,

    ; Maximum allowed size for uploaded files.
    upload_max_filesize = 100M
    (before it was 32M)

    But my problem is this class is not accepting files from regular
    ….and i really have no idea why..? i think i must have done something wrong!!! in my previous comment, i have mentioned from where program control gets off!!

    could you please give me any code snipet..that will be great Help!!

  64. subnet
    August 21st, 2007 @ 12:26 pm

    what do you mean by “not accepting files from regular”?

    if the file_exists()-command fails, than you probably should check if the file is really where you tell phptube to look!

  65. Neo
    August 21st, 2007 @ 12:31 pm

    Also it working for small files but how it is working that i have already mentioned!! Still i’m mentioning once again…for clearing the picture!!
    Here is the scenario: i have to call function like this ONLY…

    $tube->upload (‘consta.flv’,”Upload Demo by Sag “, “SagDemo PHP YouTube TEst”, “This test…”, 10, “EN”);

    i.e static name which is ‘consta.flv’ in this case…then only it will upload ‘consta.flv’…also filesize of any file i put here should be less tah 4 or 5 MB then only script Uploads the File.

  66. subnet
    August 21st, 2007 @ 12:41 pm

    sorry, even after reading your post 3x I still don’t get it :)
    maybe someone else?

    if it’s working for small files but not for large ones, I still think it could be a matter of setting php.ini. considere that some php-installations have different php.ini’s for commandline-execution and execution through websevers (mod_php…).

  67. Neo
    August 21st, 2007 @ 2:53 pm

    i have already checked my php.ini settings.
    So here’s the deal … just paste some working code snipet or gimme(or mail me!!) some working upload script using phptube class!! which can upload 20-25 MB of file with related setting in php.ini…!! :)

    Or you want me to give(or mail) you my script…which is not at all working!!

    !!hOping for a favourable reply!!

    plz.

  68. Neo
    August 21st, 2007 @ 2:55 pm

    i think my html code is been filtered after regular…

    it was

  69. Neo
    August 22nd, 2007 @ 9:02 am

    Guyz, i Have sOlved that prOblem…!!!
    and i’m finding the vOte button …right now,…
    reaLLy…Mr.Subnet(..plz coz i don’t know ur real name..) thanks for everything!!!!

  70. Neo
    August 22nd, 2007 @ 10:40 am

    Now, i just have some questions…
    Is changing settings in php.ini…will cause some problems in any aspect.Means, i just wanna know how it will impact performance, by changing following settings…as

    max_execution_time=600
    max_input_time=120
    memory_limit=100M

    default_socket_timeout = 600

    post_max_size = 150M

    and also is this feasible to increase these values depending upon our traffic…

    Or am i doing something wrong…??

    Plz Guide me..i’m bit lost!!

    !!Thanks in Advance!!

  71. subnet
    August 22nd, 2007 @ 7:01 pm

    cool, glad to hear you got it sorted! :)

  72. subnet
    August 22nd, 2007 @ 7:03 pm

    from my understanding, these settings shouldn’t affect performance at all. if anything, the default_socket_timeout of 600 might lead to longer waiting until a connection times out, so you might wanna keep it lower.

  73. Neo
    August 23rd, 2007 @ 5:00 am

    Let me once again clear my question that even if 100-200 peoples using my website to upload variable size videos in that case also, specifically, max_execution_time=600
    this settings would not affect the performance of whole website.
    My concern is about those users who are not uploading and but just browsing…. and also the other users who are uploading video simultaneously!!

    Does apache uses multithreading or what!! … i don’t have that much knowledge :(

    Please guide me…!!!
    Your Help is precious to me..!!

    !!Thanks in advacne!!

    Regards,
    Neo

  74. Praveen
    September 1st, 2007 @ 6:24 am

    Hello Subnet!

    I get this same error as mentioned above.
    require_once ‘HTTP/Client.php’;
    require_once ‘HTTP/Request.php’;
    require_once ‘HTTP/Client/CookieManager.php’;

    Can you pls advise me to overcome this by anyother way??(bcz i’m hosting my site in a remote server…)

    any codes to replace that without using pear ??????

    pls help.
    thnx in advance

  75. subnet
    September 1st, 2007 @ 10:04 am

    sorry, phptube won’t work without pear & the http-client/cookie manager is not easily replaced.

    your hosting service can probably help you out with pear…

  76. Netflix
    September 6th, 2007 @ 7:18 pm

    Hi!

    Thank’s for this cool code. I’m beginner but i implemented easily this code. I uploaded many files (20 – 30 MB) and works great.

    Only i have a problem, this does not have an upload indicator.

    It’s possible use your PHPTube with this free SWF Upload script?

    please try :)

    http://swfupload.mammon.se/index.php

  77. Netflix
    September 6th, 2007 @ 10:23 pm

    Hi, i have a problem:

    I can’t upload files from other locations. When i upload a video from same location of my demo.php file work fine, but does not work for me when i change the location:

    How can i change this:

    $id = $tube->upload (“C:\xampp\htdocs\phptube\demo.flv”,”sample”, “sample”, “…”, 10, “EN”);

    by…

    $id = $tube->upload (“C://xampp//htdocs//phptube//demo.flv”,”sample”, “sample”, “…”, 10, “EN”);

    ?

  78. Eugene
    September 13th, 2007 @ 3:16 pm

    Works great in PHP4, but because of the dependency on PEAR doesn’t work at all in PHP5. Please make a PHP5 version, or a version that works with CURL.

  79. subnet
    September 13th, 2007 @ 5:58 pm

    hm, actually I’ve developed this on PHP5 :)
    PEAR is of course available for PHP5 too!

  80. Eugene
    September 14th, 2007 @ 2:24 am

    class PHPTube {

    var $cookies;
    var $mgr;
    var $req;
    var $debug = false;
    var $auth = false;

    If it’s in PHP5 why are there “var” items in the classes. I’ve generally had to remove all the “var”s otherwise PHP5 gives me a white screen of death.

    Is there some compatibility mode for PHP5 to run PHP4 style classes.

    Sorry for the ignorance. Been banging my head against this for a few hours!

    I wrote a script that works fine under PHP4 but dies in PHP5 :-(

    Any help would be appreciated.

    Thanks,

    Eugene

  81. Eugene
    September 14th, 2007 @ 2:50 am

    Never mind. My fault. I had installed PHP5 as a cgi-bin binary so it would run in parallel with PHP5. When I installed the PEAR HTTP_Client module it only did it to the PHP4 version, not the PHP5 library.

    Works great now!

    For all those who might be having the same problem:

    # /usr/local/php5/bin/pear install HTTP_Client

    If it complains about /usr/local/php5/bin/php not being around, simply copy it or create a symbolic link.

    I’m a happy camper now!

    Ta!

    – Eugene

  82. subnet
    September 14th, 2007 @ 9:14 am

    cool! :)

  83. joe
    September 15th, 2007 @ 2:22 am

    hi,

    the upload function works fine, and after the upload, it prints the id of the video on youtube ($video_id) but i don’t get the video id as a return value of the function. what could be wrong?

  84. Praveen
    September 16th, 2007 @ 7:59 pm

    Well..Finally I could install PEAR!!
    So first of all i wud like to thank subnet for his gr8 help….

    It’s working fine now….
    But i get this error in demo.php

    Warning: fopen(http://www.youtube.com/get_video?video_id=&t=) [function.fopen]: failed to open stream: HTTP request failed! HTTP/1.1 404 Not Found in /home/naagayaa/public_html/phptube/phptube.php on line 100

    Can’t i get a user-interface when Uploading/downloading/browsing a video ???

  85. Praveen
    September 16th, 2007 @ 8:13 pm

    Can’t i upload directly to youtube without uploading/keeping a file in the server?(i’m using a remote server so my webspace is limited)
    Thank u

  86. Praveen
    September 16th, 2007 @ 8:47 pm

    Is there any integrated uploader form in phptube.php ?

  87. Brad
    September 17th, 2007 @ 9:51 pm

    I’ve installed apache 2, php 5, and then loaded in pear/http to work through the failed to open stream error. I’ve completely commented out your downloading source b/c I’m not interested in downloading the video only in uploading. I’ve encompassed your demo.php file into my own test.php file & hard-coded my username, password, and all other variables into it. When I open the test.php my browser now loads the page without errors (it took me 2 days to work through the errors!) but there is nothing displayed in my browser. When I look at the html source there is nothing created in the – it’s just blank. Any ideas?

  88. subnet
    September 18th, 2007 @ 11:08 am

    I’m pretty sure the reason for this is error is, that your php-installation doesn’t allow fopen on URLs! the next version of phptube will work-around this problem!

    about user-interface: sorry, phptube is intended as a backend-utility for integration in other web-services, so I’m not planning to add a user-interface!

  89. subnet
    September 18th, 2007 @ 11:21 am

    that doesn’t seem possible to me…

    the only way would be to run the php-script locally…that of course would work.

  90. JK
    September 20th, 2007 @ 3:57 pm

    It’s great work! Thanks a lot sharing the script.
    Can phptube delete video file on youtube?
    If so, can you tell me how?

  91. subnet
    September 20th, 2007 @ 4:05 pm

    thx JK…

    currently phptube can’t delete videos, but I’m planning to include this in the next release, scheduled probably for october!

  92. subnet
    September 20th, 2007 @ 4:10 pm

    I assume the script doesn’t upload properly (check my_videos on youtube!)?

    difficult to diagnose, if working correctly, the upload should output something like “Upload done! ID:… “…

    trying to activate debugging (“var $debug = true;” in phptube.php) maybe of help…

  93. Doug
    September 20th, 2007 @ 10:37 pm

    Has anyone ever used this for uploading many videos repeatedly? Has YouTube ever blocked their account?

    Thanks!

  94. peter
    September 21st, 2007 @ 10:36 pm

    i have the same question

  95. subnet
    September 22nd, 2007 @ 2:02 pm

    interesting question… I’ve certainly uploaded a fair amount of videos while developing, but I’m not running a production-site with phptube… anyone?

  96. Mashup Guide :: Notelets for 2007.09.25
    September 27th, 2007 @ 3:19 pm

    [...] There is a new YouTube API based on GData, but there is still upload and write-capabilities: YouTube API Blog: We hear you – we know that upload and other write capabilities are wanted by the community. These features are what we’re focusing on next. There is a PHP-based library that lets you do YouTube uploading: PHPTube – YouTube API for Video Upload & Download » nonsmokingarea.com. [...]

  97. julian
    September 28th, 2007 @ 7:03 pm

    I have installed pear,

    but i still get the require error because the files in /http dont actually exist ;)

  98. KayRules
    October 1st, 2007 @ 8:43 am

    To make sure you’ve installed PEAR/HTTP do the following:

    C:\PHP>pear install HTTP
    C:\PHP>pear install HTTP_Client
    C:\PHP>pear list

    Many thanks to PHPTube author for making such awsome script.

  99. low on blogging, high on schwag » nonsmokingarea.com » Blog Archive
    October 5th, 2007 @ 9:11 pm

    [...] very much going on jobwise. hold tight for some news during october, mainly a new version of phptube (I’m planning to include support for deleting files from youtube) and a relaunch of the [...]

  100. krishna
    October 7th, 2007 @ 1:39 pm

    Error: not authenticated!

    i am getting like this , what should i do

  101. krishna
    October 7th, 2007 @ 1:42 pm

    go tho pear and dowload the packagges

  102. Vamsi
    October 7th, 2007 @ 9:02 pm

    I wonder how to add peer/http module in windows system. I have designed a site and would like to add peer/http module to it? Help me

  103. Vamsi
    October 8th, 2007 @ 4:41 am

    Hi i found your code very useful. I have built a small webpage but i wonder what changes are to be done to addFile method to accept a path from which the video can be uploaded? I want to give path instead of file name to upload method.

  104. Rabih
    October 12th, 2007 @ 1:16 pm

    Hello,

    Actual I got the same error:

    Warning: require_once(HTTP/Client.php) [function.require-once]: failed to open stream: No such file or directory in ….

    require_once ‘HTTP/Client.php’;
    require_once ‘HTTP/Request.php’;
    require_once ‘HTTP/Client/CookieManager.php’;

    So please I need the missing files, any inputs will be much appreciated

    Regards heaps

  105. Varun Mehta
    October 17th, 2007 @ 6:41 pm

    Dude thanks a million. I had this working in JAVA, but with no knowledge in PHP was having problems translating, now that it’s done. I’ll put it on my site and credit it to you.

    Where do i point for ur link? The same blog ?

  106. Varun Mehta
    October 17th, 2007 @ 6:43 pm

    I have one more question on this file, instead of getting the video id, can we retrieve the embed URL for the same?

  107. Rabih
    October 17th, 2007 @ 7:31 pm

    Hello, plz some bofy provide the URL of PEAR, I’m not able to found it since 5 days and more :(

  108. subnet
    October 17th, 2007 @ 7:51 pm

    glad to hear phptube is of some use for you… :)

    yeah, a link to this blog would be great, thx!

  109. subnet
    October 17th, 2007 @ 7:59 pm

    sure, that would be possible… but I think it’s better to return the raw ID and let the developer (you ;) ) construct the embed-URL (this shouldn’t really be a problem).

    maybe I’m going to add an optional feature for this to the next version of phptube… (hopefully until the end of october…)

  110. subnet
    October 17th, 2007 @ 8:14 pm
  111. Rabih
    October 17th, 2007 @ 8:55 pm

    first off, I wanna test the script on the localhost, I have the Appserv from http://www.appservnetwork.com
    I went to http://pear.php.net/packages.php but I confused with which package I should download it.

    Any inputs is highly appreciated.

    Regards heaps

  112. Varun Mehta
    October 17th, 2007 @ 9:22 pm

    Yeah I read the embed code and it’s the URL, nothing different. Nice. Then it’s no pain at all…

    Thanks again.

  113. chris kweek
    October 19th, 2007 @ 2:07 pm

    Great tool!

    Just wondering whether you have:
    - an overview of the codes used for the different categories
    - an overview of the codes used for the languages (also: where do I see the reference to the language of the video)?

    Thanks!

    c

  114. subnet
    October 19th, 2007 @ 2:13 pm

    hi chris & thx f.t. comment!

    I don’t really have list of lang- & category-codes, but I guess you could easily extract this from the html-source of the original youtube-upload form (just look for the

    propably a good idea to include these in the the next release of phptube… :)

  115. George
    November 1st, 2007 @ 10:05 pm

    Whenever I try to upload files larger than 10MB, I get this error:

    CGI Timeout
    The specified CGI application exceeded the allowed time for processing. The server has deleted the process.

    Any way I can overwrite it without changing any settings in IIS? I’m running my PHP on IIS.

    Any workaround? Like breaking the temp file size down so the script doesn’t timeout?

  116. punglas
    November 7th, 2007 @ 6:22 pm

    I’m running the Demo.php and Youtube.php on a server and I would like to upload files located on my computer and not on the server (well on the server it works perfectly).
    Is it possible ?

  117. Rabih
    November 7th, 2007 @ 7:09 pm

    Hello, plz guys some help me with this, I’m not able to find the correct pear in order to test it on my local host, although My hosting is Yahoo! servers, and I’m using the appserv for my localhost.

    Any inputs is highly appreciated!

    Regards

  118. subnet
    November 8th, 2007 @ 12:08 pm

    yeah: put a simple http-upload-form on your server, which triggers phptube (preferrably as a background-process, so the enduser doesn’t have to wait).

  119. yli
    November 22nd, 2007 @ 2:02 am

    Here it is what i have instaled but i have the same error
    missing 3 files.

    xxxx@xxxx.biz [~]# pear list
    Installed packages, channel pear.php.net:
    =========================================
    Package Version State
    Archive_Tar 1.3.2 stable
    Auth 1.5.4 stable
    Auth_HTTP 2.1.6 stable
    Auth_RADIUS 1.0.5 stable
    Console_Getopt 1.2.3 stable
    Crypt_CHAP 1.0.1 stable
    DB 1.7.13 stable
    File_Passwd 1.1.6 stable
    File_SMBPasswd 1.0.2 stable
    HTTP 1.4.0 stable
    HTTP_Client 1.1.1 stable
    HTTP_Download 1.1.3 stable
    HTTP_Header 1.2.0 stable
    HTTP_Request 1.4.2 stable
    HTTP_Upload 0.9.1 stable
    Log 1.9.11 stable
    MDB 1.3.0 stable
    MDB2 2.4.1 stable
    MIME_Type 1.0.0 stable
    Net_POP3 1.3.6 stable
    Net_Socket 1.0.8 stable
    Net_URL 1.0.15 stable
    PEAR 1.6.2 stable
    Structures_Graph 1.0.2 stable
    System_Command 1.0.6 stable
    XML_Parser 1.2.8 stable
    XML_RPC 1.5.1 stable

  120. subnet
    November 22nd, 2007 @ 10:43 pm

    hm, looks like php doesn’t have included pear in the include-path.

    try to pass require_once the full path to the pear-libs, or check the include_path setting of your php.ini:

    http://at2.php.net/manual/en/ini.core.php#ini.include-path

  121. Robert
    November 25th, 2007 @ 7:24 pm

    Nice class.

    The only function I think needs to be added is the ability to download videos when they are marked as adult. Doesn’t seem to work for those.

  122. Doug
    December 5th, 2007 @ 9:20 pm

    Is there a version of this for MySpace??

  123. subnet
    December 25th, 2007 @ 3:28 pm

    Sylvain Bioly has released a python-port of PHPTube – http://proformatique.org/spip.php?article118

    great work, thx a lot!

  124. PHPTube goes Python, Java » nonsmokingarea.com » Blog Archive
    December 25th, 2007 @ 3:35 pm

    [...] in my inbox: Sylvain Boily from Puteaux, France has written a Python-port of my YouTube uploader PHPTube. earlier this year, James Schopp has ported the library to Java. now if only I’ld find some [...]

  125. pana emil
    January 13th, 2008 @ 9:35 pm

    Hy! Thanx for your great work! I have it on my website and it worked well until…I’ve got a big problem.
    The problem is the script uploads the file on youtube twice, and it’s duplicate…and the scripts enters the duplicate’s id in database…How I can resolve the problem, to upload just once the movie ? Thanx and I’m waiting for you to give me an email when you have a response here;) Thanx again!

  126. subnet
    January 13th, 2008 @ 9:41 pm

    hi pana,

    I’m quite sure you’ve accidentally called the upload-function twice… otherwise the video is of course only uploaded once!

  127. Danny
    January 14th, 2008 @ 6:29 pm

    Hi, Going back to an earlier question…

    http://swfupload.mammon.se/index.php
    “>

    I am desperately trying to make it so there is an animation whilst the file is uploaded to the server?

    Thanks, and great work.

  128. Jrap
    January 17th, 2008 @ 3:59 pm

    Hello. I take it the actions of PHPtube are to upload the video to my server then PHPtube uploads to youtube?

    If this is the case, what can i display to the user whilst the video is being processed by Youtube? I want to be able to display the uploaded video to the user after uploading?

    thanks for help!

  129. griffin1987
    January 22nd, 2008 @ 10:24 pm

    Of course you could use a library like ffmpeg to extract some frames from the video and build a gif with a library like IM out of these frames, and then display the gif to the user – you could as well display a simple placeholder image or a text – it’s all up to you.

    If you ask about something like a progressbar – well, take a look into how php works, if i’m not wrong it’s a server processed language which heavily relies on output buffering (don’t mix the internal buffering with the ob_* which are merely a set of flow-control functions), and thus it’s nearly impossible to do something like that with php only – but you could rewrite phptube in flash, which would give you not only the possibility to display a progressbar but also would have the benefit, that the video wouldn’t be uploaded twice and the bandwith of your server wouldn’t be consumed (of course, you could still also upload it to your server at the same time) – if you’re more programmer oriented as i am flex might be more of an option, as the flex sdk itself is free (at least of the time of writing these there is a small gray zone in the license which would allow you to use flex for smaller projects, if i’m interpreting the license right)

    Hope that helped you somehow – i just tried to answer your question because i’m looking into rewriting phptube at the moment for not using pear at the least, or, at the best, rewriting it in flex ;)

    greez griffin

  130. subnet
    January 25th, 2008 @ 10:02 am

    Update: V 0.1.4 fixes a problem with the download-method, caused by a recent change in YouTube’s HTML. If you’re only using phpTube’s upload-feature, you don’t have to upgrade.

    Thx to Nuno Luis for the fix!

  131. kesav
    February 11th, 2008 @ 9:47 am

    Hi subnet, i am able to upload videofile.3gp which is given by the code and other .3gp format files to youtube with our phptube, but i am not able to upload any other formats other than .3gp (i.e) like mpeg,avi,mov and all.. can you please guide me in this part.

    $id = $tube->upload (“TJ.mov”,”MovFormat”, “Demo Mov”, “…”, 10, “DE”);

  132. kesav
    February 11th, 2008 @ 9:56 am

    Hi subnet, i am able to upload videofile.3gp which is given by the code and other .3gp format files to youtube with our PHPTube, but i am not able to upload any format other than .3gp (i.e) like mpeg,avi,mov and all.. can you please guide me in this part.

    $id = $tube->upload (“TJ.mov”,”MovFormat”, “Demo Mov”, “…”, 10, “DE”);

  133. Antony
    February 18th, 2008 @ 1:39 pm

    Right now, the uploader doesn’t work anymore :(

  134. Antony
    February 18th, 2008 @ 1:40 pm

    Since today, the uploader doesn’t work anymore :(

  135. subnet
    February 18th, 2008 @ 1:44 pm

    I’ve just uploaded a test-file successfully… maybe there’s something wrong on your side…

  136. PeeZee
    February 19th, 2008 @ 11:00 am

    I’m afraid I have to confirm the upload feature is broken.

    Uploading a video seems to work, a video id is returned, but the movie never shows up on youtube.
    If you login to your account and check your movies, the movie is there, but there is a notice saying the movie is rejected due to a ‘violation of the terms and conditions”…

    Is Youtube blocking automated uploads ?

  137. subnet
    February 19th, 2008 @ 11:15 am

    hm, interesting… upload is still working for me (just tried it out again)!

    I suggest you try:

    a) using a different youtube-user
    b) running the script on a different server/IP

    just to see if that makes any difference…

  138. KC
    February 20th, 2008 @ 6:37 pm

    Hi,

    Thanks for creating this class. One question before I install. Are the youtube files saved to my local hard drive or can they be saved to a server. I would like my website users to be able to download their youtube videos to their online accounts on my site, and play them there as well. Is this possible?

    Thanks again

  139. subnet
    February 20th, 2008 @ 8:06 pm

    not sure if I got you right, but I guess the answer is “yes”.

    it works basically like this:

    1) users of YOUR website upload a video-file to YOUR server
    2) on your server, use phptube to upload the files to youtube

  140. manmoncang
    February 21st, 2008 @ 3:01 am

    Yeap….you are definitely right. But the server must be powerfull to handle of that process….upload to your webhosting then upload to youtube. (makesure video file not greater than 10MB)

  141. Delgardo
    February 21st, 2008 @ 8:22 am

    Why should the video file be not larger than 10 MB?

  142. YouTube-API finally supporting Uploads… :: nonsmokingarea.com
    March 12th, 2008 @ 12:45 pm

    [...] official blog-post), which finally enable uploading of video to their site. seems like my own hack, PHPTube, is therefor rendered obsolete, and for good… :) . the new API (see the developer guide) seems [...]

  143. subnet
    March 12th, 2008 @ 12:46 pm

    for everyone using PHPTube, you might want to take a look at:

    http://nonsmokingarea.com/blog/2008/03/12/youtube-api-finally-supporting-uploads/

    YouTube is finally supporting uploads through their API!

  144. StumpedGamer
    July 14th, 2008 @ 12:12 pm

    Hi there. Everything was working fine untill this morning.

    Now I get

    action: /my_videos_upload addresser: //W3C//DTD HTML 4.01 Transitional//EN file: – 1! Upload done! ID: 8Hob1sLX2eQ

    But when I check its not done it.

    It was working 100% yesterday.

  145. subnet
    July 14th, 2008 @ 12:15 pm

    strange, just tried it out and it still works for me.
    please try again from another host and with another youtube-user, to assure it’s nothing wrong there…

  146. StumpedGamer
    July 14th, 2008 @ 1:46 pm

    Hi there. I tried it with another YouTube account and it did the same thing. The script is on my own site that runs off its own dedicated server. So nothing was changed that end. Any idea?

  147. subnet
    July 14th, 2008 @ 2:02 pm

    hm, sorry, not really an idea.

    pls try the demo.php-script which is part of phptube and see of this works.

    also, pls try it on a different server/host!

  148. StumpedGamer
    July 14th, 2008 @ 3:47 pm

    Ok I used the demo.php file supplis and still the same. Interesting enoug the video id at the end is always the same.

    action: /my_videos_upload addresser: //W3C//DTD HTML 4.01 Transitional//EN file: ../stumpedgamer/Bioshock/001 – Introduction.avi Upload OK – 1! Upload done! ID: 8Hob1sLX2eQ

  149. Justin
    July 18th, 2008 @ 11:15 pm

    Youtube has changed thier my_videos page rendering php-tube broken, alot of u are probably getting L Public as and ID. heres the fix.

    in the upload function twords the end replace the 3 lines above print “Upload Done…..
    with

    $p = strpos($this->req->getResponseBody(),"'EditVideos', ['");
    $video_id = substr($this->req->getResponseBody(),$p+16,
    strpos(substr($this->req->getResponseBody(),$p+16),"']"));

  150. subnet
    July 19th, 2008 @ 9:42 am

    thx a lot Justin, I’ve released 0.1.5 and integrated your patch!

  151. Justin
    July 22nd, 2008 @ 1:24 am

    just a comment u might also want to update the getLast function with that same revision…. not a big deal i dont use that part of the api but other may.

  152. Justin
    July 22nd, 2008 @ 1:42 am

    people having issues with execusion time, if u have shell access to the box or the ability to run exec() i reccommend launching the phpTubeScript


    //pushYouTube.php

    $c = "/usr/local/bin/php pushYouTubeScript.php --fname=\"" . $_REQUEST['fname'] . "\" --title=\"" . $_REQUEST['title'] . "\" --desc=\"" . $_REQUEST['desc'] . "\" --category=\"" . $_REQUEST['category'] . "\"" > /dev/null &";
    exec(escapeshellcmd($c));

    then parsing the args in ur phptube handler script

    //pushYouTubeScript.php
    function arguments($argv) {
    $_ARG = array();
    foreach ($argv as $arg) {
    if (ereg('--([^=]+)=(.*)',$arg,$reg)) {
    $_ARG[$reg[1]] = $reg[2];
    } elseif(ereg('^-([a-zA-Z0-9])',$arg,$reg)) {
    $_ARG[$reg[1]] = 'true';
    } else {
    $_ARG['input'][]=$arg;
    }
    }
    return $_ARG;
    }
    $_ARG = arguments( $_SERVER['argv'] );
    ini_set("memory_limit", "256M");

    header("Content-type: text/xml");
    include_once ("phptube.php"); //location of php class relative to this file
    $uploaddir = "/wherefilewasuploaded";
    $tube = new PHPTube ("user","pass");
    $filename = $_ARG['fname'];
    $filename = str_replace("%20", "", $filename);
    $filename = trim($filename);
    $filename = $uploaddir . $filename;
    $vtitle = $_ARG['title'];
    $id = $tube->upload ($filename,$vtitle, "TAGS", "...", 10, "EN")

  153. Tommy
    July 22nd, 2008 @ 8:07 pm

    S**t, the script v0.1.5 doesn’t word for me anymore. I just got this debug message:
    action: http://lax-v173.lax.youtube.com/my_videos_post addresser: -fx5TP6EidzrPkpO_nMZS_caGHmzbI4LT5q9aE8FmoAj6T6Svcdij1mUK5NnxNKzpIeeWbmgb2-n4wzw_C917g== file: /srv/www/htdocs/www.mydomain.de/file/directory/videos/video.wmv
    That’s it :(

  154. subnet
    July 22nd, 2008 @ 8:48 pm

    thx a lot again, I’ve released 0.1.6. with this patch! :)

  155. subnet
    July 22nd, 2008 @ 8:49 pm

    strange, it should at least out out some error-message…no idea.
    I can confirm that uploading with 0.1.5 & 0.1.6 is basically working, for me!

  156. Tommy
    July 22nd, 2008 @ 9:12 pm

    Found the error. The file size was too large (10 MB).
    Your script works fine :)

  157. steveking
    July 28th, 2008 @ 10:15 am

    YouTubeRobot.com today announces YouTube Robot 2.0, a tool that enables you to download video from YouTube.com onto your PC, convert it to various formats to watch it when you are on the road on mobile devices like mobile phone, iPod, iPhone, Pocket PC, PSP, or Zune.

    YouTube Robot allows you to search for videos using keywords or browse video by category, author, channel, language, tags, etc. When you find something noteworthy, you can preview the video right in YouTube Robot and then download it onto the hard disk drive. The speed, at which you will be downloading, is very high: up to 5 times faster than other software when you download a single file and up to 4 times faster when you download multiple files at a time.

    Manual download is not the only option with YouTube Robot. You may as well schedule the download and conversion tasks to be executed automatically, even when you are not around. Downloading is followed by conversion to the format of your choice and uploading videos to a mobile device (if needed). For example, you can plug in iPod, select the video, go to bed, and when you wake up next morning, your iPod will be ready to play new YouTube videos.

    Product page: w ww.youtuberobot.com
    Direct download link: w ww.youtuberobot.com/download/utuberobot.exe
    web-site: w ww.youtuberobot.com

  158. rivella
    August 1st, 2008 @ 1:22 pm

    Did Youtube change the login procedure again? I’ve got “Login failed” when trying to upload a video :(

  159. André
    August 3rd, 2008 @ 8:25 pm

    Yes, since 1. August you got “Login failed” when trying to upload.

  160. zarembisty
    August 8th, 2008 @ 3:10 pm

    Do you have any idea how to fix the “Login Failed” problem or at least some vague clues about what has been changed on YouTube side regarding the login?

    Thanks,

  161. Justin
    August 8th, 2008 @ 6:27 pm

    after working out youtube fixes it ended up being very simple:

    Line 50: $url = “http://youtube.com/login?username=”.$username.”&password=”.$password.”&current_form=loginForm&action_login=1″;

    should be: $url = “http://www.youtube.com/login?username=”.$username.”&password=”.$password.”&current_form=loginForm&action_login=1″;

    the lack of www caused a redirect that made youtube loose it’s cookie lol.
    anywhoo. enjoy.

  162. subnet
    August 8th, 2008 @ 8:19 pm

    thx a lot, I’ll release a patch as soon as I’m back in office (next thursday)!

  163. Justin
    August 8th, 2008 @ 10:19 pm

    long live phptube youtube’s api is very lame right now even with their upload addins i prefer phptube.

  164. Roshan
    August 9th, 2008 @ 2:13 pm

    I change this url but steel i found login failed message please help me.

  165. Oak
    August 10th, 2008 @ 9:09 pm

    I get the print “action: “.$url.”\n”;
    print “addresser: “.$addresser.”\n”; from lines 185 and 186 but nothing else I looked on Youtube and the video is not there… any help. Thanks Much Oak

  166. subnet
    August 11th, 2008 @ 1:37 am

    just posted 0.1.7, which patches the recent login-troubles!

  167. Roshan
    August 11th, 2008 @ 7:19 am

    I use the same patch 0.1.7 but still login failed problem. please help me.

  168. Oak
    August 11th, 2008 @ 7:08 pm

    I patched, login fine, but still get “action: http://lax-v196.lax.youtube.com/my_videos_post addresser: TjqfrytihsKN2k5uecQPAWRLmuj3Tdlx345xm3Pfi8×01utuoZ8Un8ZE51H-JS9eNVgcJQXhPhrJPk-XBPVq3w== file: C:\Users\RedOak\Pictures\personal\vt08\test.mpg” Nothing else and the video does not show up. Thanks!

  169. Roshan
    August 12th, 2008 @ 3:08 pm

    I checked with both the patches 0.1.3 and 0.1.7 but both have same login failed problem .please if u have solution please help me.

  170. subnet
    August 12th, 2008 @ 5:13 pm

    0.1.3 is deprecated… 0.1.7 works for me (just tried it out)…maybe something wrong on your side (did it work before?).

    I’m back in office on thursday, until than I can’t do much anyways… :(

  171. santy
    August 13th, 2008 @ 8:08 am

    hallo Subnet,
    I am working on uploading video to youtube using your phptube script “download” function is running well but when i am uploading video it gives me following error
    my code is:

    $tube = new PHPTube (”user”,”pass”);
    $id = $tube->upload (”videofile.3gp”,”PHPTube Demo”, “Demo PHP YouTube”, “…”, 10, “DE”);

    i got response “No URL given.”

    videofile.3gp file exists in same directory as is demo.php

  172. santy
    August 13th, 2008 @ 8:13 am

    I am using your phptube script
    but I have error with following code

    $tube = new PHPTube (”user”,”pass”);
    $id = $tube->upload (”videofile.3gp”,”PHPTube Demo”, “Demo PHP YouTube”, “…”, 10, “DE”);

    i got response “No URL given.”

    videofile.3gp file exists in same directory as is demo.php

    please let me know what i’m wrong.

  173. Roshan
    August 13th, 2008 @ 9:32 am

    yes previously 0.1.3 version running fine.but when i upgrade version 0.1.3 to 0.1.7 it is having the login failed problem what should i do here please help me.

  174. subnet
    August 15th, 2008 @ 9:11 pm

    the error-message “No URL given.” isn’t generated within PHPTube, however… I guess there’s something else going on… I just tried uploading successfully again…

  175. zago
    August 19th, 2008 @ 3:09 pm

    there is big problem with $id now

  176. subnet
    August 19th, 2008 @ 7:27 pm

    which version are you using, and can you please give a precise description of the error?

    0.1.7 still runs fine for me…

  177. zago
    August 19th, 2008 @ 8:13 pm

    ok tnx a lot
    is true … 0.1.7 work fine. I was in 0.1.6
    (: btw can we think about direct upload not from server some how :)

  178. santy
    August 20th, 2008 @ 3:39 pm

    hi subnet
    thanks to reply and I go through this but this problem is not corrected by me, I am not get proper output. my login is done after it give following blank field of ACTION and ADDRESSER

    action:
    addresser:
    file: videofile.3gp
    Error: No URL given.

    please help me to fix this problem

  179. santy
    August 22nd, 2008 @ 11:09 am

    hallo “subnet”

    thanks for ur grate phptube scripting

    Now, I can upload video to youtube successfully,
    but there is some problem i am trying upload 3gp file it gives response REJECTED(DUPLICATE UPLOAD) as because of youtube support only flv file but after some testing I am upload flv file and again a got same response REJECTED(DUPLICATE UPLOAD)

    Please tell me why it is happened??….

  180. subnet
    August 22nd, 2008 @ 12:13 pm

    this actually means that you uploaded the same file twice! YouTube recognizes this as duplicate content…

  181. anita
    August 24th, 2008 @ 10:30 am

    Hi,
    I m using phptube script of version 0.1.7 . but getting error of “Login Failed”.
    Can anyone pls suggest where I might have gone wrong.

  182. subnet
    August 24th, 2008 @ 1:16 pm

    did you use your correct username/password?
    has it been working before?

  183. santy
    August 25th, 2008 @ 10:16 am

    hi “subnet”

    I m using phptube script of version 0.1.7, and get successfull ot put,
    but I am observe htat when I am upload video size less than 2MB
    it is uploaded without any error but more than 2MB video can’t be upload on utube please suggest me to do a setting or code to increase uploading speed.

    thanks …..

  184. santy
    August 25th, 2008 @ 10:54 am

    here I have to give limit to upload video of size 30MB BUT I can’t do that
    Pleas give me ur suggestion !!!!!!!!………..

  185. subnet
    August 29th, 2008 @ 2:00 pm

    this is probably an issue with your php.ini – maybe the maximum execution time for scripts is set too low..

    if you let users upload the videos to your server before sending them to youtube, you have to take care for the php.ini-parameters mentioned in http://php.m-otion.at/manual/en/features.file-upload.php!!

  186. subnet
    August 29th, 2008 @ 2:01 pm

    check the size of files with the php-function filesize()!

  187. aa
    August 31st, 2008 @ 5:47 pm

    I get error “No url given.” what should I do!? I tryied on few pc`s and always get that error, can you please make 1 rar file where are all required files for phptube!?

  188. Video Lover
    September 4th, 2008 @ 9:59 am

    Here is a great site to download videos from youtube , simply search videos and click on download button to download (FLV link to download low quality videos and MP4 link to download High Quality Videos), no need to copy and paste video urls, a great, simple and easy tool for video down loaders.

    http://www.vidmaza.com

  189. Albus
    September 7th, 2008 @ 1:45 pm

    Hi, Thanks so much for sharing this script. It is fantastic!

    I am having some problems downloading videos that have been rated as Adult though. To view these videos you need to be signed into an account that has been verified as 18+. So I call PHPTube with my username and password (just like the upload demo) but it still doesn’t work. I assume the cookies are not being passed?

    Any ideas or suggestions on what I could do about this would be greatly appreciated. Thanks.

  190. subnet
    September 8th, 2008 @ 12:48 pm

    yeah you’re right, login-cookies are not passed in the download()-function currently… the problem is, passing the cookies seems not to be enough, because youtube also has this verfiy_age-skript, which has to be submitted at least once for every uswer-account…

    I’ll have a look into this for the next version of PHPtube…

  191. Albus
    September 8th, 2008 @ 3:58 pm

    Thanks very much for your reply and considering it for your next version. Greatly appreciated.

  192. Donal
    September 11th, 2008 @ 10:21 am

    Hi

    Thanks for a great script, it does exactly what I want :)

    Just have a few questions if you wouldn’t mind answering them? Sorry for their very basic nature, I’m fairly new to php etc…

    1. Could you post some code that shows how I could enable a user to upload a video from their local machine to my server and then call phpTube to upload it to YouTube.

    2. Since phpTube returns the location of the video on YouTube I’m assuming that I can use this to build the embed code for storage in a mySQL database?

    Thanks in advance for any/all help
    Donal

  193. subnet
    September 11th, 2008 @ 12:06 pm

    Hi Donal, glad you like phptube!

    1) read http://www.php.net/manual/en/features.file-upload.php to see how to handle file-uploads by users

    2) Yeah, you’re right!

  194. Donal
    September 11th, 2008 @ 12:33 pm

    thats great man – thanks a lot :)

  195. Donal
    September 15th, 2008 @ 3:55 pm

    Hi

    I’ve been trying to integrate phpTube into another script and am getting nowhere :(

    Could you tell me where I’m going wrong with the following code?
    Basically what it’s supposed to do is upload a video to a folder called ‘uploads’ on my own server and then from there upload it to YouTube using the phpTube script which is stored in the same ‘uploads’ folder.

    PHP code below …

    upload ($vidName,”PHPTube Demo”, “Demo PHP YouTube”, “…”, 10, “DE”);
    }

    else
    {
    echo “There was an error uploading the file, please try again!”;
    }

    ?>

  196. Donal
    September 15th, 2008 @ 4:06 pm

    Third time lucky ??

    PHP CODE…

    include_once (“uploads/phptube.php”);

    $target_path = “uploads/”;

    $target_path = $target_path . basename( $_FILES['uploadedfile']['name']);

    $vidName = basename( $_FILES['uploadedfile']['name']);

    if(move_uploaded_file($_FILES['uploadedfile']['tmp_name'], $target_path))
    {
    echo “The file “. basename( $_FILES['uploadedfile']['name']).
    ” has been uploaded”;

    $tube = new PHPTube (“Storyb08″, “nFHc12″, true);
    $id = $tube->upload ($vidName,”PHPTube Demo”, “Demo PHP YouTube”, “…”, 10, “DE”);
    }

    else
    {
    echo “There was an error uploading the file, please try again!”;
    }

  197. Recent Links Tagged With "lax" - JabberTags
    October 14th, 2008 @ 1:49 am

    [...] public links >> lax Comment on PHPTube – YouTube API for Video Upload & Download by Oak Saved by derDennis on Sun 12-10-2008 The Game’s new album LAX leaked on the Internet Saved by [...]

  198. Naveen Kumar Jain
    October 16th, 2008 @ 7:35 am

    Hi,
    I m using phptube.php for upload the video but I getting an error like Login failed!

    can anybody tell me how can I resolve this problem?

    I m waiting for reply…

  199. subnet
    October 16th, 2008 @ 10:12 am

    Looks like YouTube changed their login-process, and unfortunately it seems to be a signficant change :(

    I didn’t have the time to update phptube yet, so if anybody wants to look into this, feel free!

  200. subnet
    November 4th, 2008 @ 8:30 pm

    hi again,
    just wanted to let you know that 0.1.7 seems to be still working (again?)… don’t know if there even _was_ a problem in the first place…

  201. jessicana
    November 24th, 2008 @ 12:57 pm

    hi all me too using the Great Phptube script but just Gets Nothing in response :)
    no errors and no success messages just an empty screen !!

    any help

  202. jessicana
    November 24th, 2008 @ 1:04 pm

    Can u plz tell me where u get the new updated version

  203. subnet
    November 24th, 2008 @ 1:08 pm

    current version is still 0.1.7, the download-link is at the top of this page!

  204. jessicana
    November 24th, 2008 @ 2:37 pm

    Hi all Now i successed finally to upload the video but when i play it in youtube it says :This video is not yet processed
    any help

  205. Bob
    November 27th, 2008 @ 4:54 am

    The upload feature works as long as the video size is very small, but it is not working when I try to upload 250 MB videos that are already on my server.

    I’m using the following and it still won’t upload larger videos:
    set_time_limit(0);
    ini_set(‘memory_limit’, ‘1000M’);
    ini_set(‘upload_max_filesize’, ‘1000M’);
    ini_set(‘post_max_size’, ‘1000M’);
    ini_set(‘max_input_time’, ‘90000000000′);
    ini_set(‘max_execution_time’, ‘90000000000′);

    Any ideas?

  206. Yogesh
    December 16th, 2008 @ 1:33 pm

    Can somebody explain me how this script works.

    I am getting the error Login Failed.

    Both Username and Password are correct.

    can anybody help out ?

  207. maria
    December 21st, 2008 @ 2:00 am

    it’ll take a little time, like 5 minutes, then your video will show up.

  208. chris
    December 22nd, 2008 @ 4:34 am

    hi,I have faced the same problem,I have install phptube and it only showed an empty screen.I saw that you had success installed this script,could you tell me how to do it?I am kinda new to programming stuff.Thanks

  209. James
    December 26th, 2008 @ 2:37 pm

    I can only assume youtube have changed their login methods again as I too am getting the login failed message.

  210. subnet
    December 26th, 2008 @ 6:20 pm

    just tried it out, still works for me!

  211. James
    December 26th, 2008 @ 6:43 pm

    Yeah, just got it working mysef.

    I noticed that whenever I went to any http://www.youtube.com/whatever/ URL’s, I was being redirected to uk.youtube.com/whatever/. So I changed all the URL’s in the phptube.php file to reflect this….hey presto, it worked!

    I guess this is done on geoip so those of you who arn’t located in the US, may need to try this.

  212. subnet
    December 26th, 2008 @ 6:44 pm

    oh, interesting, thanks for sharing!

  213. Justin
    January 3rd, 2009 @ 12:17 am

    try using htaccess theres a php value directive of sorts cant remember it off my head.

  214. Justin
    January 3rd, 2009 @ 12:21 am

    subnet… when will the YouPorn version be done?

  215. subnet
    January 3rd, 2009 @ 3:14 pm

    sorry, no plans…

  216. Donal
    January 14th, 2009 @ 1:41 pm

    Just wondering if you’re planning to update this script ?

  217. subnet
    January 14th, 2009 @ 6:25 pm

    @Donal: sorry to tell you that I’m not really planning any updates, as the basic upload-functionality seems still to work. Moreover, I’ld really recommend using the official YouTube-API…

  218. Tommy
    January 22nd, 2009 @ 8:25 am

    Since 14. January the upload-function doesn’t work anymore :(
    Could someone post the changes to make it work again?

  219. Michael Kamleitner
    January 29th, 2009 @ 5:52 pm

    sorry guys, I’ve just spent some time trying to fix this thing, but I couldn’t figure it out…

    I could fix the login-problem by setting allowRedirect to false and setting the URL to “de.youtube.com”, but after logging in, uploading won’t work since there have been major changes to the upload-process (flash-uploader etc.)

    I’m not going to fix this one, as I’ld strongly recommend everyone to switch to the official YouTube-API, which can do uploads since quite some time.

    sorry again, but it’s time to move on :)

  220. rigo
    January 29th, 2009 @ 7:43 pm

    I fixed the upload problem:
    Just insert
    $this->req->addPostData(“action_postvideo”,”1″);
    after each
    $this->req->addPostData(“action_upload”,”1″);

    cu
    rigo

  221. Donal
    February 12th, 2009 @ 9:23 am

    Cheers for the fix rigo – worked perfectly :)

  222. rigo
    February 18th, 2009 @ 8:55 pm

    The class doesn’t work anymore :(
    But the solution for a google-api-conform video upload is right there:
    http://tinyurl.com/dlcfjs
    Don’t forget to put \r\n twice after
    $postdata .=’Content-Transfer-Encoding: binary’.”\r\n”;
    =>
    $postdata .=’Content-Transfer-Encoding: binary’.”\r\n\r\n”;
    That’s absolutly important.

    cu
    rigo

  223. loila
    March 24th, 2009 @ 12:19 pm

    Login Failed!

    yesterday everything was fine but today i get this error, any help ?

  224. coryjames
    June 9th, 2009 @ 4:03 pm

    We are using a YouTube AS3 API that is from march of last year.

    The API works for making calls to YouTube without having to login or

    anything. Unfortunately, the login piece of the API has since been

    changed by YouTube.

    Do you have a YouTube AS3 API that is using the

    latest YouTube protocol? If so, we would be willing to pay you just

    For the code. Otherwise we need someone to write this piece of

    the API!

    The scope of our request would be to login, upload, and search YouTube

    user videos and metadata. And to that we would only need the functions

    or protocols. We would be doing the GUI interface most likely unless you can do that too.

    Please let us know if you are available to do this immediately.

    Please see my craigslit post at:
    http://chicago.craigslist.org/chc/cpg/1212718866.html

  225. Wai Wai
    June 23rd, 2009 @ 6:50 am

    I’ve installed the PEAR and checked that pear works. But I’ve got this error:

    Warning: require_once(HTTP/Client.php) [function.require-once]: failed to open stream: No such file or directory in C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\dimsumart\phptube-0.1.7\phptube.php on line 30

    Fatal error: require_once() [function.require]: Failed opening required ‘HTTP/Client.php’ (include_path=’C:\php\pear;.:/php/includes’) in C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\dimsumart\phptube-0.1.7\phptube.php on line 30

  226. Sachin
    July 4th, 2009 @ 11:10 am

    i get an error
    Login failed
    ” As you have mentioned in ur earlier replies i have checked my username and password.but still i’m getting that error. How do i solve it”

  227. prem
    July 5th, 2009 @ 1:20 pm

    Hey guys, im trying to download a video on my suspended youtube account, but i need to log in and have authentencation to download the video.
    is there anyway around this?

  228. Asanka
    August 19th, 2009 @ 12:35 pm

    $tube = new PHPTube (“user”, “pass”, true);

    I imported all the files and put my username and password for ‘user’ and ‘pass’. But the program says “Login failed!”. I cannot understand the problem. Need your help. Thank you.

  229. marius
    September 3rd, 2009 @ 8:25 pm

    This api is grate, but i noticed that youtube API has been changed.
    Anyway I found something similar at http://www.webdryver.com/php-tutorials/youtube-gdata-php-script-for-video-upload.html
    Would be grate to update your script.
    Thanks and keep the grate job.

  230. Abdulla
    December 5th, 2009 @ 8:59 am

    Once I upload video in My joomla site and How will display on youtube???

    <<<<<>>>>>>>

  231. Abdulla
    December 5th, 2009 @ 9:01 am

    Once I upload video in My joomla site and How will display on youtube??? AnyOne Knows Help ME..

  232. simon Schärer
    December 7th, 2009 @ 8:10 am

    Here’s another youtube video downloader. It provides a preview and you can download videos in three different formats (FLV, MP4, 3GP).

    http://www.simra.ch/

  233. Komplette Youtube Playlist downloaden - IO – Zone
    January 23rd, 2010 @ 12:10 am

    [...] Den Download der Videofiles bietet die API nicht an. Da habe ich mir die paar Codezeilen von Michael Kamleitner und Sajith M.R zu Nutze [...]

  234. ardee
    March 22nd, 2010 @ 2:38 am

    yesterday i use my account but this tme got error

  235. Mehul
    March 30th, 2010 @ 5:22 am

    I have 2 fixed source of youtube downloader….

    check demo

    demo 1—-http://pcrole.chemicalservers.com/1/
    demo2—- http://pcrole.chemicalservers.com/

    If you want then contact me..
    Email- mbt1370 @ gmail . com

  236. nethra
    April 6th, 2010 @ 4:13 pm

    Hi, i have used the phptube and given the correct username and password for youtube. It keeps showing Login Failed. Please anyone give the suggestion?

  237. Pathankot
    April 10th, 2010 @ 12:16 pm

    PHP Tube is down

  238. nethra
    April 14th, 2010 @ 8:41 am

    is there any alternate solution for upload video to youtube in pure php coding? Because i’m not able use the Zend coding which has been given in API

  239. mp3 dinle
    June 2nd, 2010 @ 2:54 pm

    it’s very interesting o.O

  240. ovali dental
    June 17th, 2010 @ 3:00 pm

    Warning: require_once(HTTP/Client.php) [function.require-once]: failed to open stream: No such file or directory in C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\dimsumart\phptube-0.1.7\phptube.php on line 30

    Fatal error: require_once() [function.require]: Failed opening required ‘HTTP/Client.php’ (include_path=’C:\php\pear;.:/php/includes’) in C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\dimsumart\phptube-0.1.7\phptube.php on line 30
    Dental market

Leave a Reply





Michael Kamleitner

Michael Kamleitner

Vienna , 1170 Austria
vCard vCard, Xing Xing , kamleitner.com

+43 699 11607923
Twitter
Stadtkinder - Events in Wien
  • Facebook Connect

    Login using Facebook:
    Last visitors