VideoCache
Videocache is no longer in development.

vccleaner ... something strange

by sirkike on 12 Feb 2009

i set the video_lifetime 60 and enable_videocache_cleaner 1 ... the videocache are installed over 60 or 50 days... when i run vccleaner i get some lines like this in vccleaner.log

2009-02-12 19:00:00,114 INFO DELETE /cache/video_cache/wrzuta/enLLB2Zojf.flv Older than 115 day(s) was deleted.
2009-02-12 19:00:00,123 INFO DELETE /cache/video_cache/wrzuta/vWArJs7DWG.flv Older than 445 day(s) was deleted.
2009-02-12 19:00:00,130 INFO DELETE /cache/video_cache/wrzuta/k9IhDQBYNn.flv Older than 99 day(s) was deleted.
2009-02-12 19:00:00,138 INFO DELETE /cache/video_cache/wrzuta/8t92CpkDmc.flv Older than 342 day(s) was deleted.
2009-02-12 19:00:00,148 INFO DELETE /cache/video_cache/wrzuta/kOvBybDqZI.flv Older than 384 day(s) was deleted.
2009-02-12 19:00:00,163 INFO DELETE /cache/video_cache/wrzuta/eS30RgwVTr.flv Older than 590 day(s) was deleted.
2009-02-12 19:00:00,192 INFO DELETE /cache/video_cache/wrzuta/cSLQ477j3c.flv Older than 410 day(s) was deleted.
2009-02-12 19:00:00,195 INFO DELETE /cache/video_cache/wrzuta/mtPnd9AX8y.flv Older than 208 day(s) was deleted.
2009-02-12 19:00:00,201 INFO DELETE /cache/video_cache/wrzuta/cTKBDiX8rl.flv Older than 210 day(s) was deleted.
2009-02-12 19:00:00,207 INFO DELETE /cache/video_cache/wrzuta/kjKFbpsEV8.flv Older than 319 day(s) was deleted.
2009-02-12 19:00:00,213 INFO DELETE /cache/video_cache/wrzuta/oEywL9TYL0.flv Older than 394 day(s) was deleted.

that is imposible.. 394 days? 210 days? more than installation date of cachevideos? i don't understand. sorry. :S

8 Answers

by k1mbl3 on 12 Feb 2009

it happened to me when i was testing my script... i think its returning when the videos was uploaded.

by sirkike on 13 Feb 2009

yes, but almost videos have the date there was uploaded and not when was downloaded to cache.

by Kulbir Saini on 13 Feb 2009

Sirkike, Kimble,

We are here depending on last modified time of the videos. The reason this script is not yet automatically used is the strange behavior of last modified time-stamp. But it wont happen with the video that are cached now onwards because videocache will take care of the time-stamps and will change them every-time a video was accessed.

Thank you for reporting that error.

by k1mbl3 on 13 Feb 2009

the newly downloaded files doesn't have to be 'touched' with os.utime() too?

i've just tested here and the video have the same mtime that the upload time in youtube.

Bye.

by Kulbir Saini on 13 Feb 2009

Kimble,

I already added that line in development tree. Here is a patch,

diff --git a/videocache/videocache.py b/videocache/videocache.py
index ad87424..752aa95 100755
--- a/videocache/videocache.py
+++ b/videocache/videocache.py
@@ -399,6 +399,7 @@ def download_from_source(args):
         size = os.stat(file)[6]
         os.rename(file, path)
         os.chmod(path, mode)
+        os.utime(path, None)
         remove(video_id)
         log(format%(pid, client, video_id, 'DOWNLOAD', type, str(size) + ' Video was downloaded and cached.'))
     except:

Apply that and you are safe. It'll take some time before cleanup script really gets stable. Thanks for your inputs :)

by n3os on 22 Mar 2009

how to apply that patch
iam using ver 1.9.1

by Kulbir Saini on 22 Mar 2009

Anon,

If you are using 1.9.1 there is no need to apply that patch.

Thank You!

by n3os on 23 Mar 2009

thank you kulbir...iam from indonesia