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 02-26-2012, 06:56 PM   PM User | #256
drakus
New Coder

 
Join Date: Feb 2012
Posts: 24
Thanks: 0
Thanked 3 Times in 3 Posts
drakus is an unknown quantity at this point
Quote:
Originally Posted by orditeck View Post
worked fine here...
drakus is offline   Reply With Quote
Old 02-26-2012, 07:03 PM   PM User | #257
orditeck
New to the CF scene

 
Join Date: Feb 2012
Posts: 7
Thanks: 1
Thanked 0 Times in 0 Posts
orditeck is an unknown quantity at this point
Quote:
Originally Posted by drakus View Post
worked fine here...
What kind of FLV url does it give you? Same as mine?

Just trying to figure out if the problem comes from the URL...
Else it means that it comes from the download, I'll have to figure out why it creates a 0kb file in the video folder and then directly try to convert it as if it was completed..!

Last edited by orditeck; 02-26-2012 at 07:06 PM..
orditeck is offline   Reply With Quote
Old 02-26-2012, 07:05 PM   PM User | #258
umang.goyal
New Coder

 
Join Date: Feb 2012
Posts: 10
Thanks: 1
Thanked 0 Times in 0 Posts
umang.goyal is an unknown quantity at this point
Hi, i have came across something. when i put a URL to convert the video into mp3 and before it downloads i refresh the page or close it, script does not stops downloading the video it keeps on downloading video....has anyone seen this with them as well?
umang.goyal is offline   Reply With Quote
Old 02-26-2012, 07:21 PM   PM User | #259
drakus
New Coder

 
Join Date: Feb 2012
Posts: 24
Thanks: 0
Thanked 3 Times in 3 Posts
drakus is an unknown quantity at this point
Quote:
Originally Posted by orditeck View Post
What kind of FLV url does it give you? Same as mine?

Just trying to figure out if the problem comes from the URL...
Else it means that it comes from the download, I'll have to figure out why it creates a 0kb file in the video folder and then directly try to convert it as if it was completed..!
For some reason your server is grabbing it from the cache of youtube & not the main url.

i bolded the cache part...

http://o-o.preferred.par08s01.v5.lscache4.c.youtube.com/videoplayback?sparams=id,expire,ip,ipbits,itag,source,ratebypass,cp&fexp=916012,901700&itag=46&ip=17 6.0.0.0&signature=D197D5B65021AE7FB63941EA1F4C487AA633C36D.48853737618BFCD963ED3B8434C2C7B30EA52021& sver=3&ratebypass=yes&source=youtube&expire=1330300216&key=yt1&ipbits=8&cp=U0hSRVNLTl9GUENOMl9LRVJDO lZucTZ3c3dLVDRl&id=768db7b137b87610
drakus is offline   Reply With Quote
Old 02-26-2012, 07:29 PM   PM User | #260
orditeck
New to the CF scene

 
Join Date: Feb 2012
Posts: 7
Thanks: 1
Thanked 0 Times in 0 Posts
orditeck is an unknown quantity at this point
Quote:
Originally Posted by drakus View Post
For some reason your server is grabbing it from the cache of youtube & not the main url.

i bolded the cache part...

