Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

10.5: How to save YouTube videos from cache Internet
This previous hint explained how to download Flash videos in Safari via the Activity Viewer. This still works in Leopard -- most of the time. However, I had trouble with a large video one day, and found it was stored in the Google video cache. The download would stall and timeout (pausing the Safari download and restarting it caused Safari to restart the download from the beginning -- I suspect it was meant to be streamed only.) The download would work fine in the YouTube Flash player, and it would even cache fully within the web page.

YouTube uses Adobe Flash file format *.flv files. Adobe FLV files used by the YouTube flash player are not stored in the Leopard 10.5 Safari cache. Even if they were, they would be stored inside a SQLite database file, which is not very useful. (If you are looking for other Safari Cache tools, there's a variety of tools to read the SQLite DB and retreive images and html from the database -- Google and ye shall find.) After some digging, I found that my video file was stored here:

/var » folders » V4 » V46lRYwnH3uc8gj98CH+t++++TQ » TemporaryItems » FlashTmp0

The middle part is randomly generated, and will certainly vary for everyone. I believe the first entry in /var/folders/ will always be in capital letters. Read on to see how I saved the movie...

View the YouTube video as normal, pause it, and let it cache fully on the web page. Open Finder and click Go » Go to Folder and enter /var/folders; this will get you to the hidden folders. Drill down the various folders you see there until you find one that has a TemporaryItems folder within it. Open that folder, and then look for files named FlashTmp (they will end in a number). Figure out which file you want -- there will only be one if you only have one YouTube page up.

Now make a copy of the file by Option-dragging it to your Desktop. Rename this copy to end in .flv, and run it through whatever converter you wish to use. Reminder, make sure the movie is fully cached in the YouTube flash player first, or you will end up with an incomplete file.

I use VisualHub as my converter, but unfortunately, the developer has decided to shut down his Techspansion company, and this shareware is currently unavailable except to existing customers. (He is thinking about open sourcing it, but he hasn't made up his mind yet.) VisualHub uses the open source ffmpeg library for all the heavy lifting and actual work -- that makes VisualHub a frontend to ffmpeg. You can download, compile, and use an ffmpeg command line tool, or you can try another shareware front-end for OS X called ffmpegX; there are other commercial tools that can convert flv files as well.

[robg adds: The new location for Leopard users is noted in the comments to this hint, but I felt it worth noting as a standalone hint.]
    •    
  • Currently 3.07 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (14 votes cast)
 
[84,949 views]  

10.5: How to save YouTube videos from cache | 24 comments | Create New Account
Click here to return to the '10.5: How to save YouTube videos from cache' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
10.5: How to save YouTube videos from cache
Authored by: rbrtrx on Oct 07, '08 08:33:35AM

A little shell scripting can make this a bit more convenient:

for f in /var/folders/*/*/TemporaryItems/FlashTmp*; do
  cp "$f" ~/Desktop/"$f".flv
done

That way you don't have to figure out which folder it's in; the globs will do that for you. Yay globs!



[ Reply to This | # ]
10.5: How to save YouTube videos from cache
Authored by: jaysoffian on Oct 07, '08 08:37:36AM
From Terminal.app:

% echo "$TMPDIR"
will give you your current temporary directory. You can open a Finder window to the directory with:

% open "$TMPDIR"


[ Reply to This | # ]
10.5: How to save YouTube videos from cache
Authored by: rbrtrx on Oct 07, '08 09:04:38AM

Thanks, I didn't know that.



[ Reply to This | # ]
10.5: How to save YouTube videos from cache
Authored by: rbrtrx on Oct 07, '08 09:06:26AM

That cp line should have been:

cp "$f" ~/Desktop/$(basename "$f").flv


[ Reply to This | # ]
10.5: How to save YouTube videos from cache
Authored by: dmmorse on Oct 07, '08 08:48:40AM
Thanks! Before trying to download and covert a Flash video, I would always use the following code, saved as a bookmark, to see if YouTube has a quicktime version of the video saved:
javascript:(function%20()%20{var%20video_id%20=%20null;var%20video_hash%20=%20null;var%20video_player%20=%20document.getElementById(%27movie_player%27);if%20(video_player)%20{var%20flash_variables=video_player.attributes.getNamedItem(%27flashvars%27);if%20(flash_variables)%20{var%20flash_values=flash_variables.value;if%20(flash_values)%20{var%20video_id_match=flash_values.match(/video_id=([^(\&|$)]*)/);if%20(video_id_match!=null)%20video_id=video_id_match[1];var%20video_hash_match=flash_values.match(/t=([^(\&|$)]*)/);if%20(video_hash_match!=null)%20video_hash=video_hash_match[1];}}}if%20(video_id==null%20||%20video_hash==null)%20{var%20args=unsafeWindow.swfArgs;if%20(args)%20{video_id=args[%27video_id%27];video_hash=args[%27t%27];}}if%20(video_id==null%20||%20video_hash==null)%20return;var%20yt_mp4_path%20=%27http://www.youtube.com/get_video?fmt=18&video_id=%27+video_id+%27&t=%27+video_hash;var%20div_embed=document.getElementById(%27watch-player-div%27);if%20(div_embed)%20{div_embed.innerHTML=%27%3Cembed%20src=\%27%27+yt_mp4_path+%27\%27%20type=%22video/mp4%22%20width=480%20height=400%20scale=\%27aspect\%27%3E%3C/embed%3E%27;}})(); 
I don't remember where I found this (it might have even been on this site, but I can't find it again), so I can't give proper attribution.

[ Reply to This | # ]
10.5: How to save YouTube videos from cache
Authored by: soundsgoodtome on Oct 07, '08 10:33:44AM

Wow. That rocks, dude. Thanks!



[ Reply to This | # ]
10.5: How to save YouTube videos from cache
Authored by: metiure on Oct 07, '08 09:49:00AM

Is this really that difficult?
Just use Firefox's Download Helper and forget about it.



[ Reply to This | # ]
10.5: How to save YouTube videos from cache
Authored by: soundsgoodtome on Oct 07, '08 10:35:56AM
Or you could download them with one click (in Safari), using CosmoPod:

http://www.cocoamug.com/cosmopod/

[ Reply to This | # ]
10.5: How to save YouTube videos from cache
Authored by: sfemet on Oct 07, '08 12:29:01PM

Or download and use the vixy converter:
http://vixy.net/
(Don't use the online option, it takes forever. Download the software and off you go.

The teachers at my school love it, no internet access required for youtube playback.



[ Reply to This | # ]
10.5: How to save YouTube videos from cache
Authored by: loehman on Oct 07, '08 01:12:52PM

Don't remember where I found this. When the page with the embedded file opens (.flv or .swf or whatever), open Window: Activity. Find the file (if it's an flv file, you will see its size changing). Option+double click on the file and it will download to your default download spot. Change .flv to whatever using iSquint.



[ Reply to This | # ]
10.5: How to save YouTube videos from cache
Authored by: dudemac on Oct 07, '08 05:04:36PM

I haven't used realplayer in years. But the other day I had something in real media format that just would not play in mplayer so I downloaded Realplayer 11.0 for mac. It comes with the real player downloader. Basically it saves you all the work of trying to locate the temp flash files. So if you happen to watch say a movie in safari it will give you the option to save it. Works for every site that has video that I have found. Then you can just run the FLV through a converter if you want to watch it on your pod or phone.

thedude



[ Reply to This | # ]
10.5: How to save YouTube videos from cache
Authored by: GIZMO33 on Oct 07, '08 06:23:34PM

If you add &fmt=18 to the end of the URL and use the activity window it downloads as a an MP4



[ Reply to This | # ]
absolutely
Authored by: fursonice on Oct 07, '08 07:01:03PM

absolutely.

and you might just alias the RealPlayer Downloader app separately.

then open in QT and save. (or not)






[ Reply to This | # ]
10.5: How to save YouTube videos from cache
Authored by: Girrelephants on Oct 07, '08 10:00:45PM
Here is a much better method that is faster and easier for those who don't want to have to use any type of script and would rather just use Safari to copy our videos to the downloads folder.

[ Reply to This | # ]
Click what?
Authored by: clast on Oct 08, '08 02:53:29AM
The way to do it is to let your YouTube Video play as usual, but then once it is finished loading, just hold down the ⌘ Command as you click.
I feel really stupid right now, but what exactly should I click as I hold Command? First I thought he meant the video file in the Activity window, but that certainly wont work.

[ Reply to This | # ]
Click what?
Authored by: Zettt on Oct 11, '08 11:38:42PM
When you have SafariStand installed you can Command+Click on a YouTube Video to save it to the download folder. As stated in the comments on the webpage:
No SafariStand no command+clickage


[ Reply to This | # ]
Why settle for the highly compressed version and transcode it?
Authored by: clast on Oct 08, '08 03:09:37AM

Why settle for the flv version and transcode it? You could download the the less compressed mp4 version and skip the VisualHub transcoding step (which further degrades the quality).

This is what I do:
1. I go the video page in Safari and manually add the the &fmt=18 or just click the "watch in high quality" link below the video. I bet you could fix a bookmarklet to add the &fmt=18 if you think it's troublesome.
2. I do the old Activity window trick mentioned. I look for the a file with MB size instead of KB or bytes and I just double click it. The video will be downloaded as video.mp4.
3. I watch my hdd free space shrink as I download every cute cat video I can find on the tube.



[ Reply to This | # ]
10.5: How to save YouTube videos from cache
Authored by: humanbulk on Oct 09, '08 03:11:50PM
10.5: How to save YouTube videos from cache
Authored by: TaylorMedia on Oct 10, '08 10:04:43AM
TubeTV - It is free and is fairly easy to use. I have found that is also works with some other sites with flash video as well.

[link:]http://www.chimoosoft.com/products/tubetv/

---
--------------
http://KeynoteHQ.com

[ Reply to This | # ]

10.5: How to save YouTube videos from cache
Authored by: treeswing on Jan 11, '10 09:49:45PM

Worked for me in 10.4.11



[ Reply to This | # ]
10.5: How to save YouTube videos from cache
Authored by: Catherine on Feb 01, '10 07:55:11PM
i just use this free youtube downloader

[ Reply to This | # ]
10.5: How to save YouTube videos from cache
Authored by: ivancastillom on Apr 05, '11 01:29:10PM

Very Useful, Thank You!



[ Reply to This | # ]
10.5: How to save YouTube videos from cache
Authored by: BillH on Aug 09, '11 01:21:41PM

Until my most recent update, I was able to save Youtube videos by going to Window Activity, clicking on the the video from the menue and Safari would save it in my assigned download folder. However, since my Mac upgrade, this method will not longer save the video. Does anyone have any suggestions?



[ Reply to This | # ]
10.5: How to save YouTube videos from cache
Authored by: Anna Brooks on Dec 05, '11 05:02:35AM

If there are any issues while downloading the videos via Safari, it's better to use YouTube downloaders like Elmedia Player PRO or online services like saveyoutube.com and so on.



[ Reply to This | # ]