Join Date: Dec 2004
Location: the U.S. of freakin' A.
Thanked 155 Times in 146 Posts
I tried to convert both a YouTube and Dailymotion video on your site, and I had no problems.
Also, just to be sure, I tested my software on my own installation of Ubuntu Linux, and, again, I had no problems converting both YouTube and Dailymotion videos.
What is the URL of the video that you are having problems converting?
Edit: Is this the video url: http://www.youtube.com/watch?v=PAytXoFZN58 ? When I try to access that video in YouTube, it says the video is blocked in my country. That would explain your error. There are some videos on YouTube that are blocked in certain countries, and some videos that are blocked in all countries except for one. There is very little a person can do to circumvent this.
To my knowledge, the best way around this issue is to use a proxy network like Tor -- and implement its command interface (in the PHP converter class file) to create a new, anonymous identity (IP address), which you can then use to access the blocked video (via cURL). I have done something like this before. The problems with this kind of solution are as follows:
1. Proxy networks are notoriously slow. So the downloads of your blocked videos will often be significantly slower, because you are stuck with the download speed of whatever proxy server you are using -- as well as any other relevant proxy server hardware/software specs. Speeds are also slower because proxy servers often cause the data to travel a longer and more complex path to its destination (than would otherwise be the case without a proxy server).
2. Tor, in particular, is an "anonymizing" service. It assigns you a random, anonymous id (ip address) from one of the nodes in its network. So the IP address you are given is not in any way guaranteed to come from a country that is not blocked by a given YouTube video. Subsequently, you have to keep generating new id's until you can find one that is from a country that is not blocked by the video. This process can further slow down the conversion of the video. (Note: Tor used to give you a way to exclude countries when generating new id's, but that feature is now deprecated, and no longer appears to function as expected.)
3. In any proxy network, you are confined to only the locations of the nodes in the network. So if a video is blocked in Canada, the U.S., and Mexico, for example, and all of the nodes in your proxy network are located in those 3 countries, then none of your proxy servers will be able to access and download the video either.
So, while a proxy network is the best solution to this problem (in my experience), it is not without its problems. But it can work most of the time for blocked videos if you don't mind the sometimes ridiculous amount of time it takes to download a video via proxy. And, chances are, a good percentage of your site users won't have patience for this.
As an aside, I have also explored VPN solutions like hidemyass.com's VPN service. The problem there is that the service only allows you to create a finite number of simultaneous VPN connections. So, let's say you have 100 people that are simultaneously converting blocked videos on your site. If you can only initiate 10 (for example) simultaneous VPN connections at any one time (via a service like hidemyass), then the other 90 people must wait to convert their videos. This issue could be addressed with a queuing system, but again you potentially have a lot of people waiting in line to convert videos (when you scale up the popularity of and traffic to your site). With proxy networks, you don't have this problem -- because there is really no significant limit to the number of simultaneous proxy connections you can make.
So, as you can see, it's a slippery slope to address the issue of blocked videos. While there are ways to address the issue, none of them are even close to providing an ideal or perfect solution. That said, if you need help addressing this issue, I can implement a proxy solution for you (as I have done it before). I would have to charge you my hourly rate to do this. Let me know if this interests you.
Edit: Forgot to mention that another way to deal with this issue is to carefully choose the location of your server. If you are able to use a server that is located in a country where relatively few videos are blocked, then that could potentially go a long way to addressing the problem. But, personally, I have no data or reference for you regarding which are the best countries to choose for this purpose. You would have to conduct your own research on this topic (if possible), and make your decision based on that research.
Last edited by chump2877; 11-24-2012 at 01:28 AM..