Revision: 14943
Author:
degr...@gmail.com
Date: Tue Apr 30 05:49:56 2013
Log: Created wiki page through web user interface.
http://code.google.com/p/lusca-cache/source/detail?r=14943
Added:
/wiki/YouTubeAprilFix.wiki
=======================================
--- /dev/null
+++ /wiki/YouTubeAprilFix.wiki Tue Apr 30 05:49:56 2013
@@ -0,0 +1,33 @@
+#labels Feature,Featured,Configuration-Example
+YouTube Fix for dynamic ID
+
+= Introduction =
+
+Recently there has been lots of modifications done at youtube servers that
reflected the way video caching for this dynamic ID changes.
+
+
+
+= Details =
+
+Changes were made by youtube guys affected badly on the way cache engines
worked. And thus there has been many attempts some of them were reading log
files generated with referer header logged, which is a good trick by the
way:
+1- but what if we are using buffered logs?.
+2- what if we are running a busy server with heavy traffic being logged?
+3- what if we are using the accelerators like in upxl that i wrote years
ago.?
+4- what if .......??? the list continues.
+the method i took was to separate the request on a different branch giving
the possibility to tamper the request outside of squid environment.
+i wrote a simple NodeJS server doing nothing but proxying the generate_204
request to youtube and saving the id and referer header of this request in
a flat file (used flat files one file per id/referer for simplicity, would
make it a database later on if things getting more complicated)
+
+and thus to summarize:
+Purpose of this project is to catchup with the changes done by youtube guys
+to reflect the new changes and get videos cacheable once again.
+it grabs the request sent from squid mainly the one contains
<b>http://(.*)\.
youtube.com/generate_204\?(.*)?&id=([0-9a-zA-Z\-\_]+)(.*)?</b>
+then take the referer header should look something like
+ <b>referer : '
http://www.youtube.com/watch?v=([0-9a-zA-Z\-\_]+)'</b>
+I take the reqular expression in the referer and touch a file in
/data/YouTube/hacked/ID and put inside it the referer
+in the Store_URL_Rewrite i look for the ID file and read the referer and
reply with referer&itag&range
+thus no matter what id's youtube use that shall always refer to the same
video being watched
+
+and in the store url rewrite i just read the id of the
<i>videoplayback</i> and read teh contents referer stored in the file and
hola i have fixed related to the url of the page saved.
+
+
+happy caching.