http://o-o.preferred.par08s01.v5.lscache4.c.youtube.com/videoplayback?sparams=id,expire,ip,ipbits,itag,source,ratebypass,cp&fexp=916012,901700&itag=46&ip=17 6.0.0.0&signature=D197D5B65021AE7FB63941EA1F4C487AA633C36D.48853737618BFCD963ED3B8434C2C7B30EA52021& sver=3&ratebypass=yes&source=youtube&expire=1330300216&key=yt1&ipbits=8&cp=U0hSRVNLTl9GUENOMl9LRVJDO lZucTZ3c3dLVDRl&id=768db7b137b87610
The url seems to work...
Could you send me the FLV URL you get from the same youtube video?
orditeck is offline   Reply With Quote
Old 02-26-2012, 08:00 PM   PM User | #261
drakus
New Coder

 
Join Date: Feb 2012
Posts: 24
Thanks: 0
Thanked 3 Times in 3 Posts
drakus is an unknown quantity at this point
Code:
http:\/\/o-o.preferred.ord12s06.v22.lscache8.c.youtube.com\/generate_204?sparams=id%2Cexpire%2Cip%2Cipbits%2Citag%2Csource%2Calgorithm%2Cburst%2Cfactor%2Ccp\u0026fexp=913528\u0026algorithm=throttle-factor\u0026itag=34\u0026ip=66.0.0.0\u0026burst=40\u0026sver=3\u0026signature=18FBDA9A65641990622D4AF4B2260F7AC029FE0E.5A4F885F9D917F8B6483E0A3E5477A0D9A5AD80A\u0026source=youtube\u0026expire=1330307416\u0026key=yt1\u0026ipbits=8\u0026factor=1.25\u0026cp=U0hSRVNLVV9GUENOMl9LRVlFOjZZbHZ3N0tOTDZH\u0026id=768db7b137b87610
For most part same one just different cache link..

If you look at the source, you will that it will be the same thing or very similiar.

look for img.src and you will see something like this.

Code:
img.src = "http:\/\/o-o.preferred.ord12s06.v22.lscache8.c.youtube.com\/generate_204?sparams=id%2Cexpire%2Cip%2Cipbits%2Citag%2Csource%2Calgorithm%2Cburst%2Cfactor%2Ccp\u0026fexp=913528\u0026algorithm=throttle-factor\u0026itag=34\u0026ip=66.0.0.0\u0026burst=40\u0026sver=3\u0026signature=18FBDA9A65641990622D4AF4B2260F7AC029FE0E.5A4F885F9D917F8B6483E0A3E5477A0D9A5AD80A\u0026source=youtube\u0026expire=1330307416\u0026key=yt1\u0026ipbits=8\u0026factor=1.25\u0026cp=U0hSRVNLVV9GUENOMl9LRVlFOjZZbHZ3N0tOTDZH\u0026id=768db7b137b87610";
drakus is offline   Reply With Quote
Old 02-26-2012, 08:07 PM   PM User | #262
orditeck
New to the CF scene

 
Join Date: Feb 2012
Posts: 7
Thanks: 1
Thanked 0 Times in 0 Posts
orditeck is an unknown quantity at this point
Quote:
Originally Posted by drakus View Post
Code:
http:\/\/o-o.preferred.ord12s06.v22.lscache8.c.youtube.com\/generate_204?sparams=id%2Cexpire%2Cip%2Cipbits%2Citag%2Csource%2Calgorithm%2Cburst%2Cfactor%2Ccp\u0026fexp=913528\u0026algorithm=throttle-factor\u0026itag=34\u0026ip=66.0.0.0\u0026burst=40\u0026sver=3\u0026signature=18FBDA9A65641990622D4AF4B2260F7AC029FE0E.5A4F885F9D917F8B6483E0A3E5477A0D9A5AD80A\u0026source=youtube\u0026expire=1330307416\u0026key=yt1\u0026ipbits=8\u0026factor=1.25\u0026cp=U0hSRVNLVV9GUENOMl9LRVlFOjZZbHZ3N0tOTDZH\u0026id=768db7b137b87610
For most part same one just different cache link..

If you look at the source, you will that it will be the same thing or very similiar.

look for img.src and you will see something like this.

