Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Page 12 of 87 FirstFirst ... 210111213142262 ... LastLast
Results 166 to 180 of 1296
Like Tree10Likes

Thread: YouTube-to-MP3 conversion - PHP class and script

  1. #166
    New Coder
    Join Date
    Feb 2012
    Posts
    15
    Thanks
    4
    Thanked 0 Times in 0 Posts
    Hi, i have same problem in ubuntu 11.04

    CURL is enabled:


    File converting good:


    Website still look like this:


    No download link nothing heppend...!!!
    What can I do?

  2. #167
    Senior Coder chump2877's Avatar
    Join Date
    Dec 2004
    Location
    the U.S. of freakin' A.
    Posts
    2,839
    Thanks
    21
    Thanked 157 Times in 148 Posts
    1) cana888, for that conversion, is there a corresponding log file in the '/logs' directory? A corresponding video in the '/videos' directory?

    2) If you are getting a log file, can you attach the file to your next post to this thread?

    3) What is the link to the video that you are trying to convert?

    4) Is this line of code included in your index.php:

    Code:
    <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
    5) Using Firebug in Firefox, can you paste the AJAX response text here (if there is any), for the multiple AJAX requests?

    6) Is this line included in YouTubeToMp3Converter::GenerateMP3():

    PHP Code:
    curl_setopt($chCURLOPT_TIMEOUT1); 
    7) Have you edited the FFMPEG command in anyway (in YouTubeToMp3Converter::GenerateMP3)?

    8) Have you edited any code anywhere in the app?

    9) Also, try moving your web root from /var/www/ to /home/user/public_html/ (to combat any permissions issues). And set write permissions on the mp3, logs, and videos directories.
    Last edited by chump2877; 02-14-2012 at 05:41 AM.
    Regards, R.J.

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

    Help spread the word! Like my YouTube-to-Mp3 Conversion Script on Facebook !! :-)
    [Related videos and tutorials are also available at my YouTube channel and on Dailymotion]
    Get free updates about new software version releases, features, and bug fixes!
    ♪♪ Need Web Hosting For My YouTube-To-Mp3 Conversion Software? Check Here !! ♪♪

  3. Users who have thanked chump2877 for this post:

    cana888 (02-14-2012)

  4. #168
    New Coder
    Join Date
    Feb 2012
    Posts
    26
    Thanks
    9
    Thanked 0 Times in 0 Posts
    Another problem - bad youtube video address. I get this error when trying to download this video from youtube - http://www.youtube.com/watch?v=222kQyGGoWg

    Others don't cause this problem.

  5. #169
    New Coder
    Join Date
    Feb 2012
    Posts
    26
    Thanks
    9
    Thanked 0 Times in 0 Posts
    I think it's the problem because address includes a letter Q, W or X which doesn't exist in UTF 8?
    Last edited by zemaitis; 02-14-2012 at 03:01 PM.

  6. #170
    New Coder
    Join Date
    Jan 2012
    Posts
    23
    Thanks
    0
    Thanked 0 Times in 0 Posts
    The new progress bar is perfect but i try my old version and convert file faster. Before for 1 clip need 10 seconds, now for the same clip need 48 seconds to get mp3 file.

  7. #171
    Senior Coder chump2877's Avatar
    Join Date
    Dec 2004
    Location
    the U.S. of freakin' A.
    Posts
    2,839
    Thanks
    21
    Thanked 157 Times in 148 Posts
    Quote Originally Posted by zemaitis View Post
    I think it's the problem because address includes a letter Q, W or X which doesn't exist in UTF 8?
    The title of that video looks to contain russian or something? So iconv() is looking to transliterate to a ISO-8859-1 charset equivalent, can't figure it out, and subsequently returns an empty string (and a PHP notice if you turn on error reporting).

    Honestly, for cases like this, I would probably institute a default track name/file name when iconv() fails and returns an empty string, i.e.:

    PHP Code:
            function ExtractSongTrackName($vidSrc$srcType)
            {
                
    $name '';
                
    $vidSrcTypes $this->GetVidSrcTypes();
                if (
    in_array($srcType$vidSrcTypes))
                {
                    
    $vidSrc = ($srcType == $vidSrcTypes[1]) ? file_get_contents($vidSrc) : $vidSrc;
                    if (
    $vidSrc !== false && eregi('eow-title',$vidSrc))
                    {
                        
    $name end(explode('eow-title',$vidSrc));
                        
    $name current(explode('">',$name));
                        
    $name end(explode('title="'$name));
                        
    $name iconv("UTF-8""ISO-8859-1//TRANSLIT"$name);
                        
    $name = (!empty($name)) ? html_entity_decode($name) : 'unknown';
                    }
                }
                return 
    $name;
            } 
    You could spend some time and hunt around for a way to effectively translate the (russian?) characters, but, nevertheless, you will inevitably run into problems with the mp3 file name. As far as I know the file name can only contain English letters, right? So it seems to me that a default track name/file name is adequate for edge-case scenarios like this....

    Edit: And it's probably best to randomize (or make unique) the 'unknown' track name in the code above to minimize naming conflicts (at least until you delete the mp3 from the mp3 directory at some point), i.e.:

    PHP Code:
    $name = (!empty($name)) ? html_entity_decode($name) : 'unknown_'.time(); 
    Last edited by chump2877; 02-14-2012 at 03:30 PM.
    Regards, R.J.

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

    Help spread the word! Like my YouTube-to-Mp3 Conversion Script on Facebook !! :-)
    [Related videos and tutorials are also available at my YouTube channel and on Dailymotion]
    Get free updates about new software version releases, features, and bug fixes!
    ♪♪ Need Web Hosting For My YouTube-To-Mp3 Conversion Software? Check Here !! ♪♪

  8. Users who have thanked chump2877 for this post:

    zemaitis (02-14-2012)

  9. #172
    New Coder
    Join Date
    Feb 2012
    Posts
    26
    Thanks
    9
    Thanked 0 Times in 0 Posts
    Will be good for now Thank you again

  10. #173
    Senior Coder chump2877's Avatar
    Join Date
    Dec 2004
    Location
    the U.S. of freakin' A.
    Posts
    2,839
    Thanks
    21
    Thanked 157 Times in 148 Posts
    Quote Originally Posted by atanas View Post
    The new progress bar is perfect but i try my old version and convert file faster. Before for 1 clip need 10 seconds, now for the same clip need 48 seconds to get mp3 file.
    That's a side effect of using AJAX to incrementally check the converted file size via the corresponding log file generated by FFMPEG. Like I said earlier, I don't like the idea of retrieving log file contents every second or every so many milliseconds to build a progress bar (because not only is it slower, but it uses more server resources!), but I could not find a better way to gauge FFMPEG conversion progress. So it is what it is, take it or leave it. If you don't like the progress bar or bars, you can always use a loading animation instead.

    Edit: I'm using file_get_contents (in ffmpeg_progress.php) to read the log file....you might use readfile() or fpassthru() instead, since the time trials documented here seem to indicate that these functions could shave some time off a file-read operation...maybe I will experiment with this later when I get the chance...
    Last edited by chump2877; 02-14-2012 at 04:05 PM.
    Regards, R.J.

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

    Help spread the word! Like my YouTube-to-Mp3 Conversion Script on Facebook !! :-)
    [Related videos and tutorials are also available at my YouTube channel and on Dailymotion]
    Get free updates about new software version releases, features, and bug fixes!
    ♪♪ Need Web Hosting For My YouTube-To-Mp3 Conversion Software? Check Here !! ♪♪

  11. #174
    New Coder
    Join Date
    Feb 2012
    Posts
    15
    Thanks
    4
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by chump2877 View Post
    1) cana888, for that conversion, is there a corresponding log file in the '/logs' directory? A corresponding video in the '/videos' directory?

    2) If you are getting a log file, can you attach the file to your next post to this thread?

    3) What is the link to the video that you are trying to convert?

    4) Is this line of code included in your index.php:

    Code:
    <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
    5) Using Firebug in Firefox, can you paste the AJAX response text here (if there is any), for the multiple AJAX requests?

    6) Is this line included in YouTubeToMp3Converter::GenerateMP3():

    PHP Code:
    curl_setopt($chCURLOPT_TIMEOUT1); 
    7) Have you edited the FFMPEG command in anyway (in YouTubeToMp3Converter::GenerateMP3)?

    8) Have you edited any code anywhere in the app?

    9) Also, try moving your web root from /var/www/ to /home/user/public_html/ (to combat any permissions issues). And set write permissions on the mp3, logs, and videos directories.
    Thanks for quick answer chump2877.

    1. Yes logs files are in /logs folder and video files on /videos folder
    2. here is logs file:

    3. I'm traing alot of videos bat its dosend work here is a sample link of video:
    http://www.youtube.com/watch?v=hnE-dTiBD7g
    4. Yes
    5. I don't know its that what you mean:

    6. Yes
    7. No nothing.
    8. No nothing.
    9. I have moved root directory from /var/www o /home/user/public_html and gived chmod777 to logs, mp3, and videos folder:


    I don't know where the problem is?!!!

  12. #175
    Senior Coder chump2877's Avatar
    Join Date
    Dec 2004
    Location
    the U.S. of freakin' A.
    Posts
    2,839
    Thanks
    21
    Thanked 157 Times in 148 Posts
    cana888, I can't reproduce the issue on my end. Everything worked as expected for me in Ubuntu when I tried to convert the video (link) that you posted.

    There seems to be a problem with your AJAX requests - which explains why the conversion progress bar isn't updated and you don't see the download link after the conversion completes. It also could be the reason your log file and video aren't deleted after successful conversion.

    5) Using Firebug in Firefox, can you paste the AJAX response text here (if there is any), for the multiple AJAX requests?
    You were close (regarding your screen shot). That is the correct tab in Firebug. Now you just need to expand the various + marks next to each request, copy the response text, and paste it here.

    Question: Do the AJAX requests in Firebug continue on indefinitely even after the page has stopped loading? In other words, do those lines keep getting generated in Firebug even after the page has loaded?
    Regards, R.J.

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

    Help spread the word! Like my YouTube-to-Mp3 Conversion Script on Facebook !! :-)
    [Related videos and tutorials are also available at my YouTube channel and on Dailymotion]
    Get free updates about new software version releases, features, and bug fixes!
    ♪♪ Need Web Hosting For My YouTube-To-Mp3 Conversion Software? Check Here !! ♪♪

  13. #176
    New Coder
    Join Date
    Feb 2012
    Posts
    26
    Thanks
    9
    Thanked 0 Times in 0 Posts
    If someday this script will be available on commercial Linux VPS, I'l grab it the first day

  14. #177
    Senior Coder chump2877's Avatar
    Join Date
    Dec 2004
    Location
    the U.S. of freakin' A.
    Posts
    2,839
    Thanks
    21
    Thanked 157 Times in 148 Posts
    Quote Originally Posted by zemaitis View Post
    If someday this script will be available on commercial Linux VPS, I'l grab it the first day
    I think it is available as long as you know the right sequence of commands to enter into the CLI....
    Regards, R.J.

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

    Help spread the word! Like my YouTube-to-Mp3 Conversion Script on Facebook !! :-)
    [Related videos and tutorials are also available at my YouTube channel and on Dailymotion]
    Get free updates about new software version releases, features, and bug fixes!
    ♪♪ Need Web Hosting For My YouTube-To-Mp3 Conversion Software? Check Here !! ♪♪

  15. #178
    New Coder
    Join Date
    Feb 2012
    Posts
    26
    Thanks
    9
    Thanked 0 Times in 0 Posts
    I dont know the commands ;>
    Last edited by zemaitis; 02-15-2012 at 08:12 AM.

  16. #179
    New to the CF scene
    Join Date
    Feb 2012
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Maybe just use some program to convert the YouTube to MP3:
    1. Zamzar A free online site, which supports to download and convert YouTube videos to many file formats includes: Image formats, Music formats, Doc formats, Video formats, E-book format

    2. Enolsoft YouTube to MP3 A tool can easily and quickly extract audio tracks from YouTube videos (including HD) to MP3 formats. This YouTube to MP3 Converter supports to input multiple YouTube video URLs at a time for batch downloading to MP3 formats, as well as downloading YouTube videos to AIFF, M4A, AAC, WAV, WMA and OGG audio formats.

  17. #180
    Senior Coder chump2877's Avatar
    Join Date
    Dec 2004
    Location
    the U.S. of freakin' A.
    Posts
    2,839
    Thanks
    21
    Thanked 157 Times in 148 Posts
    You can use FFMPEG to convert from just about any media file format to another media file format. So it would just be a matter of changing the FFMPEG command for different file formats and adjusting the user interface accordingly. One of these days when I have more time I might experiment with this feature.

    FFMPEG resources (quick Google search):
    http://ubuntumanual.org/posts/327/co...ideo-converter
    http://linuxaria.com/howto/tricks-ffmpeg?lang=en
    http://www.roman10.net/my-ffmpeg-commands-list/
    Regards, R.J.

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

    Help spread the word! Like my YouTube-to-Mp3 Conversion Script on Facebook !! :-)
    [Related videos and tutorials are also available at my YouTube channel and on Dailymotion]
    Get free updates about new software version releases, features, and bug fixes!
    ♪♪ Need Web Hosting For My YouTube-To-Mp3 Conversion Software? Check Here !! ♪♪


 
Page 12 of 87 FirstFirst ... 210111213142262 ... LastLast

LinkBacks (?)

  1. 08-24-2014, 05:09 AM
  2. 07-21-2014, 06:32 PM
  3. 07-12-2014, 06:59 PM
  4. 06-26-2014, 04:39 PM
  5. 05-31-2014, 10:13 PM
  6. 04-24-2014, 08:53 PM
  7. 04-19-2014, 11:22 AM
  8. 04-04-2014, 09:33 PM
  9. 04-04-2014, 02:58 AM
  10. 03-28-2014, 07:03 AM
  11. 03-20-2014, 07:11 PM
  12. 03-16-2014, 02:22 AM
  13. 03-08-2014, 05:56 PM
  14. 03-07-2014, 07:21 PM
  15. 03-01-2014, 01:48 PM
  16. 02-22-2014, 09:40 PM
  17. 02-22-2014, 01:02 AM
  18. 02-21-2014, 09:15 PM
  19. 02-21-2014, 01:00 AM
  20. 02-20-2014, 09:37 PM
  21. 02-20-2014, 07:53 PM
  22. 02-20-2014, 04:21 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •