On 25/04/2012 20:48, Hasanen AL-Bana wrote:
wouldn't be better if we save the video chunks ? youtube is streaming
files with 1.7MB flv chunks, youtube flash player knows how to merge
them and play them....so the range start and end will alaways be the
same for the same video as long as user doesn't fast forward it or do
something nasty...even in that case , squid will just cache that
chunk...that is possible by rewriting the STORE_URL and including the
range start& end
as i already answered a detailed answer to Ghassan.
i think that caching the chunks if possible is pretty good thing.
i tried it with nginx but havnt got the option to try it with
store_url_rewrite.
hope to try it somewhere next week.
Regards,
Eliezer
On Wed, Apr 25, 2012 at 8:39 PM, Ghassan Gharabli
<sounarose@xxxxxxxxxxxxxx> wrote:
Hello,
As i remember I already discussed this subject before mentioning that
Youtube several months ago added a new variable/URI "RANGE". I tried
to deny all URLs that comes with "RANGE" to avoid presenting the error
at Youtube Player butb tried to investigate more and came with a
solution like that :
--------------------------------------------------------------------------------
# youtube 360p itag=34 ,480p itag=35 [ITAG/ID/RANGE]
if (m/^http:\/\/([0-9.]{4}|.*\.youtube\.com|.*\.googlevideo\.com|.*\.video\.google\.com)\/.*(itag=[0-9]*).*(id=[a-zA-Z0-9]*).*(range\=[0-9\-]*)/)
{
print $x . "http://video-srv.youtube.com.SQUIDINTERNAL/" . $3 . "&" .
$4 . "\n";
# youtube 360p itag=34 ,480p itag=35 [ID/ITAG/RANGE]
} elsif (m/^http:\/\/([0-9.]{4}|.*\.youtube\.com|.*\.googlevideo\.com|.*\.video\.google\.com)\/.*(id=[a-zA-Z0-9]*).*(itag=[0-9]*).*(range\=[0-9\-]*)/)
{
print $x . "http://video-srv.youtube.com.SQUIDINTERNAL/" . $2 . "&" .
$4 . "\n";
# youtube 360p itag=34 ,480p itag=35 [RANGE/ITAG/ID]
} elsif (m/^http:\/\/([0-9.]{4}|.*\.youtube\.com|.*\.googlevideo\.com|.*\.video\.google\.com)\/.*(range\=[0-9\-]*).*(itag=[0-9]*).*(id=[a-zA-Z0-9]*)/)
{
print $x . "http://video-srv.youtube.com.SQUIDINTERNAL/" . $4 . "&" .
$2 . "\n";
--------------------------------------------------------------------------------------
I already discovered that by rewriting them and save them as
videplayback?id=0000000&range=00-000000 would solve the problem but
the thing is the cache folder would be increased faster because we are
not only saving one file as we are saving multiple files for one ID!.
AS for me , it saves alot of bandwidth but bigger cache . If you check
and analyze it more then you will notice same ID or same videop while
watching the link changes for example :
It starts [ITAG/ID/RANGE] then changes to [ID/ITAG/RANGE] and finally
to [RANGE/ITAG/ID] so with my script you can capture the whole
places!.
Ghassan
On 4/25/12, Eliezer Croitoru<eliezer@xxxxxxxxxxxx> wrote:
<SNIP>
--
Eliezer Croitoru
https://www1.ngtech.co.il
IT consulting for Nonprofit organizations
eliezer <at> ngtech.co.il