Code:
img.src = "http:\/\/o-o.preferred.ord12s06.v22.lscache8.c.youtube.com\/generate_204?sparams=id%2Cexpire%2Cip%2Cipbits%2Citag%2Csource%2Calgorithm%2Cburst%2Cfactor%2Ccp\u0026fexp=913528\u0026algorithm=throttle-factor\u0026itag=34\u0026ip=66.0.0.0\u0026burst=40\u0026sver=3\u0026signature=18FBDA9A65641990622D4AF4B2260F7AC029FE0E.5A4F885F9D917F8B6483E0A3E5477A0D9A5AD80A\u0026source=youtube\u0026expire=1330307416\u0026key=yt1\u0026ipbits=8\u0026factor=1.25\u0026cp=U0hSRVNLVV9GUENOMl9LRVlFOjZZbHZ3N0tOTDZH\u0026id=768db7b137b87610";
Yes I saw that it's very similar in the source of the YouTube page,
so why are you saying that my problem may be that my server grab the cache URL and not the main url? It seems that youtube itself takes the cache, so I guess this is actually the main url. Don't know if I'm clear enough here hehe.

If my link is good, I really don't see where my issue come from then...
orditeck is offline   Reply With Quote
Old 02-26-2012, 08:16 PM   PM User | #263
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
orditeck, I tried to convert your video. The first time, it said there was an error downloading the video. The second time --- well it's still downloading at the moment (so it is downloading, but VERY slowly).

I converted another video and it worked fine.

My best guess is that YouTube is currently experiencing some server difficulties or perhaps is changing parts of their site's front end.

I do know that YouTube has been making some changes with their channel layouts recently, so it wouldn't surprise me if we are in for another format change site-wide. In that case, I'll have to make some changes to the code to adjust. Keep me posted.
__________________
Regards, R.J.
chump2877 is offline   Reply With Quote
Users who have thanked chump2877 for this post:
orditeck (02-26-2012)
Old 02-26-2012, 08:20 PM   PM User | #264
orditeck
New to the CF scene

 
Join Date: Feb 2012
Posts: 7
Thanks: 1
Thanked 0 Times in 0 Posts
orditeck is an unknown quantity at this point
Quote:
Originally Posted by chump2877 View Post
orditeck, I tried to convert your video. The first time, it said there was an error downloading the video. The second time --- well it's still downloading at the moment (so it is downloading, but VERY slowly).

I converted another video and it worked fine.

My best guess is that YouTube is currently experiencing some server difficulties or perhaps is changing parts of their site's front end.

I do know that YouTube has been making some changes with their channel layouts recently, so it wouldn't surprise me if we are in for another format change site-wide. In that case, I'll have to make some changes to the code to adjust. Keep me posted.
Hi,

thanks for your answer.
The problem appears with every video I tried.
I tried the same videos on some live URL people gave here and it was working...

You can also try my demo if you want: http://188.165.33.43/yt/index.php
There is just no download. It creates an emply .flv and try to convert it, that's it.

Log shows:
Code:
FFmpeg version SVN-r0.5.1-4:0.5.1-1ubuntu1.3, Copyright (c) 2000-2009 Fabrice Bellard, et al.
  configuration: --extra-version=4:0.5.1-1ubuntu1.3 --prefix=/usr --enable-avfilter --enable-avfilter-lavf --enable-vdpau --enable-bzlib --enable-libgsm --enable-libschroedinger --enable-libspeex --enable-libtheora --enable-libvorbis --enable-pthreads --enable-zlib --disable-stripping --disable-vhook --enable-runtime-cpudetect --enable-gpl --enable-postproc --enable-swscale --enable-x11grab --enable-libdc1394 --enable-shared --disable-static
  libavutil     49.15. 0 / 49.15. 0
  libavcodec    52.20. 1 / 52.20. 1
  libavformat   52.31. 0 / 52.31. 0
  libavdevice   52. 1. 0 / 52. 1. 0
  libavfilter    0. 4. 0 /  0. 4. 0
  libswscale     0. 7. 1 /  0. 7. 1
  libpostproc   51. 2. 0 / 51. 2. 0
  built on Dec 21 2011 18:41:38, gcc: 4.4.3
videos/1330284731_4f4a88bb907ce9.36842226.flv: Unknown format
Edit:
I've just got this video downloaded by the server:
http://www.youtube.com/watch?v=D-rm8...eature=related
in LOW mode.

