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 13 of 86 FirstFirst ... 311121314152363 ... LastLast
Results 181 to 195 of 1288
Like Tree9Likes

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

  1. #181
    New Coder
    Join Date
    Feb 2012
    Posts
    26
    Thanks
    9
    Thanked 0 Times in 0 Posts
    I'm thinking about saving youtube flv videos with the name of unique id. If user would input the link, which's unique id matches to the file in server, the file would be converted and given for the user with the song name from youtube.

    For example, user inputs http://www.youtube.com/watch?v=222kQyGGoWg

    It takes the id 222kQyGGoWg and checks if there's a 222kQyGGoWg.flv file in the directory /videos/ ,

    if there isn't, it downloads the file named 222kQyGGoWg.flv, then converts it to /mp3/ with named song_name.mp3 ,

    or

    if there is, it converts it to /mp3/ with named song_name.mp3

    the minuses are that you would need to keep the flv files in your server, but you would save a lot of bandwidth because the service would need only to convert the existing video and to give users the mp3 file which size is small

  2. #182
    Senior Coder chump2877's Avatar
    Join Date
    Dec 2004
    Location
    the U.S. of freakin' A.
    Posts
    2,836
    Thanks
    21
    Thanked 157 Times in 148 Posts
    I'm thinking about saving youtube flv videos with the name of unique id. If user would input the link, which's unique id matches to the file in server, the file would be converted and given for the user with the song name from youtube.
    You (maybe, in the long run) save on the cost of bandwidth, but you also increase the cost of disk space required (in the short term).

    And I'm guessing that the only way to see tangible savings employing this strategy is if you were to drastically scale up the number of people using your application. And even then, how often do you think 2 or more users will want to convert the same video on YouTube? There are probably millions of videos on there, so how long would you have to run your app, and how many people would need to use it, before you actually start reaping any savings in terms of bandwidth?

    What about rationing usage of your app so that only so many downloads/conversions can be performed for a given duration, and/or by a given user, for free?
    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. #183
    New Coder
    Join Date
    Feb 2012
    Posts
    26
    Thanks
    9
    Thanked 0 Times in 0 Posts
    I have this issue with script execution speed a bit.

    http://69.194.196.150/index.php

    If I press download video, the script gives loading image and after ~20 seconds I can see quickly download appearing. How I could make it that after submitting youtube link, the YouTube video download proccess should appear without that waiting, and user could see the downloading percent bar normally?

    It happened when i moved my service to the foreign VPS and on WAMP instead of XAMPP

    php info here http://69.194.196.150/test.php apache logs show nothing

    Tried to edit init_max waiting time or something like that to 1-2sec it worked purfect, but after clicking get mp3 button the file downloading was paralyzed
    Last edited by zemaitis; 02-16-2012 at 10:02 AM.

  4. #184
    Senior Coder chump2877's Avatar
    Join Date
    Dec 2004
    Location
    the U.S. of freakin' A.
    Posts
    2,836
    Thanks
    21
    Thanked 157 Times in 148 Posts
    You've clearly changed the original code, so my advice to you is to try to get my original code to work wherever it is that you need to install it. Once you get it to work, gradually add your own code to find out what is causing the issue...

    If my original code doesn't work, then let me know, and I'll see what I can do....
    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 !! ♪♪

  5. #185
    New Coder
    Join Date
    Feb 2012
    Posts
    26
    Thanks
    9
    Thanked 0 Times in 0 Posts
    Started using your new script - working like a charm except 1 function that I was unable to do, it's automatic downloading file prompt after submitting to download the video. Tried to iframe the dynamic url of file, but unsuccesfully.
    Last edited by zemaitis; 02-16-2012 at 11:54 AM.

  6. #186
    Senior Coder chump2877's Avatar
    Join Date
    Dec 2004
    Location
    the U.S. of freakin' A.
    Posts
    2,836
    Thanks
    21
    Thanked 157 Times in 148 Posts
    Quote Originally Posted by zemaitis View Post
    Started using your new script - working like a charm except 1 function that I was unable to do, it's automatic downloading file prompt after submitting to download the video. Tried to iframe the dynamic url of file, but unsuccesfully.
    Your site seems to be working for me except for a delay between the download and the conversion. Can't think of a reason why that would be happening off hand. I don't experience that on my end.
    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 !! ♪♪

  7. #187
    New Coder
    Join Date
    Feb 2012
    Posts
    26
    Thanks
    9
    Thanked 0 Times in 0 Posts
    Yes, but how i could make download to pop up? Because people are too lazy to search and click the down link Tried via iframing the direct link or setting headers, didn't worked at all..
    Last edited by zemaitis; 02-16-2012 at 01:25 PM.

  8. #188
    Senior Coder chump2877's Avatar
    Join Date
    Dec 2004
    Location
    the U.S. of freakin' A.
    Posts
    2,836
    Thanks
    21
    Thanked 157 Times in 148 Posts
    Quote Originally Posted by zemaitis View Post
    Yes, but how i could make download to pop up? Because people are too lazy to search and click the down link Tried via iframing the direct link or setting headers, didn't worked at all..
    You could do the following:

    1) Change this code in index.php:

    Code:
    $("#preview").css("display", "none");
    var convertSuccessMsg = (retVals[2] == 1) ? '<p>Success!</p><p><a href="<?php echo $_SERVER['PHP_SELF']; ?>?mp3=' + encodeURI(songFile) + '">Download your MP3 file</a>.</p>' : '<p>Error generating MP3 file!</p>';
    $("#conversionSuccess").html(convertSuccessMsg);
    $("#conversionForm").css("display", "block");
    ...to something like (I have not tested this)...

    Code:
    if (retVals[2] == 1)
    {
    	window.location.href += '?mp3=' + encodeURI(songFile);
    }
    else
    {
    	$("#preview").css("display", "none");
    	$("#conversionSuccess").html('<p>Error generating MP3 file!</p>');
    	$("#conversionForm").css("display", "block");
    }
    2) Change this code in index.php:

    Code:
    window.onload = function()
    {
    	if (!document.getElementById('preview'))
    	{
    		$("#conversionForm").css("display", "block");
    	}
    };
    ...to something like (again, code is not tested)...

    Code:
    window.onload = function()
    {
    	if (!document.getElementById('preview'))
    	{
    		$("#conversionForm").css("display", "block");
    	}
    	<?php if (isset($_GET['mp3'])) { ?>
    		$("h2:first").after('<div id="conversionSuccess"><p>Success!</p></div>');
    	<?php } ?>
    };
    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 !! ♪♪

  9. Users who have thanked chump2877 for this post:

    zemaitis (02-16-2012)

  10. #189
    New Coder
    Join Date
    Feb 2012
    Posts
    26
    Thanks
    9
    Thanked 0 Times in 0 Posts
    First worked, thank you Is it possible to leave the old one „download from here....“ and the new one pop up download together?

    Solved: left the first one old code instead of removing, and added the first solution of the code
    Last edited by zemaitis; 02-16-2012 at 09:47 PM.

  11. #190
    New to the CF scene
    Join Date
    Feb 2012
    Posts
    3
    Thanks
    2
    Thanked 0 Times in 0 Posts
    On ubuntu 11.04 i receive this error: http://xencraft.net/logs/1329405250_...8.65734555.txt

    Can you help me?
    Last edited by skyice; 02-17-2012 at 01:47 PM.

  12. #191
    New Coder
    Join Date
    Feb 2012
    Posts
    26
    Thanks
    9
    Thanked 0 Times in 0 Posts
    1. You are working on commercial vps or your home computer?
    2. Give us the url of your functioning script
    3. Show your php info (by URL would be better, cause php info would take a very big height image)
    4. Check you apache logs about errors and show what you have.
    5. What youtube script version files are you using?
    Last edited by zemaitis; 02-17-2012 at 02:05 PM.

  13. #192
    Senior Coder chump2877's Avatar
    Join Date
    Dec 2004
    Location
    the U.S. of freakin' A.
    Posts
    2,836
    Thanks
    21
    Thanked 157 Times in 148 Posts
    Quote Originally Posted by skyice View Post
    On ubuntu 11.04 i receive this error: http://xencraft.net/logs/1329405250_...8.65734555.txt

    Can you help me?
    My gut tells me that you are missing one (or both) of the following packages (and any associated/dependent packages):

    1) libmp3lame0
    2) libavcodec-extra-53

    ...those should give you the libmp3lame codec that you need for your FFMPEG command, found in YouTubeToMp3Converter::GenerateMP3():

    PHP Code:
    $exec_string parent::_FFMPEG.' -i '.$this->GetTempVidFileName().' -y -acodec libmp3lame -ab '.$quality.'k '.$this->GetSongFileName() . ' 2> logs/' $this->_uniqueID '.txt'
    See this post for more info regarding packages required.
    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 !! ♪♪

  14. Users who have thanked chump2877 for this post:

    skyice (02-17-2012)

  15. #193
    New to the CF scene
    Join Date
    Feb 2012
    Posts
    3
    Thanks
    2
    Thanked 0 Times in 0 Posts
    Thank you but;
    I say: apt-get install libmp3lame0 libavcodec-extra-53

    I receive: Reading package lists... Done
    Building dependency tree
    Reading state information... Done
    E: Unable to locate package libavcodec-extra-53

    Sorry for my thery bad english

  16. #194
    Senior Coder chump2877's Avatar
    Join Date
    Dec 2004
    Location
    the U.S. of freakin' A.
    Posts
    2,836
    Thanks
    21
    Thanked 157 Times in 148 Posts
    Quote Originally Posted by skyice View Post
    Thank you but;
    I say: apt-get install libmp3lame0 libavcodec-extra-53

    I receive: Reading package lists... Done
    Building dependency tree
    Reading state information... Done
    E: Unable to locate package libavcodec-extra-53

    Sorry for my thery bad english
    Hmmm...try libavcodec-extra-52? You have a lower version of Ubuntu, so maybe libavcodec-extra-53 is incompatible with your system? That is my best guess.
    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 !! ♪♪

  17. Users who have thanked chump2877 for this post:

    skyice (02-17-2012)

  18. #195
    New to the CF scene
    Join Date
    Feb 2012
    Posts
    3
    Thanks
    2
    Thanked 0 Times in 0 Posts
    I said: apt-get install sudo apt-get install libavcodec-extra-52
    I receive:
    Reading package lists... Done
    Building dependency tree
    Reading state information... Done
    Package libavcodec-extra-52 is not available, but is referred to by another package.
    This may mean that the package is missing, has been obsoleted, or
    is only available from another source
    However the following packages replace it:
    ffmpeg:i386 ffmpeg

    E: Package 'libavcodec-extra-52' has no installation candidate


 
Page 13 of 86 FirstFirst ... 311121314152363 ... 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
  •