VideoCache
Videocache is no longer in development.

Youtube's ids

by bellera on 3 Feb 2009

Hello!

Some youtube videos are cached many times, first by their real ID and second by temporary ID.

At cache:

piw-ypjgoB4.flv 16-Oct-2008 01:23 3.1M
a62c3eca98e0a01e.flv 16-Oct-2008 01:23 3.1M

At videocache.log:

piw-ypjgoB4 URL_HIT YOUTUBE http://es.youtube.com/get_video?video_id=piw-ypjgoB4&t=OEgsToPDskIXiozoKYq2Loi2Xnj2Ofvk&el=detailpage&ps=&fmt=34 piw-ypjgoB4 CACHE_MISS YOUTUBE Requested video was not found in cache.
piw-ypjgoB4 NEW_URL YOUTUBE http://es.youtube.com/get_video?video_id=piw-ypjgoB4&t=OEgsToPDskIXiozoKYq2Loi2Xnj2Ofvk&el=detailpage&ps=&fmt=34
REQUEST - http://s.ytimg.com/yt/favicon-vfl1123.ico
REQUEST - http://v3.cache.googlevideo.com/videoplayback?id=a62c3eca98e0a01e&itag=34&ip=213.176.161.204®ion=3&signature=556C9014C1D011AF04674BC7579AE39F94387F41.0390D4F080C35C54914B3F6F78CEAF3E4E406CEC&sver=2&expire=1233348407&key=yt1&ipbits=0
a62c3eca98e0a01e URL_HIT YOUTUBE http://v3.cache.googlevideo.com/videoplayback? id=a62c3eca98e0a01e&itag=34&ip=213.176.161.204®ion=3&signature=556C9014C1D011AF04674BC7579AE39F94387F41.0390D4F080C35C5491 4B3F6F78CEAF3E4E406CEC&sver=2&expire=1233348407&key=yt1&ipbits=0
a62c3eca98e0a01e CACHE_MISS YOUTUBE Requested video was not found in cache.
a62c3eca98e0a01e NEW_URL YOUTUBE http://v3.cache.googlevideo.com/videoplayback? id=a62c3eca98e0a01e&itag=34&ip=213.176.161.204®ion=3&signature=556C9014C1D011AF04674BC7579AE39F94387F41.0390D4F080C35C5491 4B3F6F78CEAF3E4E406CEC&sver=2&expire=1233348407&key=yt1&ipbits=0

I played the two files and they are the same video.

If a62c3eca98e0a01e.flv is a temporary ID I'm wondering if it makes sense to cache it. I observed that same of these temporary IDs have been served many times:

b5325c5303b2eaa3 CACHE_HIT YOUTUBE Video was served from cache. b5325c5303b2eaa3 CACHE_HIT YOUTUBE Video was served from cache. 

Regards,
Josep Pujadas

7 Answers

by Kulbir Saini on 3 Feb 2009

Hello Josep,

This happens because of youtube and google video merger. All videos are being moved to google video servers. And thats why all this mess. Even in the log you pasted, you see the same video being routed from youtube servers to googlevideo servers.

Thank You!

by bellera on 10 Feb 2009

Kulbir,

I studied a litle bit more the problem. I think youtube is using googlevideo to cache videos.

If you see the googlevideo URLs (related to youtube) you will find an expire tag. I look some different URLs and the epoch time for the expire tag is allways 6 hours after retreiving the video.

So, I think it is interesting that videocache continues to caching the temporary videos. They should be available for 6 hours ... but not more ...

I think will add to my midnight script maintenance for squid+squidguard+videocache a line to erase these temporary videos. Just (for videocache 1.8):

rm /var/spool/videocache/youtube/????????????????

Regards,

Josep Pujadas

by Kulbir Saini on 10 Feb 2009

Josep,

If you are running out of space, then you can add that line otherwise just let the videos be there :) In the meantime, if you can do research on the relation between temporary and permanent video ids and converting from temporary to permanent, it would be a great contribution :)

Thank You!

by bellera on 28 Feb 2009

Kulbir,

I wrote a page about ... after a lot of testing ...

http://www.bellera.cat/josep/videocache/squid_videocache_youtube.html

Regards,

Josep Pujadas

by Kulbir Saini on 6 Mar 2009

Josep,

Thanks a lot for the efforts.

by Anonymous on 29 Sep 2009

Hi, Admin

I'm writing a XML/Flash interface to show the downloaded videos to my clients. I make one statistic that the video in cache are reviewaed by another client rarelly, so with one portal to show the videos, all clients spend you time watching the cache content.
So now i'm working hardly to pass one big problem and need your skill. Some time ago I got the videoID(11 caracters) and pickup my desired informations about tag, description just by video name, and, now we dont have an inverse reference with the googlevideo(16 caracters) mode. So, is there a way to get these informations about the video for input in my XML at dowload time or other way ?
Can I publicate the flash application here?
Thanks a lot, and God still blessing you.

by Kulbir Saini on 29 Sep 2009

Hi Anon,

I think it will be better if we discuss this out over email. Please use the contact form.

Thank You!