Go Back   CodingForums.com > :: Server side development > PHP > Post a PHP snippet

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rating: Thread Rating: 7 votes, 5.00 average.
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 03-21-2012, 11:30 AM   PM User | #316
cana888
New Coder

 
Join Date: Feb 2012
Posts: 15
Thanks: 4
Thanked 0 Times in 0 Posts
cana888 is an unknown quantity at this point
I tried to 3 different servers, same problem with downloading progress bar. I miss something bat I dont know what??? :S

This is in new server, with slower internet connections.
http://www.zaap.ch

Code:
traceroute to www.youtube.com (209.85.148.190), 30 hops max, 60 byte packets
 1  130.185.109.33 (130.185.109.33)  1.403 ms  1.394 ms  1.583 ms
 2  80.255.15.105 (80.255.15.105)  0.171 ms  0.468 ms  0.453 ms
 3  xae0-2004.fra20.core-backbone.com (81.95.15.142)  3.426 ms  3.421 ms xae0-20                             06.fra20.core-backbone.com (80.255.15.75)  3.401 ms
 4  de-cix20.net.google.com (80.81.193.108)  4.578 ms  4.573 ms  5.027 ms
 5  72.14.238.46 (72.14.238.46)  4.177 ms  4.534 ms 72.14.238.230 (72.14.238.230                             )  4.534 ms
 6  209.85.254.41 (209.85.254.41)  11.837 ms 209.85.254.57 (209.85.254.57)  6.96                             7 ms 209.85.254.41 (209.85.254.41)  11.450 ms
 7  fra07s07-in-f190.1e100.net (209.85.148.190)  4.585 ms  4.903 ms  4.887 ms
cana888 is offline   Reply With Quote
Old 03-21-2012, 10:44 PM   PM User | #317
chump2877
Senior Coder

 
chump2877's Avatar
 
Join Date: Dec 2004
Location: the U.S. of freakin' A.
Posts: 2,530
Thanks: 15
Thanked 128 Times in 121 Posts
chump2877 is on a distinguished road
cana888, You seem to be having some kind of issue with output buffering. YouTubeToMp3Converter::UpdateVideoDownloadProgress() should look like the following:

PHP Code:
        function UpdateVideoDownloadProgress($downloadSize$downloaded$uploadSize$uploaded)
        {
            
$percent round($downloaded/$downloadSize2) * 100;
            if (
$percent $this->_percentVidDownloaded)
            {
                
$this->_percentVidDownloaded++;
                echo 
'<script type="text/javascript">updateVideoDownloadProgress("'$percent .'");</script>';
                
ob_end_flush();
                
ob_flush();
                
flush();
            }
        } 
The following code:

PHP Code:
                ob_end_flush();
                
ob_flush();
                
flush(); 
...is what flushes the output buffer immediately, every time cURL accesses YouTubeToMp3Converter::UpdateVideoDownloadProgress(). For some reason, this is not happening for you, and the <script> blocks do not output until ALL code is completely done running. I don't know why this is happening for you.
__________________
Regards, R.J.
chump2877 is offline   Reply With Quote
Old 04-18-2012, 02:28 AM   PM User | #318
secretja
New to the CF scene

 
Join Date: Apr 2012
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
secretja is an unknown quantity at this point
Hi,

sorry for my off topic question. Know somebody how Java applet based converter work? And where I can buy something like that?

THX
secretja is offline   Reply With Quote
Old 04-18-2012, 02:56 AM   PM User | #319
chump2877
Senior Coder

 
chump2877's Avatar
 
Join Date: Dec 2004
Location: the U.S. of freakin' A.
Posts: 2,530
Thanks: 15
Thanked 128 Times in 121 Posts
chump2877 is on a distinguished road
Quote:
Originally Posted by secretja View Post
Hi,

sorry for my off topic question. Know somebody how Java applet based converter work? And where I can buy something like that?

THX
I've seen this before, and the java-based converters are nice because they appear to shift all or some of the burden of conversion from the server to the client.

I can't remember where I saw the online service that used this. And I don't know who sells something like this. Perhaps someone else knows.
__________________
Regards, R.J.
chump2877 is offline   Reply With Quote
Old 04-18-2012, 05:20 AM   PM User | #320
secretja
New to the CF scene

 
Join Date: Apr 2012
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
secretja is an unknown quantity at this point
Hi,