But I'm still getting the " Unknown format " in the LOG.

Last edited by orditeck; 02-26-2012 at 08:33 PM..
orditeck is offline   Reply With Quote
Old 02-26-2012, 08:38 PM   PM User | #265
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 umang.goyal View Post
Hi, i have came across something. when i put a URL to convert the video into mp3 and before it downloads i refresh the page or close it, script does not stops downloading the video it keeps on downloading video....has anyone seen this with them as well?
If you are having problems with people abandoning conversions, my suggestion to you is to run a cron job periodically that purges both the '/logs/' and '/videos/' directories. You can check the 'last modified' dates of each of the files in those directories to verify that the files are older than a certain date, and therefore OK to delete.

That will get rid of the files. If you are looking to stop the downloads midstream to save bandwidth, then that's a different problem. Offhand, I don't know how that would be accomplished. You'd have to find a way to stop the cURL process at any time, and not just after a certain period or when the connection times out, i.e.:

PHP Code:
curl_setopt($ciCURLOPT_CONNECTTIMEOUT5);
curl_setopt($ciCURLOPT_TIMEOUT5); 
__________________
Regards, R.J.

Last edited by chump2877; 02-26-2012 at 08:52 PM..
chump2877 is offline   Reply With Quote
Old 02-26-2012, 09:03 PM   PM User | #266
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 orditeck View Post

But I'm still getting the " Unknown format " in the LOG.
Maybe you are missing a video codec. That shouldn't be an issue with XAMPP or Windows OS, but maybe with a Linux system.

BTW, I was able to convert your original video successfully - albeit slowly.
__________________
Regards, R.J.
chump2877 is offline   Reply With Quote
Old 02-26-2012, 09:24 PM   PM User | #267
orditeck
New to the CF scene

 
Join Date: Feb 2012
Posts: 7
Thanks: 1
Thanked 0 Times in 0 Posts
orditeck is an unknown quantity at this point
Quote:
Originally Posted by chump2877 View Post
Maybe you are missing a video codec. That shouldn't be an issue with XAMPP or Windows OS, but maybe with a Linux system.

BTW, I was able to convert your original video successfully - albeit slowly.
But the actual problem is...
why me server isn't loading the .FLV?

It creates a 0kb file instead of downloading it.
orditeck is offline   Reply With Quote
Old 02-26-2012, 09:54 PM   PM User | #268
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 orditeck View Post
But the actual problem is...
why me server isn't loading the .FLV?

It creates a 0kb file instead of downloading it.
Sounds like a cURL problem.
__________________
Regards, R.J.
chump2877 is offline   Reply With Quote
Old 02-26-2012, 10:05 PM   PM User | #269
orditeck
New to the CF scene

 
Join Date: Feb 2012
Posts: 7
Thanks: 1
Thanked 0 Times in 0 Posts
orditeck is an unknown quantity at this point
Quote:
Originally Posted by chump2877 View Post
Sounds like a cURL problem.
Yes, I installed the script on another server and it works well.
I will update cURL and PHP, will probably work after that.

Thanks.
orditeck is offline   Reply With Quote
Old 02-26-2012, 11:47 PM   PM User | #270
drakus
New Coder

 
Join Date: Feb 2012
Posts: 24
Thanks: 0
Thanked 3 Times in 3 Posts
drakus is an unknown quantity at this point
Quote:
Originally Posted by orditeck View Post
Yes, I installed the script on another server and it works well.
I will update cURL and PHP, will probably work after that.

Thanks.
Make sure you have latest php 5.3.10 or whatever is latst version for your distro.

I had same problem, slower than slow, it took about 3 - 5 min for any of my servers to download it and they are all on 1 gig ports.

PS: I custom compile all my stuff, i do not use the distros releases.
drakus 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 04:56 PM.


Advertisement
Log in to turn off these ads.