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

  • #16
    OK, i solved this and I feel kind of dumb because it was so simple...
    In plesk go to your domain -> setup -> and run PHP as ISAPI

    anyways, i was looking up for solution for
    Error in my_thread_global_end(): 1 threads didn't exit
    and i got two birds in one hit

    Comment


    • #17
      Anyone know why I can get "Error generating MP3 file!".?

      Comment


      • #18
        YouTube recently made some changes to the front end of their web site. As a result, a very minor tweak to my class code is required to keep it working properly.

        The following code in the SetFlvUrl() method in YouTubeToMp3Converter.class.php:

        PHP Code:
                private function SetFlvUrl($file_contents)
                {
                    
        $vidUrl '';
                    if (
        eregi('fmt_url_map',$file_contents))
                    {
                        
        $vidUrl end(explode('&fmt_url_map=',$file_contents));
                        
        $vidUrl current(explode('&',$vidUrl));
                        
        $vidUrl current(explode('%2C',$vidUrl));
                        
        $vidUrl urldecode(end(explode('%7C',$vidUrl)));
                    }
                    
        $this->_flvUrl $vidUrl;
                } 
        ...needs to change like so:

        PHP Code:
                private function SetFlvUrl($file_contents)
                {
                    
        $vidUrl '';
                    if (
        eregi('fmt_url_map',$file_contents))
                    {
                        
        $vidUrl end(explode('fmt_url_map=',$file_contents));
                        
        $vidUrl current(explode('&',$vidUrl));
                        
        $vidUrl current(explode('%2C',$vidUrl));
                        
        $vidUrl urldecode(end(explode('%7C',$vidUrl)));
                    }
                    
        $this->_flvUrl $vidUrl;
                } 
        After doing that, everything should work as it has before! (Please notify me if you experience otherwise.)
        Attached Files
        Last edited by chump2877; Mar 5, 2011, 07:31 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


        • #19
          chump2877 Thank you so much

          Comment


          • #20
            I am having some problems with this class..

            I always get this:

            ...Please wait while I try to convert:

            preview image

            DirtBall Ft Johnny Ritcher-Grind

            Error generating MP3 file!

            D-BALL Is my favorite underground rapper i glad he joined kmk but i liked kmk befor. but adding d-ball waz a beast ass thing to do This is grind with johnny ...


            I look in my video dir and I don't even see teh video file.

            Also, my error log says "[29-Mar-2011 11:58:06] PHP Warning: Module 'ffmpeg' already loaded in Unknown on line 0" not sure if this could be the problem



            Edit again: I commented the delete video line and the video's there. It just doesn't convert for some reason... ;[
            Last edited by Sim; Mar 29, 2011, 01:06 PM.

            Comment


            • #21
              my error log says "[29-Mar-2011 11:58:06] PHP Warning: Module 'ffmpeg' already loaded in Unknown on line 0" not sure if this could be the problem
              The "Error generating MP3 file!" usually is a sign that something is wrong with your FFmpeg installation, and the above error message seems to reinforce that.

              My best guess is that you already have FFmpeg loaded on your server.

              See this forum thread: http://motionmods.com/forum/topic?id=690&p=5467

              Do you have a copy of FFmpeg already installed in the user/bin/ directory? (Also, how are you running PHP -- what is your server configuration?)

              Edit: BTW, I had no problem grabbing the MP3 for that video....
              Last edited by chump2877; Mar 29, 2011, 10:04 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


              • #22
                I am using this script but how can download mp3 file from webpage?
                after convert file is stored in mp3 folder but i want download from webpage so how to add link?

                Wating for your reply.


                Thanks for this nice script!

                Comment


                • #23
                  Easy: display a link to it and then right-click, save as...
                  ZCE

                  Comment


                  • #24
                    Originally posted by expertmac View Post
                    I am using this script but how can download mp3 file from webpage?
                    after convert file is stored in mp3 folder but i want download from webpage so how to add link?

                    Wating for your reply.


                    Thanks for this nice script!
                    You could do what kbluhm suggested, or you could try this: http://www.lmgtfy.com/?q=php+prompt+for+download

                    You'll find lots of solutions at that link
                    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


                    • #25
                      Done! thanks for reply...i just add download link & its works thanks again

                      Comment


                      • #26
                        someone has an idea on Linux version ?

                        Comment


                        • #27
                          hello,
                          i am using this script...its work fine but i want add one more feature.I want add ID3 editor can you help me for that.if you have any tips please give me


                          thanks

                          Comment


                          • #28
                            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


                            • #29
                              heyy , i am unable to infact get the script to fetch video, so i think it gets stuck there .. i can see the thumbnail .. and then nothing happens.. no errors, nothing

                              i verified that safemode is off for php .. and ffmpeg is working otherwise..

                              i can see a file of 0kb in videos folders.. and that continues to stay like that !!

                              EDIT: it works, i had to turn on the curl, thanks a lot mate!!
                              Last edited by fatslave; May 22, 2011, 12:55 PM.

                              Comment


                              • #30
                                Chad hates aliens. A lot.http://www.hiradiosilence.com/chadmattandrobChad Villella, Matt Bettinelli-Olpin & Rob Polonsky



                                for testing sake, please verify that this is working for u

                                No need now :P
                                Last edited by fatslave; May 22, 2011, 12:55 PM.

                                Comment

                                Working...
                                X