thx for answer. All what I have found is this(vidfetch . c0m) and one more site which is selling the same thing.

thx one more time.

Quote:
Originally Posted by chump2877 View Post
I've seen this before, and the java-based converters are nice because they appear to shift all or some of the burden of conversion from the server to the client.

I can't remember where I saw the online service that used this. And I don't know who sells something like this. Perhaps someone else knows.
secretja is offline   Reply With Quote
Old 04-18-2012, 06:19 AM   PM User | #321
chump2877
Senior Coder

 
chump2877's Avatar
 
Join Date: Dec 2004
Location: the U.S. of freakin' A.
Posts: 2,530
Thanks: 15
Thanked 128 Times in 121 Posts
chump2877 is on a distinguished road
New Version Available!

Hi all,

I wanted to let everyone know that I have written a more fully-featured version of the free application offered in this thread. The new version of the app (based on the free version) does the following:
  • Converts both YouTube.com and Dailymotion.com videos (the 2 most popular video hosting sites in the world)
  • Outputs converted files to mp3, mp4, flv, and/or 3gp formats
  • Enables volume adjustment prior to conversion via jQuery slider control
  • Displays download AND conversion progress via corresponding progress bars
  • Leverages the power of FFmpeg (http://ffmpeg.org/) to create crisp, clean, quality conversions of audio/video files.
  • Includes a tool that creates ringtones of converted mp3 files
  • Includes JavaScript bookmarklet/browser plugin that enables your site visitors to convert videos directly on YouTube and Dailymotion video pages. Bookmarklet loads conversion interface directly into video page, and forwards user to your site for actual conversion and converted file retrieval.
  • Initiates conversions via form submission (POST request) as well as URL query string (GET request)
  • Validates video URLs prior to conversion
  • Facilitates the addition of more video hosting sites as well as converted file types (by editing the code)
  • Expanded config file for a more customizable interface (i.e., easy access to FFmpeg commands for different converted file types and the ability to configure default video/audio qualities, default volume, and maximum allowed length of YouTube/Dailymotion videos)
  • Secures access to the server so that FFMPEG commands can only be run if a unique token is present
  • Includes script that can be run as a scheduled task on the server, that deletes old converted files and ringtones
  • Programmed entirely in easy-to-read PHP OOP (Object Oriented Programming), JavaScript/jQuery, and CSS to facilitate effortless editing/customization of code
Quote:
Note: To reiterate, the software requirements are the same as those detailed here. The Win32 version of my software caters to both Windows AND XAMPP users.
At this time, I am not offering this latest version for free. If you're interested, please contact me by email or PM for further information, pricing details, and a demonstration. (For immediate purchase, please visit the Linux and Win32 versions of this software on their respective product pages.) My aim is to keep the paid-for version of this application affordable, so the price is negotiable to fit almost any budget. Again, please contact me, and I'm sure we can work something out.

I will continue to maintain and provide support for both the free and paid-for versions of the application via this thread. For now, both versions of the script will coexist. When either YouTube or Dailymotion makes changes to the front-end of their site, I will continue to post fixes here to keep all versions of the application operational.

Thank you for all of your interest in this application, and for visiting this thread. Your ongoing interest has really fueled the growth of this software. As always, I welcome any suggestions and/or feedback you might have.

Quote:
NOTE: See screenshots attached below. The following screencasts also illustrate key functionality:
  1. YouTube.com video conversion to MP4 format
  2. Dailymotion.com video conversion to FLV format
  3. YouTube.com video conversion to MP3 format and ringtone
  4. Volume slider control new!
  5. Conversion bookmarklet/browser plugin new!
All screencasts were performed on a virtual Linux server (Ubuntu 11.10).
Quote:
SPOTLIGHT! (new!): The following websites are currently using this software*:
  • YoutubeMp3.fr
    Easily convert YouTube & Dailymotion videos online!
  • You4mp3.com
    Convert YouTube and Dailymotion videos to mp3 in high quality!

* Please contact me if you would like to have your site listed here (FREE) or to notify me of dead links or non-functioning sites.
Quote:
For a limited time, I am offering this script for only $23.95 USD !! (That's 40% off the regular price of $39.95 USD!)
Again, that includes all the functionality listed above plus free support for life. I urge you to take advantage of this offer as soon as possible.
For immediate purchase, please visit the Linux and Win32 versions of this software on their respective product pages. Payment requires a valid PayPal account or credit card.
Please contact me if you have any additional questions/concerns.

Attached Thumbnails
Click image for larger version

Name:	screenshot1.jpg
Views:	405
Size:	27.8 KB
ID:	11077   Click image for larger version

Name:	screenshot2.jpg
Views:	302
Size:	21.5 KB
ID:	11078   Click image for larger version

Name:	screenshot3.jpg
Views:	255
Size:	30.5 KB
ID:	11079   Click image for larger version

Name:	screenshot4.jpg
Views:	322
Size:	25.7 KB
ID:	11080  
__________________
Regards, R.J.

Last edited by chump2877; 05-15-2013 at 03:41 PM..
chump2877 is offline   Reply With Quote
Old 04-29-2012, 09:37 AM   PM User | #322
bedo1975
New Coder

 
Join Date: Feb 2012
Posts: 29
Thanks: 1
Thanked 0 Times in 0 Posts
bedo1975 is an unknown quantity at this point
Nice options that you have added !

Last edited by bedo1975; 04-30-2012 at 05:31 PM..
bedo1975 is offline   Reply With Quote
Old 05-01-2012, 05:25 AM   PM User | #323
chump2877
Senior Coder

 
chump2877's Avatar
 
Join Date: Dec 2004
Location: the U.S. of freakin' A.
Posts: 2,530
Thanks: 15
Thanked 128 Times in 121 Posts
chump2877 is on a distinguished road
Hi everyone,

It has come to my attention that my code no longer works correctly with the latest 32-bit or 64-bit static builds of ffmpeg.exe on Windows servers or in an XAMPP environment.

For the sake of backwards compatibility with previous versions of this app, and due to my own current time restraints, I have decided not to modify the code accordingly at this time, and instead offer a download link to the older build of ffmpeg.exe that does in fact work with my code.

The differences between the older and newer builds of ffmpeg.exe are insignificant in terms of my app's performance.

I have added the older ffmpeg.exe build's download link HERE. (Because the file is over 4 MB and this forum doesn't allow large file attachments, the file is being hosted at PutLocker.com instead.) Windows and XAMPP users should use this version of ffmpeg.exe to ensure continued functioning of the free version of my app.

The paid-for, Windows version of my app will continue to work as advertised because it already includes the older build of ffmpeg.exe.

Finally, this does not affect Linux users at all (because ffmpeg.exe is not required for Linux). Linux users can continue to use my app without issues.
__________________
Regards, R.J.

Last edited by chump2877; 05-01-2012 at 05:55 AM..
chump2877 is offline   Reply With Quote
Old 05-12-2012, 04:57 PM   PM User | #324
blacktiger786
New Coder

 
Join Date: May 2012
Posts: 26
Thanks: 0
Thanked 0 Times in 0 Posts
blacktiger786 is an unknown quantity at this point
i want to buy this full script
who convert
youtube to mp3,mp4,3gp
tell me price
blacktiger786 is offline   Reply With Quote
Old 05-12-2012, 07:30 PM   PM User | #325
chump2877
Senior Coder

 
chump2877's Avatar
 
Join Date: Dec 2004
Location: the U.S. of freakin' A.
Posts: 2,530
Thanks: 15
Thanked 128 Times in 121 Posts
chump2877 is on a distinguished road
Quote:
Originally Posted by blacktiger786 View Post
i want to buy this full script
who convert
youtube to mp3,mp4,3gp
tell me price
For immediate purchase, please visit the Linux and Win32 versions of this software on their respective product pages.
__________________
Regards, R.J.
chump2877 is offline   Reply With Quote
Old 05-13-2012, 05:22 PM   PM User | #326
blacktiger786
New Coder

 
Join Date: May 2012
Posts: 26
Thanks: 0
Thanked 0 Times in 0 Posts
blacktiger786 is an unknown quantity at this point
what is different in linux and win32
and i add some changes in this site
1. i want some beautifull skin of this site..
2. i want when conversion complete and show download link its show with some share opation like facebbok,tweet,gplus and email also
blacktiger786 is offline   Reply With Quote
Old 05-14-2012, 01:31 AM   PM User | #327
chump2877
Senior Coder

 
chump2877's Avatar
 
Join Date: Dec 2004
Location: the U.S. of freakin' A.
Posts: 2,530
Thanks: 15
Thanked 128 Times in 121 Posts
chump2877 is on a distinguished road
Quote:
Originally Posted by blacktiger786 View Post
what is different in linux and win32
and i add some changes in this site
1. i want some beautifull skin of this site..
2. i want when conversion complete and show download link its show with some share opation like facebbok,tweet,gplus and email also
The Linux version is preconfigured for Linux servers, and the Win32 version is preconfigured for Windows/XAMPP servers. Linux version comes with some additional instructions for server install/set-up. Windows version comes with a version of ffmpeg.exe already included.

The software comes with no default skin. The default design is minimalistic and intended to be enhanced by the purchaser via CSS, etc. I could add a default skin, but I doubt most people would use it. Can you imagine a bunch of web sites implementing my software that all looked the same? It's kind of like the default WordPress theme -- what's the point of providing a beautiful default theme/skin, if everyone will ultimately customize the theme or create a new theme for their personal sites?

There is a placeholder div at the top of every page throughout the conversion process that can be easily edited to add social networking buttons. You will need to generate the required code for each button on their respective sites, i.e.:

1) Facebook - http://developers.connect.facebook.c.../plugins/like/
2) Twitter - http://twitter.com/about/resources/buttons
3) Google +1 - http://www.google.com/intl/en/webmas...ton/index.html
4) etc., etc....

