![]() And it seems to be working relatively well. # doesn't send a "Cache-control: no-cache" header with a 302 redirect.ĭone. # All of the above can cause a redirect loop when the server Refresh_pattern -i (get_video\?|videodownload\?|videoplayback\?) 161280 50000% 525948 override-expire ignore-reload # Updates (unrelated to this post, but useful settings to have): Storeurl_access allow store_rewrite_list_web store_rewrite_list_path Storeurl_access allow store_rewrite_list_web_CDN # this is not related to youtube video its only for CDN pictures # The "\.(jp(e?g|e|2)|gif|png|tiff?|bmp|ico|flv)\?" is only for pictures and other videosĪcl store_rewrite_list urlpath_regex \/(get_video\?|videodownload\?|videoplayback\?id) \.(jp(e?g|e|2)|gif|png|tiff?|bmp|ico|flv)\? \/ads\?Īcl store_rewrite_list_web url_regex ^http:\/\/( )*\.*\.*Īcl store_rewrite_list_path urlpath_regex \.(jp(e?g|e|2)|gif|png|tiff?|bmp|ico|flv)$Īcl store_rewrite_list_web_CDN url_regex ^http:\/\/ \.google\.com doubleclick\.net # The keyword for all youtube video files are "get_video?", "videodownload?" and "videoplaybeck?id" Storeurl_rewrite_program /usr/local/bin/storeurl-youtube.py ![]() (Bad documentation sucks)Īll that's left is to tell Squid to use this, and to override the caching rules on these URLs. The perl script concatenated this directly before the re-written URL, but I separate them with a space. The documentation is this is almost non-existant, but if you specify a non-zero storeurl_rewrite_concurrency each request and response will be prepended with a numeric ID. The concurrency ID is a way to use a single script to process rewrites from different squid threads in parallel. ![]() We output the concurrency ID and the URL to rewrite to. Each line the rewrite program reads contains a concurrency ID, the URL to be rewritten, and some parameters. ![]() They don't include the itag, and my perl isn't good enough to fix that without making a dog's breakfast of it, so I re-wrote it in Python. The squid wiki page I mentioned includes a sample perl script to perform this rewrite. We've normalised the URL and kept the only two parameters that matter, the video id and the itag which specifies the video quality level. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |