Web Analytics Made Easy -
StatCounter YouTube-to-MP3 conversion - PHP class and script - CodingForum

Announcement

Collapse
No announcement yet.

YouTube-to-MP3 conversion - PHP class and script

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • #46
    any updates on this?

    Comment


    • #47
      The reason is the version of PHP. XAMPP use PHP5 while my server use PHP4

      No?

      Comment


      • #48
        Originally posted by Vicar View Post
        The reason is the version of PHP. XAMPP use PHP5 while my server use PHP4

        No?
        It's possible that the server you are using is Linux, ffmpeg.exe only works on Windows

        Comment


        • #49
          And there is nothing for linux?

          Comment


          • #50
            http://www.lmgtfy.com/?q=ffmpeg+php+linux+install
            ZCE

            Comment


            • #51
              hello,

              i am using this script & its working fine till yesteday..but today i got error Error generating MP3 file

              I got this error after 2 month so please tell me you also got this error or this is my server problem?

              Comment


              • #52
                I just converted a YouTube video successfully, so it's working for me.

                What is the URL of the video you are trying to convert?
                Regards, R.J.

                ---------------------------------------------------------

                Help spread the word! Like our YouTube-to-Mp3 Conversion Script on Facebook !! :-)
                [Instructional videos and tutorials are also available on YouTube, Dailymotion, and Vimeo]
                Explore all products and services, view demos, review documentation, check prices, and more!
                ♪♪ …Need Web Hosting For Our YouTube-To-Mp3 Conversion Software? Check Here !!… ♪♪

                Comment


                • #53
                  I trying with many videos but i got same error.i can't convert single video

                  http://www.youtube.com/watch?v=6g6g2mvItp4
                  this url i trying

                  UPDATE:

                  I can convert only one Video here this URL: http://www.youtube.com/watch?v=abRmvlSKknc

                  but other videos cant convert so what a problem?
                  Last edited by expertmac; Jul 22nd, 2011, 03:26 AM.

                  Comment


                  • #54
                    Originally posted by expertmac View Post
                    I trying with many videos but i got same error.i can't convert single video

                    http://www.youtube.com/watch?v=6g6g2mvItp4
                    this url i trying
                    I was able to convert the video at that URL (the Maroon 5 song)...

                    So if the code is working for me, and I was able to convert a video that you are not able to convert, then I can only assume the problem is with your server setup...

                    If it was working for you before, then your server setup must have changed recently. I would:

                    1) Turn error handling on in the code (comment out ini_set('display_errors',0)
                    2) Check your server error logs
                    3) Make sure FFmpeg is functional within your server setup
                    4) Download a fresh copy of FFmpeg
                    5) Make sure that you can execute commands on the server with PHP's exec()

                    Also I saw a comment somewhere else in this thread about which PHP version can run this code. Since my code uses PHP 5 OOP, it should be run on PHP 5 or higher.

                    Good luck!
                    Regards, R.J.

                    ---------------------------------------------------------

                    Help spread the word! Like our YouTube-to-Mp3 Conversion Script on Facebook !! :-)
                    [Instructional videos and tutorials are also available on YouTube, Dailymotion, and Vimeo]
                    Explore all products and services, view demos, review documentation, check prices, and more!
                    ♪♪ …Need Web Hosting For Our YouTube-To-Mp3 Conversion Software? Check Here !!… ♪♪

                    Comment


                    • #55
                      i found error in error log:
                      [22-Jul-2011 16:07:22] PHP Fatal error: Maximum execution time of 1 second exceeded in /home/user/public_html/YouTubeToMp3Converter.class.php on line 78

                      waiting for your reply

                      Comment


                      • #56
                        http://www.php.net/manual/en/info.co...execution-time

                        Try adjusting this value:

                        ini_set('max_execution_time',0);

                        in my index.php....Or just comment that line out....I honestly can't remember why I set that to '0'...It might be some left over code that I never removed, and possibly an error on my part?

                        Hope it helps.

                        Originally posted by chump2877 View Post
                        I honestly can't remember why I set that to '0'...
                        This must be the reason why: http://www.php.net/manual/en/functio...time-limit.php

                        From that URL:

                        The maximum execution time, in seconds. If set to zero, no time limit is imposed.
                        Whether or not the following 2 lines of code are equivalent in terms of what they accomplish, I'm not sure:

                        PHP Code:
                        set_time_limit(0);  // or

                        ini_set('max_execution_time',0); 
                        So you might also try replacing the existing ini_set() call with a set_time_limit() call, as illustrated above.

                        This seems to corroborate that the following lines of code do in fact do the same thing:

                        PHP Code:
                        set_time_limit(0);  // or 

                        ini_set('max_execution_time',0); 
                        ...even though this is not made abundantly clear in the PHP manual (at least per my understanding of it)...

                        Also, you could try adding either of those lines of code to the top of YouTubeToMp3Converter.class.php, since that is where the error occurred for you...
                        Last edited by Inigoesdr; Jul 22nd, 2011, 05:08 PM.
                        Regards, R.J.

                        ---------------------------------------------------------

                        Help spread the word! Like our YouTube-to-Mp3 Conversion Script on Facebook !! :-)
                        [Instructional videos and tutorials are also available on YouTube, Dailymotion, and Vimeo]
                        Explore all products and services, view demos, review documentation, check prices, and more!
                        ♪♪ …Need Web Hosting For Our YouTube-To-Mp3 Conversion Software? Check Here !!… ♪♪

                        Comment


                        • #57
                          it's converting now but one more error found.
                          when i start ripping i got error Error downloading video!

                          can't download many videos but same videos can download & convert succesfully.
                          So why i geting Error downloading video! even videos are playing fine on youtube.

                          Comment


                          • #58
                            How experienced are you with PHP? With some knowledge of PHP programming, this shouldn't be that hard to troubleshoot...

                            The error you are receiving is due to the DownloadVideo() method failing:

                            PHP Code:
                                    function DownloadVideo($youTubeUrl
                                    { 
                                        
                            $file_contents file_get_contents($youTubeUrl); 
                                        if (
                            $file_contents !== false
                                        { 
                                            
                            $this->SetSongFileName($file_contents); 
                                            
                            $this->SetFlvUrl($file_contents); 
                                            if (
                            $this->GetSongFileName() != '' && $this->GetFlvUrl() != ''
                                            { 
                                                return 
                            $this->SaveVideo($this->GetFlvUrl()); 
                                            } 
                                        } 
                                        return 
                            false
                                    } 
                            Whch means any of the following could be an issue here:

                            1) You have entered an invalid YouTube URL into the application
                            2) The regex used to obtain the FLV file name is not working
                            3) The regex used to extract the song name is not working

                            But before you start investigating those possibilities, you should do as I said earlier for your previous problem:

                            1) Turn error handling on in the code (comment out ini_set('display_errors',0)
                            2) Check your server error logs
                            Regards, R.J.

                            ---------------------------------------------------------

                            Help spread the word! Like our YouTube-to-Mp3 Conversion Script on Facebook !! :-)
                            [Instructional videos and tutorials are also available on YouTube, Dailymotion, and Vimeo]
                            Explore all products and services, view demos, review documentation, check prices, and more!
                            ♪♪ …Need Web Hosting For Our YouTube-To-Mp3 Conversion Software? Check Here !!… ♪♪

                            Comment


                            • #59
                              hey i just try this script on my another server & there working fine.
                              that means problem in my server,so can you give me server requirement then i can check,whats problem in server.

                              Comment


                              • #60
                                compare the php.ini of one server to the other...You could also download XAMPP and check the default PHP configuration there...I run the app inside XAMPP successfully
                                Regards, R.J.

                                ---------------------------------------------------------

                                Help spread the word! Like our YouTube-to-Mp3 Conversion Script on Facebook !! :-)
                                [Instructional videos and tutorials are also available on YouTube, Dailymotion, and Vimeo]
                                Explore all products and services, view demos, review documentation, check prices, and more!
                                ♪♪ …Need Web Hosting For Our YouTube-To-Mp3 Conversion Software? Check Here !!… ♪♪

                                Comment

                                Working...
                                X