SEARCH

Enter your search query in the box above ^, or use the forum search tool.

You are not logged in.

#1 2011-06-29 15:29:17

chaanakya
#! Die Hard
Registered: 2010-12-30
Posts: 940

[How-to]Easily save videos which have been cached

Let's say you're watching a video in Youtube and you want to save it.  You know it's been cached, but you don't know where.  How do you easily locate it?  You could go to

about:cache?device=disk

and muck around in there until you find the right one.  However, there's an easier way, involving find, file, sed, and tr.  Here's the script:

#!/bin/bash
## Set the below to your cache dir
CACHE_DIR="~/.conkeror.mozdev.org/conkeror/m8q08yyy.default/Cache/"
cd $CACHE_DIR
cp `find . | file -f - | grep "data" | grep -v "CACHE" | grep -v "gzip" | sed -e 's/\:.*data//' | sed -e 's/.*,.*//' | tr -d '\n'` ~/karaoke/Youtube/"$1".webm
cd - > /dev/null

Also, I believe this assumes you are using the html5 version of Youtube and also assumes you have cleared the cache (otherwise, multiple entries will show up).  This is a very rough script which I just hacked together to automate saving Youtube karaokes (I use conkeror, which uses the same ridiculous caching mechanism as Firefox 4+ - multiple directory levels with just a single file or two in each final folder...).

Hope this is useful for someone else! smile


Check out Musik - an easy-to-use text-to-music converter!
Join SpiderOak using this link and get an extra 1 GB free: https://spideroak.com/download/referral … 660e787ff1

Offline

Be excellent to each other!

#2 2011-10-05 05:07:09

biosjub
New Member
Registered: 2011-06-05
Posts: 8

Re: [How-to]Easily save videos which have been cached

Ok super noob time!

Im using thunar. Could i not just navigate to the cache folder and move the file to a more permanent place?

Offline

#3 2011-10-05 15:58:31

chaanakya
#! Die Hard
Registered: 2010-12-30
Posts: 940

Re: [How-to]Easily save videos which have been cached

Yup!  I just found it easier to give command-line instructions big_smile  Also, this automates the process of actually finding the file you need - it automatically filters the inapplicable cache entries out and copies just the webm file.  I tried doing it manually and it was a pain - mainly because of the ridiculous caching system.

Last edited by chaanakya (2011-10-05 16:01:06)


Check out Musik - an easy-to-use text-to-music converter!
Join SpiderOak using this link and get an extra 1 GB free: https://spideroak.com/download/referral … 660e787ff1

Offline

Board footer

Powered by FluxBB

Copyright © 2012 CrunchBang Linux.
Proudly powered by Debian. Hosted by Linode.
Debian is a registered trademark of Software in the Public Interest, Inc.
Server: acrobat

Debian Logo