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 11 of 87 FirstFirst ... 9101112132161 ... LastLast
Results 151 to 165 of 1296
Like Tree10Likes

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

  1. #151
    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
    I've installed the files on Ubuntu and it's working. Just FYI. Will work on a tutorial. I mostly used the Synaptic Package Manager instead of the command line for installing packages. Will update this thread as soon as I can!
    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 !! ♪♪

  2. Users who have thanked chump2877 for this post:

    zemaitis (02-12-2012)

  3. #152
    New Coder
    Join Date
    Feb 2012
    Posts
    26
    Thanks
    9
    Thanked 0 Times in 0 Posts
    Can you write guide with command line too? Cuz everyone will install on their VPS and there aren't desktop visualization.

  4. #153
    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
    OK, the new (updated and hopefully stable) distribution of files is located at the bottom of this post.


    File system structure for XAMPP for Windows (you will need to download ffmpeg.exe from the FFMPEG site, as instructed earlier in this thread):

    C:\xampp\htdocs\VideoToMp3Converter\logs
    C:\xampp\htdocs\VideoToMp3Converter\mp3
    C:\xampp\htdocs\VideoToMp3Converter\videos
    C:\xampp\htdocs\VideoToMp3Converter\config.class.php
    C:\xampp\htdocs\VideoToMp3Converter\exec_ffmpeg.php
    C:\xampp\htdocs\VideoToMp3Converter\ffmpeg.exe
    C:\xampp\htdocs\VideoToMp3Converter\ffmpeg_progress.php
    C:\xampp\htdocs\VideoToMp3Converter\index.php
    C:\xampp\htdocs\VideoToMp3Converter\YouTubeToMp3Converter.class.php


    File system structure for Apache on Ubuntu 11.10 (Linux):

    /home/user/public_html/youtube/logs
    /home/user/public_html/youtube/mp3
    /home/user/public_html/youtube/videos
    /home/user/public_html/youtube/config.class.php
    /home/user/public_html/youtube/exec_ffmpeg.php
    /home/user/public_html/youtube/ffmpeg_progress.php
    /home/user/public_html/youtube/index.php
    /home/user/public_html/youtube/YouTubeToMp3Converter.class.php


    In Config class in config.class.php, set _FFMPEG constant to:

    1) For XAMPP for Windows:

    PHP Code:
    const _FFMPEG 'ffmpeg.exe'
    2) For Ubuntu (Linux):

    PHP Code:
    const _FFMPEG '/usr/bin/ffmpeg'
    (Note to Linux users: If the above is not the correct path to FFMPEG, you can type "whereis ffmpeg" into a command line for the correct path on your system.)


    For Ubuntu (Linux) users, I will try to explain the additional steps required to configure this application. Warning: I am not a Linux expert nor am I a command line expert! Also, I installed the application on a full, desktop version of Ubuntu on my development machine. Thus, the burden falls on you to adapt these instructions for a commercially hosted VPS (that may only provide a command line interface):

    1) Move the web root to /home/user/public_html/ from /var/www/ if you haven't already (if it's not already done for you) by following directions here (scroll to the "Changing the default localhost folder" subhead): http://maketecheasier.com/install-an...ntu/2011/03/09. (Doing this helped me solve all kinds of file permissions headaches when not operating as the 'root' user.)

    2) A history of the packages I installed:

    Installed the following packages:
    apache2 (2.2.20-1ubuntu1.1)
    apache2-mpm-worker (2.2.20-1ubuntu1.1)
    apache2-utils (2.2.20-1ubuntu1.1)
    apache2.2-bin (2.2.20-1ubuntu1.1)
    apache2.2-common (2.2.20-1ubuntu1.1)
    libapr1 (1.4.5-1)
    libaprutil1 (1.3.12+dfsg-2)
    libaprutil1-dbd-sqlite3 (1.3.12+dfsg-2)
    libaprutil1-ldap (1.3.12+dfsg-2)

    Removed the following packages:
    apache2-mpm-worker

    Installed the following packages:
    apache2-mpm-itk (2.2.20-1ubuntu1.1)
    libapache2-mod-php5filter (5.3.6-13ubuntu3.5)
    php5 (5.3.6-13ubuntu3.5)
    php5-cli (5.3.6-13ubuntu3.5)
    php5-common (5.3.6-13ubuntu3.5)

    Installed the following packages:
    curl (7.21.6-3ubuntu3.2)
    libcurl3 (7.21.6-3ubuntu3.2)

    Installed the following packages:
    ffmpeg (4:0.7.3-0ubuntu0.11.10.1)
    libavcodec53 (4:0.7.3-0ubuntu0.11.10.1)
    libavdevice53 (4:0.7.3-0ubuntu0.11.10.1)
    libavfilter2 (4:0.7.3-0ubuntu0.11.10.1)
    libavformat53 (4:0.7.3-0ubuntu0.11.10.1)
    libavutil51 (4:0.7.3-0ubuntu0.11.10.1)
    libdc1394-22 (2.1.3-4)
    libgsm1 (1.0.13-3)
    libpostproc52 (4:0.7.3-0ubuntu0.11.10.1)
    libschroedinger-1.0-0 (1.0.10-2.1)
    libswscale2 (4:0.7.3-0ubuntu0.11.10.1)
    libva1 (1.0.12-2)
    libvpx0 (0.9.6-1)

    Installed the following packages:
    php5-curl (5.3.6-13ubuntu3.5)

    Installed the following packages:
    php5-ffmpeg (0.6.0-2ubuntu2)
    php5-gd (5.3.6-13ubuntu3.5)

    Installed the following packages:
    libmp3lame0 (3.98.4-0ubuntu1)

    Removed the following packages:
    libavcodec53
    libavutil51

    Installed the following packages:
    libavcodec-extra-53 (4:0.7.3ubuntu0.11.10.1)
    libavutil-extra-51 (4:0.7.3ubuntu0.11.10.1)
    libdirac-encoder0 (1.0.2-4)
    libopenjpeg2 (1.3+dfsg-4)
    libvo-aacenc0 (0.1.1-1)
    libvo-amrwbenc0 (0.1.1-1)
    libx264-116 (2:0.116.2042+git178455c-1ubuntu1)
    libxvidcore4 (2:1.3.2-3)

    3) You may need to restart Apache after all packages have been installed (or in between installations?) via the command line:

    $sudo service apache2 stop
    $sudo service apache2 start

    4) Make sure the following lines appear in your php.ini:

    extension=curl.so
    extension=ffmpeg.so

    5) Set write permissions on the following directories: chmod 777 mp3, chmod 777 videos, chmod 777 logs

    6) software.xml should be set to chmod 0777, or the lowest permissions possible that still enable programmatic modification of this file. There should be no need to edit software.xml, and thus modifying this file is strongly discouraged.

    7) The root directory where my software is installed should also be set to the lowest permissions possible that still enable programmatic creation, opening, and modification of the containing files. In the example file system structures above, those directories are 'C:\xampp\htdocs\VideoToMp3Converter' and '/home/user/public_html/youtube/'.


    Finally, zemaitis, or anyone else familiar with the Linux command line interface, it would be great if you could adapt all of this for the command line and publish the result here! It would certainly help me and any others using this script on commercially hosted servers.

    As always, please let me know if you have any questions/concerns regarding the above and/or the code.

    See the new zip file below:

    . . . !! ALERT !!
    Attached Files Attached Files
    Last edited by chump2877; 10-30-2014 at 03:37 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 !! ♪♪

  5. The Following 2 Users Say Thank You to chump2877 For This Useful Post:

    mikevic80 (03-03-2012), zemaitis (02-12-2012)

  6. #154
    New Coder
    Join Date
    Feb 2012
    Posts
    26
    Thanks
    9
    Thanked 0 Times in 0 Posts
    Now im searching for a commercial vps, cause i sold mine because of script not working properly ;D

    Also there exists one problem, if video is with symbol ž, in the final name of the file, there aren't any replacement for it. It would need to be z... I dont know how is there with letters ąčęėįšųū
    Last edited by zemaitis; 02-12-2012 at 12:18 PM.

  7. #155
    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
    Now im searching for a commercial vps, cause i sold mine because of script not working properly ;D

    Also there exists one problem, if video is with symbol , in the final name of the file, there aren't any replacement for it. It would need to be z... I dont know how is there with letters ąčęėįųū
    Can you give me a link to a YouTube video with characters like those in the title....I suspect there is a PHP extension that exposes functions capable of making the conversion...
    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. #156
    New Coder
    Join Date
    Feb 2012
    Posts
    26
    Thanks
    9
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by chump2877 View Post
    Can you give me a link to a YouTube video with characters like those in the title....I suspect there is a PHP extension that exposes functions capable of making the conversion...
    http://www.youtube.com/watch?v=5bbZRMf2zzE
    http://www.youtube.com/watch?v=2QbqawL_lL4

    That letters dissapear while converting, should be

    ą -> a
    č -> c
    ę -> e
    ė -> e
    į -> i
    -> s
    ų -> u
    ū -> u

    Also would be great if you do that compatible for all ur plugin versions.

  9. #157
    New Coder
    Join Date
    Feb 2012
    Posts
    26
    Thanks
    9
    Thanked 0 Times in 0 Posts
    Talking about dedicated host, the start should look like this (not all lines included..)

    sudo apt-get update
    sudo apt-get install apache2 apache2-mpm-worker apache2-utils apache2.2-bin apache2.2-common libapr1 libaprutil1 libaprutil1-dbd-sqlite3 libaprutil1-ldap
    sudo apt-get remove apache2-mpm-worker
    sudo apt-get install apache2-mpm-itk libapache2-mod-php5filter php5 php5-cli php5-common

    Further i was unable to install nothing, for example it said that it is unable to find package libavcodec53

  10. #158
    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
    http://www.youtube.com/watch?v=5bbZRMf2zzE
    http://www.youtube.com/watch?v=2QbqawL_lL4

    That letters dissapear while converting, should be

    ą -> a
    č -> c
    ę -> e
    ė -> e
    į -> i
    -> s
    ų -> u
    ū -> u

    Also would be great if you do that compatible for all ur plugin versions.
    Edit VideoToMp3Converter::ExtractSongTrackName as follows:

    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 ereg_replace('[^-_a-zA-Z,"\' :0-9]'""iconv("UTF-8""ISO-8859-1//TRANSLIT"end(explode('title="'$name))));
                    }
                }
                return 
    $name;
            } 
    The key here is the use of iconv().
    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. Users who have thanked chump2877 for this post:

    zemaitis (02-12-2012)

  12. #159
    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
    Talking about dedicated host, the start should look like this (not all lines included..)

    sudo apt-get update
    sudo apt-get install apache2 apache2-mpm-worker apache2-utils apache2.2-bin apache2.2-common libapr1 libaprutil1 libaprutil1-dbd-sqlite3 libaprutil1-ldap
    sudo apt-get remove apache2-mpm-worker
    sudo apt-get install apache2-mpm-itk libapache2-mod-php5filter php5 php5-cli php5-common

    Further i was unable to install nothing, for example it said that it is unable to find package libavcodec53
    I just regurgitated the (relevant) chronologically-listed package install history from Synaptic Package Manager in Ubuntu. You'll notice that some packages were installed and then removed. 'libavcodec53' is an example of that. It appears that 'libavcodec53' was installed/bundled with ffmpeg. Then, later, 'libavcodec53' is removed and replaced with 'libavcodec-extra-53' (probably because I realized that 'libavcodec53' wasn't doing the job).
    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. Users who have thanked chump2877 for this post:

    zemaitis (02-12-2012)

  14. #160
    New Coder
    Join Date
    Feb 2012
    Posts
    26
    Thanks
    9
    Thanked 0 Times in 0 Posts
    Thank you for the file name fixes, working very well!

    Well, i decided to buy Windows VPS and to forget problems about linux

    In my opinion, i have last question about the file names, how to fix the quotes, periods, brackets problem? For example, video

    http://www.youtube.com/watch?v=nvmlr89qTTs called as „Žas- "Ji suka (gyvenimo ratu)" Gyvai 1997.“

    extracts as „Zas- quotJi suka gyvenimo ratuquot Gyvai 1997“ (quotes written as the word quot,periods,brackets disappeared)
    Last edited by zemaitis; 02-12-2012 at 06:15 PM.

  15. #161
    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

    In my opinion, i have last question about the file names, how to fix the quotes, periods, brackets problem? For example, video

    http://www.youtube.com/watch?v=nvmlr89qTTs called as „Žas- "Ji suka (gyvenimo ratu)" Gyvai 1997.“

    extracts as „Zas- quotJi suka gyvenimo ratuquot Gyvai 1997“ (quotes written as the word quot,periods,brackets disappeared)
    Try this code instead of the previous code that I posted earlier:

    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 html_entity_decode(iconv("UTF-8""ISO-8859-1//TRANSLIT"end(explode('title="'$name))));
                    }
                }
                return 
    $name;
            } 
    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 !! ♪♪

  16. Users who have thanked chump2877 for this post:

    zemaitis (02-12-2012)

  17. #162
    New Coder
    Join Date
    Feb 2012
    Posts
    26
    Thanks
    9
    Thanked 0 Times in 0 Posts
    Are there any necessary ports required to run this service? i have rent my vps on http://77.241.193.246/index.php but the script doesnt download files. Opened ports 80, 3306

    It creates a file, but doesn't download http://www.part.lt/img/2801508fc3110...3a9dc1e281.JPG

    or are there programs necessary like redistributable or newer media player?
    Last edited by zemaitis; 02-13-2012 at 06:09 PM.

  18. #163
    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
    Running the script in XAMPP on Windows and running the script on an actual Windows server with Apache/PHP installed are two different animals. I have not tested the script in the latter environment.

    And if you are running XAMPP on a Windows server that already has Apache/PHP installed, then you will have 2 different web roots and only one can be assigned localhost. I imagine there might be additional conflicts as well.

    Moral of the story: If you are aiming to publish this on the web, then don't use XAMPP for Windows. Use a regular Windows or Linux server.

    To answer your question about the ports: I have no idea.

    But if you run this on a Windows server with Apache and PHP installed (as it seems you are), you'll want to research the right way to install/configure cURL in that setup: https://www.google.com/search?client...hannel=suggest
    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 !! ♪♪

  19. Users who have thanked chump2877 for this post:

    zemaitis (02-13-2012)

  20. #164
    New Coder
    Join Date
    Feb 2012
    Posts
    26
    Thanks
    9
    Thanked 0 Times in 0 Posts
    Enabled curl in php.ini, everything works like a charm

    Thank you chump for supporting me this all time. Was unexpected from the script admin, started being developed before 2 yrs. If i will have some success, I will donate you.
    Last edited by zemaitis; 02-13-2012 at 06:37 PM.

  21. #165
    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
    Enabled curl in php.ini, everything works like a charm

    Thank you chump for supporting me this all time. Was unexpected from the script admin, started being developed before 2 yrs. If i will have some success, I will donate you.
    Glad to hear you got it working .....I needed to test this script in a Linux installation anyway, so we helped each other...
    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 11 of 87 FirstFirst ... 9101112132161 ... 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
  •