...then you will need to insert the button code into the existing placeholder div element in my app.
__________________
Regards, R.J.
chump2877 is offline   Reply With Quote
Old 05-14-2012, 03:44 PM   PM User | #328
atanas
New Coder

 
Join Date: Jan 2012
Posts: 23
Thanks: 0
Thanked 0 Times in 0 Posts
atanas is an unknown quantity at this point
Hello people. I have a strange problem. I run that script on my old pc with ubuntu 12.04 LTS (32 bit) and it work. I buy a new pc with 6 cores processor (AMD FX-6200 /3.8G/X6/BOX AM3+) and 8GB DDR III 1333Mhz but work slowly than my old pc with 1 core cpu on 2.2 GHz. I try 64 and 32 bits but there are no changes. Any ideas ?
atanas is offline   Reply With Quote
Old 05-14-2012, 04:04 PM   PM User | #329
chump2877
Senior Coder

 
chump2877's Avatar
 
Join Date: Dec 2004
Location: the U.S. of freakin' A.
Posts: 2,530
Thanks: 15
Thanked 128 Times in 121 Posts
chump2877 is on a distinguished road
Quote:
Originally Posted by atanas View Post
Hello people. I have a strange problem. I run that script on my old pc with ubuntu 12.04 LTS (32 bit) and it work. I buy a new pc with 6 cores processor (AMD FX-6200 /3.8G/X6/BOX AM3+) and 8GB DDR III 1333Mhz but work slowly than my old pc with 1 core cpu on 2.2 GHz. I try 64 and 32 bits but there are no changes. Any ideas ?
What OS is installed on the new system? You may have configured your new system incorrectly to run the script. Really, anything could be at fault here. You need to supply more specifics about what isn't working. Error messages and server error log output would be helpful.
__________________
Regards, R.J.
chump2877 is offline   Reply With Quote
Old 05-14-2012, 04:16 PM   PM User | #330
atanas
New Coder

 
Join Date: Jan 2012
Posts: 23
Thanks: 0
Thanked 0 Times in 0 Posts
atanas is an unknown quantity at this point
Hello again. I install again Ubuntu 12.04 LTS and try 32 bits and 64 but again convert slowly than my older pc.
atanas is offline   Reply With Quote
Reply

Bookmarks

Tags
audio, class, conversion, dailymotion, ffmpeg, mp3, php, script, video, youtube

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 05:56 PM.


Advertisement
Log in to turn off these ads.