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

Save iTMS Music videos in iTunes 4.7.1 Apps
I have found the key to save the music videos from iTunes Music Store, now that the old method of grabbing the QTPluginxxxxx file in the tmp/501/ folder doesn't work any more. The only thing you have to do is control-click in the miniature of the video you want to save and select 'Copy iTunes Music Store URL' from the pop-up menu. Then run this AppleScript.

It will take the copied URL and make a new window in Safari to search for the final location of the .mov file, and then load it in Safari (or the default web browser), from which you can save it where you want.

[robg adds: This script worked as described. I copied and pasted it into Script Editor, and saved the resulting script as an application.]
    •    
  • Currently 1.00 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (1 vote cast)
 
[36,618 views]  

Save iTMS Music videos in iTunes 4.7.1 | 83 comments | Create New Account
Click here to return to the 'Save iTMS Music videos in iTunes 4.7.1' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Save iTMS Music videos in iTunes 4.7.1
Authored by: dan55304 on Apr 29, '05 08:47:32AM

Bad URL to the script. Can you paste it into the hint please?



[ Reply to This | # ]
Save iTMS Music videos in iTunes 4.7.1
Authored by: Ezra Balaraj on Apr 29, '05 11:25:36AM

Hello,

I got a 404 Error - Page Not Found. Sorry.

---
EB



[ Reply to This | # ]
Save iTMS Music videos in iTunes 4.7.1
Authored by: leebennett on Apr 29, '05 09:06:15AM

Um, maybe I'm mistaken and had saved several videos prior to updating to 4.7.1, but I don't think so...and the manual method of getting the files from the 501 directory still worked fine.



[ Reply to This | # ]
Save iTMS Music videos in iTunes 4.7.1
Authored by: griffineyes on Apr 29, '05 09:59:40AM

what is the old method, I don't know this.



[ Reply to This | # ]
Old way still works for me
Authored by: seika7 on Apr 29, '05 11:38:08AM

The old way still works for me in iTunes 4.7.1 on Mac OS X 10.3.9: Let the movie finish downloading in iTMS then go to /tmp/501/TemporaryItems/ and move the temp file to another location such as the desktop and add .mov to the end of the name, i.e., QTPluginTemp2784123.mov

Of course, if you're not the primary user, you'll go to 502 or 503 or something.



[ Reply to This | # ]
Save iTMS Music videos in iTunes 4.7.1
Authored by: caesurae on Apr 29, '05 09:31:17AM

What script? I don't see no script.



[ Reply to This | # ]
Save iTMS Music videos in iTunes 4.7.1
Authored by: ryanmathus on Apr 29, '05 10:27:33AM
Or you could just use IGotMovies to grab the movies. It's a lot easier.

---
-Ryan

[ Reply to This | # ]

Save iTMS Music videos in iTunes 4.7.1
Authored by: snowman on Apr 29, '05 10:48:22AM

Movies are now chached here:
~/Library/Caches/QuickTime/downloads/
You can check this out by using the ProcessViewer: Select iTunes while playing the video and use the inspector to review the opened files....



[ Reply to This | # ]
Save iTMS Music videos in iTunes 4.7.1
Authored by: Anonymous on Jul 12, '05 07:56:55PM

If the QTPluginTemp(some number) file still exists, does IGetMovies work?

My system: Mac OS X 10.3.9, iTunes 4.9, Quicktime 6.5.2



[ Reply to This | # ]
Save iTMS Music videos in iTunes 4.7.1
Authored by: Umpa-Spain on Apr 29, '05 11:42:25AM

iGetMovies don't work with iTunes 4.7.1. The movies aren't stored in "/501/TemporaryItems/" now

---
The Keymaker...



[ Reply to This | # ]
Save iTMS Music videos in iTunes 4.7.1
Authored by: Umpa-Spain on Apr 29, '05 11:50:31AM

OOOOk I have found just now that my iTunes saves the temp movie in "/private/var/tmp/folders.501/TemporaryItems/" , please forgot this script :P

---
The Keymaker...



[ Reply to This | # ]
Save iTMS Music videos in iTunes 4.7.1
Authored by: BSS on Apr 29, '05 12:01:11PM

The below script doesn't work anymore after Tiger upgrade. Anyone knows how to fix the script?



set originalFile to do shell script "lsof -wa -Fn -c iTunes +D /tmp | grep -i QTP | head -1 | cut -c 2-"
if length of originalFile is greater than 0 then
set newFile to POSIX path of (choose file name default name "iTunes Video.mov")
if length of newFile is greater than 0 then
if newFile does not end with ".mov" then set newFile to newFile & ".mov"
do shell script "/bin/cp -v '" & originalFile & "' '" & newFile & "'"
do shell script "/Developer/Tools/ttt -t 'MooV' -c 'TVOD' '" & newFile & "' || true"
end if
else
display dialog "No movie found. Please make sure that the movie is currently visible in iTunes." buttons {"OK"} default button "OK"
end if



[ Reply to This | # ]
Save iTMS Music videos in iTunes 4.7.1
Authored by: useEvil on Apr 29, '05 02:59:46PM

This should fix it:

lsof | grep -i qtch | head -1 | awk '{ print $9 }'

---
--
Fingerprint: 6196 6907 1E47 880A 76AA B6FD E9B6 A5D9 5D83 87BA
Public Key ID: 5D8387BA



[ Reply to This | # ]
Save iTMS Music videos in iTunes 4.7.1
Authored by: useEvil on Apr 29, '05 03:43:07PM
Here is the full script if you don't have it:
set originalFile to do shell script "lsof | grep -i qtch | head -1 | awk '{ print $9 }'"
if length of originalFile is greater than 0 then
	set newFile to POSIX path of (choose file name with prompt "Save movie as:" default name "iTunes Video.mov")
	if length of newFile is greater than 0 then
		if newFile does not end with ".mov" then set newFile to newFile & ".mov"
		do shell script "cp -v '" & originalFile & "' '" & newFile & "'"
		do shell script "/Developer/Tools/SetFile -t 'MooV' -c 'TVOD' '" & newFile & "'"
	end if
else
	display dialog "No movie found." buttons {"OK"} default button "OK"
end if

---
--
Fingerprint: 6196 6907 1E47 880A 76AA B6FD E9B6 A5D9 5D83 87BA
Public Key ID: 5D8387BA

[ Reply to This | # ]

Save iTMS Music videos in iTunes 4.7.1
Authored by: jhonny on Apr 30, '05 04:25:04AM
In theory atleast
lsof -wa -c iTunes +D ~/Library/Caches/QuickTime/downloads/ | grep -i qtch | head -1 | awk '{ print $9 }'
should be faster. :)

[ Reply to This | # ]
Save iTMS Music videos in iTunes 4.7.1
Authored by: Umpa-Spain on Apr 29, '05 01:13:35PM

The link of the script now works. One thing you can do with it, is to download various movies at the same time, you don't have to wait to load one before open another movie.

---
The Keymaker...



[ Reply to This | # ]
Save iTMS Music videos in iTunes 4.7.1
Authored by: BSS on Apr 29, '05 01:18:29PM

The link worked. But not the script.



[ Reply to This | # ]
Save iTMS Music videos in iTunes 4.7.1
Authored by: Umpa-Spain on Apr 29, '05 01:44:16PM
Try this:
on run
	--We get the iTunes's url
	tell application "Finder"
		try
			set ITMS_URL to the clipboard as text
		on error
			display dialog "No iTunes URL found in the clipboard. " & "Please, go iTunes, and right click on the video you want to save and copy the url to the clipboard" buttons {"Cancel"}
		end try
	end tell
	
	--We extract de Video_ID of the selected video
	set AppleScript's text item delimiters to {"videoId="}
	set VIDEOID to item 2 of (every text item of ITMS_URL)
	
	--We tell to Safari open a new Url based in the previous ID, from we get the exact location of the movie
	set UrlBase to "http://ax.phobos.apple.com.edgesuite.net/WebObjects/MZStore.woa/wa/viewVideo?b=a&videoId=" & VIDEOID & "&videoIndex=2" as text
	tell application "Safari"
		make new document with properties {URL:UrlBase, visible:false}
	end tell
	
	--We wait 3 seconds while Safari laods the page, if not the script return an error
	set x to 0
	set curd to current date
	repeat until x = 15
		if curd + 3 < (current date) then set x to 15
	end repeat
	
	--We search in the source code of the page teh reference to the ".mov" file and set it's exactly location
	tell application "Safari"
		set codigo to source of front document as text
		set AppleScript's text item delimiters to {"MovieView autoplay="}
		set codigo to item 2 of (every text item of codigo)
		set AppleScript's text item delimiters to {"http://"}
		set codigo to item 2 of (every text item of codigo)
		set AppleScript's text item delimiters to {".mov"}
		set codigo to item 1 of (every text item of codigo)
		set codigo to "http://" & codigo & ".mov"
		
		--Close tab or window created before
		close front document
		
		--Opens the movie in Safari (or default web browser), whre we wait to the load is complete, and then we save it where we want ;)
		open location codigo
	end tell
end run

---
The Keymaker...

[ Reply to This | # ]

Save iTMS Music videos in iTunes 4.7.1
Authored by: awalls on Apr 29, '05 06:00:45PM

Excellent the bottom line is it works well.... although to date I had no problem with any version of iTunes 4.x or OS X.3 to download videos using an applescript downloaded from the internet. This worked once the video was played in iTunes andsaved the video to the desktop.

I made a script application from your script but found that with the video open in its iTMS window I could not get 'control click' to give any option. I eventually had to navigate back to the iTMS video browser page and do the 'control click' on the name of the video in the page then all worked OK, it launched the video in a non kiosk version of QT in a new safari window then it was as simple as save 'quicktime movie as'

thanks



[ Reply to This | # ]
Save iTMS Music videos in iTunes 4.7.1
Authored by: awalls on Apr 29, '05 06:02:16PM

ps forgot to say problems only started when upgrading to QT 7 pro



[ Reply to This | # ]
Save iTMS Music videos in iTunes 4.7.1
Authored by: jhonny on Apr 30, '05 04:21:22AM
The temporary video files are now stored under
~/Library/Caches/QuickTime/downloads/xx/xx/
But it seems that the file is not a QuickTime movie anymore (atleast after installing Tiger and QuickTime 7). Changing the shell script on the old AppleScript to:
lsof -wa -c iTunes +D ~/Library/ | grep -i qtch | head -1 | awk '{ print $9 }'
does copy the file correctly, but it is not playable in QuickTime.

So is there a some kind of DRM now on the music videos?

-j

[ Reply to This | # ]
Save iTMS Music videos in iTunes 4.7.1
Authored by: LC on Apr 30, '05 12:28:46PM

I never had a problem getting the .mov files, under 10.3.x and QT 6.x. So yesterday I installed QT 7 (still under OS 10.3.9), and now instead of that .mov file I only have the cache files (which I found via lsof; once you know where the cache tree is, you can do a "find . -size +..." or a suitable "ls"). I'm hoping when I buy the QT7 Pro option, it may be possible to get the file exported to a .mov; Larry.



[ Reply to This | # ]
Save iTMS Music videos in iTunes 4.7.1
Authored by: Stoopa on Apr 30, '05 02:33:21PM

I've gto QT Pro 7, and have no such luck. Gr.



[ Reply to This | # ]
Save iTMS Music videos in iTunes 4.7.1
Authored by: JimMueller on May 02, '05 08:48:36PM

Grr indeed.

The full-screen trailer for the movie Serenity plays through the ITMS and the 40MB cache file (for me: 5fcd7f4c-23fb193b-65365a05-e5b593c3.qtch) is so far unplayable by anything I've tried.



[ Reply to This | # ]
Save iTMS Music videos in iTunes 4.7.1
Authored by: genericuser on May 06, '05 12:20:34PM

I did a bit of digging and found out the cached "qtch" files only differ from thier "mov" files by 538 Bytes (Give or take a Byte). I am attempting to grep the files to see if there is a common block that is placed in the qtch files. It's long going, because the files are large.

I hope this may help others figure out the new qtch file format.

---
Bugmenot public account



[ Reply to This | # ]
For those without Quicktime Pro...
Authored by: arnoldtim on Apr 30, '05 10:50:15AM

Use the applescript as directed and then once on the webpage with the movie, 1) stop loading it 2) copy the web address 3) paste the web address into the Google search box and search 4) once the Google search results load "alt-click" on the link to the movie to save it to your downloads folder.

This was you can Q up loads of the Music Videos and easily see their download status. Brilliant!



[ Reply to This | # ]
Save iTMS Music videos in iTunes 4.7.1
Authored by: Umpa-Spain on May 02, '05 05:03:52AM

With my script, you don't need to search the video url in google. In Safari, just select the url in the tab or window that's loading the video, and push ALT+ENTER, then the movie begins to download and you can close the tab or window.

---
The Keymaker...



[ Reply to This | # ]
Save iTMS Music videos in iTunes 4.7.1
Authored by: BSS on May 02, '05 06:11:05AM

How does the script work?

What are the steps? I can't seems to get it to work.

Thanks in advance.

BSS.



[ Reply to This | # ]
Save iTMS Music videos in iTunes 4.7.1
Authored by: Umpa-Spain on May 02, '05 12:19:30PM

First you need is to go to the Itunes Music Store's Music Videos section, right click on the thumbnail you want to save ans select "Copy iTunes Music Store URL", then run my first posted above.

Eeeeasy ;)

---
The Keymaker...



[ Reply to This | # ]
Save iTMS Music videos in iTunes 4.7.1
Authored by: BSS on May 02, '05 11:54:19PM

Thanks Keymaker. Sorry for my dumbness.



[ Reply to This | # ]
Save iTMS Music videos in iTunes 4.7.1
Authored by: thenss on May 03, '05 06:40:08PM

did you try useing iTMS Extractor

http://www.isophonic.net/applications/



[ Reply to This | # ]
Save iTMS Music videos in iTunes 4.7.1
Authored by: awalls on May 07, '05 10:03:55AM

Excellent work Umpa the Keymaker

I find that as well as copying the video url with rh click, if I carry on into iTunes and let the large movie play, then using your script after the video has played in iTunes means your application starts my browser which then pulls the movie out of cache rather than waiting to download.. its a good way if you only have one or two movies you want to watch which is mostly the case here

anyway thanks for the hard work



[ Reply to This | # ]
Save iTMS Music videos in iTunes 4.7.1
Authored by: thenss on May 03, '05 06:42:18PM

did you try useing iTMS Extractor

http://www.isophonic.net/applications/



[ Reply to This | # ]
Save iTMS Music videos in iTunes 4.7.1
Authored by: dmarshall on May 04, '05 03:10:41PM

Not sure what my issue is but option clicking on the video doesnt offer any menus. I have also tried command, control and various combinations. How are you copying the url?



[ Reply to This | # ]
The script works, sort of
Authored by: ash7 on May 04, '05 05:56:16PM
You have to right-click (or control-click) on the image thumbnails while browsing the music videos to the the "Copy iTunes Music Store URL" option. That's the screen you see immediately after clicking "Music Videos" on the iTMS homepage. After you get the URL and run it through the script, you'll end up with a Safari window playing the movie. To save it, I used wget on the URL of the movie. QT7 Pro may work, I wouldn't know.

UNIX Geek Warning: The Following Is For Command Line Geeks Only

If you have wget, gzip, and mktemp (I have Fink installed), the following perl script I wrote will work. I saved mine as "GetMovie.pl", so to run it, you have to type:

./GetMovie.pl "http://phobos.apple.com/WebObjects/MZStore.woa/wa/viewVideo?b=a&videoId=930930"
The URL has to be in quotes.

#!/usr/bin/perl

use IO::Socket::INET;
$in_string = $ARGV[0];
if ( $in_string =~ /videoId=(\d+)/gi ) {
	$vid = $1;
} else {
	print "Given URL was invalid"; exit;
}

$socket = IO::Socket::INET->new("ax.phobos.apple.com.edgesuite.net:80") or die "Couldn't create socket";

print $socket "GET /WebObjects/MZStore.woa/wa/viewVideo?b=a&videoId=".$vid."&videoIndex=2 HTTP/1.0\r\nHost: ax.phobos.apple.com.edgesuite.net\r\nUser-Agent: Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en) AppleWebKit/312.1 (KHTML, like Gecko)\r\nAccept-Encoding: gzip\r\n\r\n";

while ( $line = <$socket> ) {
	$line =~ s/[\r\n]//gi;
	if ( $line =~ /^Content-Length: (\d+)/gi ) {
		$clen = $1;
	} elsif ($line eq "") {
		last;
	}
}

binmode($socket);read($socket,$gz_content,$clen);close $socket;

$temp_name = `mktemp`;
open(TEMP, ">$temp_name") or die "Unable to save gzip data to temp file";
binmode(TEMP);print TEMP $gz_content;close(TEMP);

$gz_output = `gunzip -d -c $temp_name`;
`rm $temp_name`;

$gz_output =~ /<MovieView(.*?) url=\"(.*?)\">/;
$mv_attr = $2;
$gz_output =~ /songName<\/key><string>(.*?)<\/string>/;
$movie_title = $1;
$gz_output =~ /playlistArtistName<\/key><string>(.*?)<\/string>/;
$movie_artist = $1;

$f_cmd = "wget -O \"$movie_artist - $movie_title.mov\" $mv_attr\n";

exec $f_cmd;


[ Reply to This | # ]
Save iTMS Music videos in iTunes 4.7.1
Authored by: hypert on May 04, '05 11:08:42PM

Thank you so much to "Umpa" for posting this AppleScript!

Prior to this post, I first used "iTMS Extractor" to copy iTMS videos. Later, I switched to an AppleScript that used the "lsof" command (list open files), based on an idea I saw here I believe. From the posts in this thread, I see that there is another method - finding the MOV file in a certain directory.

The iTMS, lsof, and directory methods all require waiting for the video to download before you can save it. And, it seems like QuickTime 7 breaks these.

Before seeing ash7's Perl script (nice job, BTW!), I took a shot at modifying Umpa's AppleScript. This version (like the Perl script) automatically gets the artist and song name and presents a Save dialog box with the filename filled in. After you pick where to save, the AppleScript runs "wget" in Terminal. Hope others find this as useful as I've found all the other methods presented here.


-- Original code by "Umpa-Spain", posted at http://www.macosxhints.com/article.php?story=20050425164738812
-- Modified by "hypert" to extract artist and song name, and download directly to disk using "wget"
-- wget can be installed by using "fink" (http://fink.sourceforge.net/index.php)

on run
	--We get the iTunes's url
	tell application "Finder"
		try
			set ITMS_URL to the clipboard as text
		on error
			display dialog "No iTunes URL found in the clipboard." & ¬
				"Please, go iTunes, and right click on the video you want to save and copy the url to the clipboard" buttons {"Cancel"}
		end try
	end tell
	
	--We extract de Video_ID of the selected video
	set AppleScript's text item delimiters to {"videoId="}
	set VIDEOID to item 2 of (every text item of ITMS_URL)
	
	--We tell to Safari open a new Url based in the previous ID, from we get the exact location of the movie
	set UrlBase to "http://ax.phobos.apple.com.edgesuite.net/WebObjects/MZStore.woa/wa/viewVideo?b=a&videoId=" & VIDEOID & "&videoIndex=2" as text
	tell application "Safari"
		make new document with properties {URL:UrlBase, visible:false}
	end tell
	
	--We wait 3 seconds while Safari laods the page, if not the script return an error
	set x to 0
	set curd to current date
	repeat until x = 15
		if curd + 3 < (current date) then set x to 15
	end repeat
	
	--We search in the source code of the page teh reference to the ".mov" file and set it's exactly location
	tell application "Safari"
		set videoURL to source of front document as text
		set AppleScript's text item delimiters to {"MovieView autoplay="}
		set videoURL to item 2 of (every text item of videoURL)
		set AppleScript's text item delimiters to {"http://"}
		set videoURL to item 2 of (every text item of videoURL)
		set AppleScript's text item delimiters to {".mov"}
		set videoURL to item 1 of (every text item of videoURL)
		set videoURL to "http://" & videoURL & ".mov"
		--display dialog videoURL
		
		set artist to source of front document as text
		set AppleScript's text item delimiters to {"<key>artistName</key> <string>"}
		-- Could also have used "<key>playlistArtistName</key><string>", which is sometimes
		-- different than "artistName" (note the space after the artistName key though!)
		set artist to item 2 of (every text item of artist)
		set AppleScript's text item delimiters to {"</string>"}
		set artist to item 1 of (every text item of artist)
		--display dialog artist
		
		set song to source of front document as text
		set AppleScript's text item delimiters to {"<key>songName</key><string>"}
		set song to item 2 of (every text item of song)
		set AppleScript's text item delimiters to {"</string>"}
		set song to item 1 of (every text item of song)
		--display dialog song
		
		--Close tab or window created before
		close front document
		
		--Opens the movie in Safari (or default web browser), whre we wait to the load is complete, and then we save it where we want ;)
		--open location codigo
	end tell
	
	set artist to clean(artist)
	set song to clean(song)
	
	set newFile to quoted form of POSIX path of (choose file name with prompt "Save movie as:" default name artist & " - " & song & ".mov")
	set theCommand to "/sw/bin/wget -O " & newFile & " " & videoURL
	--display dialog theCommand
	
	tell application "Terminal"
		activate
		do script theCommand
	end tell
end run

on clean(myString)
	-- Get rid of 
	set myString to searchReplace(myString, "&", "&")
	set myString to searchReplace(myString, "'", "'")
	return myString
end clean

on searchReplace(origStr, searchStr, replaceStr)
	-- Got this routine from
	-- http://www.builderau.com.au/program/development/0,39024626,20283486,00.htm
	set old_delim to AppleScript's text item delimiters
	set AppleScript's text item delimiters to searchStr
	set origStr to text items of origStr
	set AppleScript's text item delimiters to replaceStr
	set origStr to origStr as string
	set AppleScript's text item delimiters to old_delim
	return origStr
end searchReplace


[ Reply to This | # ]
Save iTMS Music videos in iTunes 4.7.1
Authored by: ehlers on May 05, '05 06:41:54AM

Nice script, I like it..

I replaced "/sw/bin/wget -O " by "curl -o " so it now works without installing wget. curl is part of OSX.



[ Reply to This | # ]
Save iTMS Music videos in iTunes 4.7.1
Authored by: hypert on May 05, '05 07:43:59AM

Good tip, thanks! I've seen curl used (by Perl's CPAN?), but never looked into it. Looks like it runs on just about all platforms, too, like wget. Cool. Anyone know any other advantages of one over the other, besides that curl is bundled with our OS?



[ Reply to This | # ]
wget is GPL, curl is MIT
Authored by: ash7 on May 05, '05 11:19:16AM

wget is also getting stale... I had noticed and didn't understand why. FreeBSD has a security advisory against wget that has yet to be resolved as well.



[ Reply to This | # ]
Save iTMS Music videos in iTunes 4.7.1
Authored by: patyny on May 10, '05 11:47:21AM

if it's not too much trouble ehlers, can you post an updated working script with your changes. I don't know how to do it myself. Thanks
(do I need fink for this)



[ Reply to This | # ]
Save iTMS Music videos in iTunes 4.7.1
Authored by: ehlers on May 10, '05 01:40:44PM
You don't need fink or something similar, just plain OS X. But I'm quite sure you need the BSD subsystem installed. With the finder look into /Library/Receipts. If you have a BSD.pkg you should be fine. Otherwise install the BSD subsystem from your MAC OS system cd.

In the meantime I added some try blocks to catch some errors.

Here's my current version.


-- Original code by "Umpa-Spain", posted at http://www.macosxhints.com/article.php?story=20050425164738812
-- Modified by "hypert" to extract artist and song name, and download directly to disk using "wget"
-- wget can be installed by using "fink" (http://fink.sourceforge.net/index.php)
-- Modified by Bernhard Ehlers to use curl instead of wget

on run
	--We get the iTunes's url
	tell application "Finder"
		try
			set ITMS_URL to the clipboard as text
		on error
			display dialog "No iTunes URL found in the clipboard." & return & ¬
				"Please, go iTunes, and right click on the video you want to save and copy the url to the clipboard." buttons {"Cancel"}
		end try
	end tell
	
	--We extract de Video_ID of the selected video
	set AppleScript's text item delimiters to {"videoId="}
	try
		set VIDEOID to item 2 of (every text item of ITMS_URL)
	on error
		display dialog "No iTunes URL found in the clipboard." & return & ¬
			"Please, go iTunes, and right click on the video you want to save and copy the url to the clipboard." buttons {"Cancel"}
	end try
	
	--We tell to Safari open a new Url based in the previous ID, from we get the exact location of the movie
	set UrlBase to "http://ax.phobos.apple.com.edgesuite.net/WebObjects/MZStore.woa/wa/viewVideo?b=a&videoId=" & VIDEOID & "&videoIndex=2" as text
	tell application "Safari"
		make new document with properties {URL:UrlBase, visible:false}
	end tell
	
	--We wait 3 seconds while Safari loads the page, if not the script return an error
	set x to 0
	set curd to current date
	repeat until x = 15
		if curd + 3 < (current date) then set x to 15
	end repeat
	
	--We search in the source code of the page teh reference to the ".mov" file and set it's exactly location
	tell application "Safari"
		set videoURL to source of front document as text
		set AppleScript's text item delimiters to {"MovieView autoplay="}
		set videoURL to item 2 of (every text item of videoURL)
		set AppleScript's text item delimiters to {"http://"}
		set videoURL to item 2 of (every text item of videoURL)
		set AppleScript's text item delimiters to {".mov"}
		set videoURL to item 1 of (every text item of videoURL)
		set videoURL to "http://" & videoURL & ".mov"
		--display dialog videoURL
		
		try
			set artist to source of front document as text
			set AppleScript's text item delimiters to {"<key>artistName</key> <string>"}
			-- Could also have used "<key>playlistArtistName</key><string>", which is sometimes
			-- different than "artistName" (note the space after the artistName key though!)
			set artist to item 2 of (every text item of artist)
			set AppleScript's text item delimiters to {"</string>"}
			set artist to item 1 of (every text item of artist)
		on error
			set artist to "Artist"
		end try
		
		--display dialog artist
		
		try
			set song to source of front document as text
			set AppleScript's text item delimiters to {"<key>songName</key><string>"}
			set song to item 2 of (every text item of song)
			set AppleScript's text item delimiters to {"</string>"}
			set song to item 1 of (every text item of song)
		on error
			set song to "Song"
		end try
		
		--display dialog song
		
		--Close tab or window created before
		close front document
		
		--Opens the movie in Safari (or default web browser), whre we wait to the load is complete, and then we save it where we want ;)
		--open location codigo
	end tell
	
	set artist to clean(artist)
	set song to clean(song)
	
	set newFile to quoted form of POSIX path of (choose file name with prompt "Save movie as:" default name artist & " - " & song & ".mov")
	set theCommand to "curl -o " & newFile & " " & videoURL
	--display dialog theCommand
	
	tell application "Terminal"
		activate
		do script theCommand
	end tell
end run

on clean(myString)
	-- Get rid of 
	set myString to searchReplace(myString, "&", "&")
	set myString to searchReplace(myString, "'", "'")
	return myString
end clean

on searchReplace(origStr, searchStr, replaceStr)
	-- Got this routine from
	-- http://www.builderau.com.au/program/development/0,39024626,20283486,00.htm
	set old_delim to AppleScript's text item delimiters
	set AppleScript's text item delimiters to searchStr
	set origStr to text items of origStr
	set AppleScript's text item delimiters to replaceStr
	set origStr to origStr as string
	set AppleScript's text item delimiters to old_delim
	return origStr
end searchReplace


[ Reply to This | # ]
Save iTMS Music videos in iTunes 4.7.1
Authored by: rmiller021 on May 17, '05 01:23:53PM
I fixed this so that it does not use safari at all now, it will just open up a single terminal window for the download.

-- Original code by "Umpa-Spain", posted at http://www.macosxhints.com/article.php?story=20050425164738812
-- Modified by "hypert" to extract artist and song name, and download directly to disk using "wget"
-- wget can be installed by using "fink" (http://fink.sourceforge.net/index.php)
-- Modified by Bernhard Ehlers to use curl instead of wget
-- Modifined by Rob Miller to stop the safari unpleasantness now uses only command line applications to retrieve the url
-- 			In short it makes it only spawn one window 

on run
	--We get the iTunes's url
	tell application "Finder"
		try
			set ITMS_URL to the clipboard as text
		on error
			display dialog "No iTunes URL found in the clipboard." & return & ¬
				"Please, go iTunes, and right click on the video you want to save and copy the url to the clipboard." buttons {"Cancel"}
		end try
	end tell
	
	--We extract de Video_ID of the selected video
	set AppleScript's text item delimiters to {"videoId="}
	try
		set VIDEOID to item 2 of (every text item of ITMS_URL)
	on error
		display dialog "No iTunes URL found in the clipboard." & return & ¬
			"Please, go iTunes, and right click on the video you want to save and copy the url to the clipboard." buttons {"Cancel"}
	end try
	
	--We tell to Safari open a new Url based in the previous ID, from we get the exact location of the movie
	set UrlBase to "http://ax.phobos.apple.com.edgesuite.net/WebObjects/MZStore.woa/wa/viewVideo?b=a&videoId=" & VIDEOID & "&videoIndex=2" as text
	
	--Use curl and gunzip to download the page and decompress it
	set rob to (do shell script "curl -s \"" & UrlBase & "\" | gunzip")
	
	
	--We search in the source code of the page teh reference to the ".mov" file and set it's exactly location
	
	set videoURL to rob as text
	set AppleScript's text item delimiters to {"MovieView autoplay="}
	set videoURL to item 2 of (every text item of videoURL)
	set AppleScript's text item delimiters to {"http://"}
	set videoURL to item 2 of (every text item of videoURL)
	set AppleScript's text item delimiters to {".mov"}
	set videoURL to item 1 of (every text item of videoURL)
	set videoURL to "http://" & videoURL & ".mov"
	--display dialog videoURL
	
	try
		--set artist to source of front document as text
		set artist to rob as text
		set AppleScript's text item delimiters to {"<key>artistName</key> <string>"}
		-- Could also have used "<key>playlistArtistName</key><string>", which is sometimes
		-- different than "artistName" (note the space after the artistName key though!)
		set artist to item 2 of (every text item of artist)
		set AppleScript's text item delimiters to {"</string>"}
		set artist to item 1 of (every text item of artist)
	on error
		set artist to "Artist"
	end try
	
	--display dialog artist
	
	try
		set song to source of front document as text
		set AppleScript's text item delimiters to {"<key>songName</key><string>"}
		set song to item 2 of (every text item of song)
		set AppleScript's text item delimiters to {"</string>"}
		set song to item 1 of (every text item of song)
	on error
		set song to "Song"
	end try
	
	set artist to clean(artist)
	set song to clean(song)
	
	set newFile to quoted form of POSIX path of (choose file name with prompt "Save movie as:" default name artist & " - " & song & ".mov")
	set theCommand to "curl -o " & newFile & " " & videoURL
	--display dialog theCommand
	--exit the terminal session
	set theCommand to theCommand & "; echo \"download complete\"; exit"
	tell application "Terminal"
		activate
		do script theCommand
	end tell
end run

on clean(myString)
	-- Get rid of 
	set myString to searchReplace(myString, "&", "&")
	set myString to searchReplace(myString, "'", "'")
	return myString
end clean

on searchReplace(origStr, searchStr, replaceStr)
	-- Got this routine from
	-- http://www.builderau.com.au/program/development/0,39024626,20283486,00.htm
	set old_delim to AppleScript's text item delimiters
	set AppleScript's text item delimiters to searchStr
	set origStr to text items of origStr
	set AppleScript's text item delimiters to replaceStr
	set origStr to origStr as string
	set AppleScript's text item delimiters to old_delim
	return origStr
end searchReplace

---
Do you think at 900 char system call is a problem? I love embedding applescripts in c++ :)

[ Reply to This | # ]

Save iTMS Music videos in iTunes 4.7.1
Authored by: hypert on May 18, '05 08:22:31AM

Thanks for the "curl | gunzip" trick! Wish I had thought of that... :-)



[ Reply to This | # ]
Save iTMS Music videos in iTunes 4.7.1
Authored by: rmiller021 on May 18, '05 10:25:11AM
I tried it on a hunch, i am glad it worked

I did notice a problem with my code though
set song to source of front document as text

needs to be changed to
set song to rob as text


[ Reply to This | # ]
Save iTMS Music videos in iTunes 4.7.1
Authored by: kevvz on May 09, '05 10:19:30PM

Does anyone know if this method breaks in iTunes 4.8?



[ Reply to This | # ]
Save iTMS Music videos in iTunes 4.7.1
Authored by: Umpa-Spain on May 10, '05 10:30:10AM

The script works OK with oTunes 4.8 ;-)

---
The Keymaker...



[ Reply to This | # ]
Save iTMS Music videos in iTunes 4.7.1
Authored by: Anonymous on May 10, '05 11:33:33PM
This one just opens the actual url of whatever size of the movie you copied in your browser. From there, you can choose to save it or not:
on run
   --Extract videoId of the selected video
   set AppleScript's text item delimiters to {"videoId="}

   --Open a new url based in the previous ID. This is how we get the exact location of the movie
   set UrlBase to "http://ax.phobos.apple.com.edgesuite.net/WebObjects/MZStore.woa/wa/viewVideo?b=a&videoId=" & (item 2 of (every text item of (the clipboard as text)))
   tell application "Safari" to make new document with properties {URL:UrlBase, visible:false}
   
   --Search in the source code of the page the reference to the ".mov" file and get it's exact location
   tell application "Safari"
      delay 3
      set codigo to source of front document as text
      set AppleScript's text item delimiters to {"MovieView autoplay="}
      set codigo to item 2 of (every text item of codigo)
      set AppleScript's text item delimiters to {"http://"}
      set codigo to item 2 of (every text item of codigo)
      set AppleScript's text item delimiters to {".mov"}
      set codigo to item 1 of (every text item of codigo)
      quit
   end tell
   
   --Open the movie in default web browser
   tell application "Finder" to open location "http://" & codigo & ".mov"
   
end run


[ Reply to This | # ]
Save iTMS Music videos in iTunes 4.8 with Automator (10.4)
Authored by: jwoolson on May 12, '05 09:26:34AM
The smart kids at Apple-X.net have figured out the whole process and provide a complete Automator workflow and script at the bottom of the post on this page. Very nice, guys. Thank you all for the great solution and discussion.

---
Jonathan Woolson
www.thinkplaydesign.com


[ Reply to This | # ]

[Updated for iTunes 4.8] Save iTMS Music videos in iTunes 4.8
Authored by: alazzaro on May 12, '05 05:04:15PM
This Automator file (based the file from the guys at apple-x.net) automatically downloads the movie file, adds it to the iTunes Library and plays it. Click here for the automator file. It has been saved as a Plug-In for the Script menu. Such drop it in the following location '~/Library/iTunes/Scripts/'

[ Reply to This | # ]
[Updated for iTunes 4.8] Save iTMS Music videos in iTunes 4.8
Authored by: AH on May 16, '05 04:39:19AM

I can't get this to work with iTunes 4.8.

I always get a AppleScriptError:
"„item 2 of {"SoundSource"}" kann nicht gelesen werden. (-1728)"

"kann nicht gelesen werden" just means "can't be read"



[ Reply to This | # ]
[Updated for iTunes 4.8] Save iTMS Music videos in iTunes 4.8
Authored by: AH on May 17, '05 01:18:16PM

I think the problem is with Quicktime 7.0, because I can't "right click" on the video in iTunes to get the URL...

Can anybody with iTunes 4.7.1 or 4.8 and Quicktime 7 run it?



[ Reply to This | # ]
Works with 4.7.1 and QT 7 Basic
Authored by: ash7 on May 23, '05 10:03:09PM

Right clicking is allowed with a 4.7.1 and QT 7 Basic setup.



[ Reply to This | # ]
Works with 4.7.1 and QT 7 Basic
Authored by: AH on May 24, '05 10:20:27AM

I installed iTunes 4.8 and when I try to "downgrade" to 4.7.1 again,
right click isn't supportet anymore...
Must have changed something more then just the iTunes application, I guess.



[ Reply to This | # ]
[Updated for iTunes 4.8] Save iTMS Music videos in iTunes 4.8
Authored by: jedik on May 17, '05 01:52:43PM

Same here: does not work (iTunes 4.8, OS X 10.4.1).

I hope this can be fixed soon.

---
:: Jedi Knight ::
-- Mac Rules! --



[ Reply to This | # ]
[Updated for iTunes 4.8] Save iTMS Music videos in iTunes 4.8
Authored by: jedik on May 17, '05 02:29:02PM
I guess I found the bug. Open the workflow in Automator, then in the first AppleSript, change:
set UrlBase to "http://ax.phobos.apple.com.edgesuite.net/WebObjects/
MZStore.woa/wa/viewVideo?b=a&videoId=" & VIDEOID & "&videoIndex=2..." as text
to
set UrlBase to "http://ax.phobos.apple.com.edgesuite.net/WebObjects/
MZStore.woa/wa/viewVideo?b=a&videoId=" & VIDEOID & "&videoIndex=2" as text
(remove the trailing "..." after videoIndex=2). This fixed it to me.

Cheers

---
:: Jedi Knight ::
-- Mac Rules! --

[ Reply to This | # ]

[Updated for iTunes 4.8] Save iTMS Music videos in iTunes 4.8
Authored by: AH on May 24, '05 10:16:16AM

...still not working for me.
I get the same error as before, and I wonder why it works for some and for some it won't?
But thanks for the afford and nice you fixed it for your use...



[ Reply to This | # ]
[Updated for iTunes 4.8] Save iTMS Music videos in iTunes 4.8
Authored by: jeffmosher on May 23, '05 09:29:21PM

I can't seem to get the automator script to show up in my itunes script menu.
I see all the other scripts like add to itunes library, etc, but not the automator script.
Any ideas?

Thanks in advance!



[ Reply to This | # ]
[Updated for iTunes 4.8] Save iTMS Music videos in iTunes 4.8
Authored by: jiclark on Jun 22, '05 11:54:00PM

Bag the Automator stuff... Just use the long AppleScript that Miller021 posted above. I pasted it into Script Editor, compiled and saved it as a script in iTunes' Scripts folder, then copied the URL to a video in the iTMS, then ran the script. It proceeded to download in a Terminal window. It took all of a couple minutes to get set up. I'm running iTunes 4.8 and OS X.4.1

It seems the only other stumbling block is realizing that you have to be viewing a page in iTunes that is just BEFORE you actually view the video, in order to be able to right-click and copy the URL. This is a little different from the old way we did it, so it's a bit confusing...

Good luck,
John-o



[ Reply to This | # ]
Save iTMS Music videos with curl [and a patch to clean()]
Authored by: hypert on Jun 29, '05 12:16:37AM
My script and miller021's seems broken - for me. Is anyone else having a problem this week? I'm getting an error from the part of the script that pipes curl through gunzip. Gunzip is complaining that the STDIN is not in gzip format. I'm not sure what format is coming back from the "UrlBase" URL - it's some binary format.

Does anyone know how to identify the data coming back from that URL?!?

On a different note, I see that my original clean() function got corrupted because of the special/HTML characters. It should look like:


on clean(myString)
	-- Get rid of HTML characters
	set myString to searchReplace(myString, "&", "&")
	set myString to searchReplace(myString, "'", "'")
	return myString
end clean


[ Reply to This | # ]
The clean() function
Authored by: hypert on Jun 29, '05 09:47:36PM
Aaarrgghh!

The characters in clean() keep getting goofed up. In the first replacement, the first ampersand you see should be the HTML representation of an ampersand (which is an ampersand followed by the characters amp;). The second replacement is to replace the HTML representation of a single-quote. So, the first single-quote (inside the double quotes) is actually supposed to be an ampersand followed by #39;.

This will replace the goofy HTML representation of ampersands and single-quotes with the "normal" (ASCII) representations. You can add more to clean() if you come across them, but those are the only ones I've seen so far.

[ Reply to This | # ]

Save iTMS Music videos with curl [and a patch to clean()]
Authored by: codeman38 on Jul 01, '05 11:00:33PM

Yep... used to work for me, but now I'm getting weird binary garbage when the reference URL is loaded. Argh.



[ Reply to This | # ]
Save iTMS Music videos with curl [and a patch to clean()]
Authored by: codeman38 on Jul 01, '05 11:27:30PM

Aha. Apparently it's AES-encrypted now-- using [i]curl -v[/i], I found that the Content-Encoding header includes "x-aes-cbc", and there are "x-apple-twofish-key" and "x-apple-crypto-iv" headers as well.

Now if only someone can find the magic combination to decrypt this...



[ Reply to This | # ]
Doesn't work any more in iTunes 4.9
Authored by: BSS on Jul 03, '05 12:27:41PM

Hope someone will find a way again.



[ Reply to This | # ]
Doesn't work any more in iTunes 4.9
Authored by: fragmentoflight on Jul 06, '05 12:57:18AM

Actually the solution is really really simple, I just don't like posting it so apple doesn't go and fix it right up a day later. Although i have no desire to keep it to myself.... anyone that's wants the solutions, just let me know and i'll email it to you



[ Reply to This | # ]
Save iTMS Music videos in iTunes 4.7.1
Authored by: fragmentoflight on Jul 06, '05 01:19:59AM

Saving the music videos aren't actually that difficult, I figured it out a few days ago. I'm curious as to people's thoughts on posting hacks openly. While it eventually gets backs to apple, I think people should be more quiet about such things, I don't really know of a solution to the problem but if they don't about it they can't block it, but unfortunately i don't favor making this info hard to find either



[ Reply to This | # ]
Save iTMS Music videos in iTunes 4.7.1
Authored by: fragmentoflight on Jul 06, '05 02:21:09PM

Okay, I wasn't thinking when I posted to email me about the solution, haha, for some reason it didn' click that i'm going to have half the mac user base emailing me, although I only recieved three this morning, which isn't bad. It could get worse. It's inevtiable that apple is going to break it, and I wanted to automate it first, i'm currently learning perl, and it probably would be that hard to bake up a perl script to do it. Okay so here's the solution, it's crude but really easy.



first you need tcpflow for osx 'm too lazy right now to go get a link, you'll can google it yahoo it whatever

once you install that it should be in your usr/local/bin folder thus

sudo /usr/local/bin/tcpflow -c -i en1 >dump.txt

go itunes music store

click on video size you want

stop video

go back to terminal and ctrl-c the process

type grep "Host: " dump.txt

you will see a list of servers, the last one or one of them should be a680.phobos.apple.com or whatever, the a680 part will change each time

copy that

type grep "Features" dump.txt

you will see something like GET /Features/y2005/m06/d28/h13/dj.lwxzhkur.mov just copy everything after the GET

then put the two together the host and path

then curl it or post it in your browser if you have quicktime pro, once it finishes downloading you can save it as a self contained movie or like this just curl it

ButterflyCrashes:~ ember$ curl -O a680.phobos.apple.com/Features/y2005/m06/d28/h13/dj.lwxzhkur.mov
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 39.2M 100 39.2M 0 0 398k 0 0:01:40 0:01:40 --:--:-- 449k
ButterflyCrashes:~ ember$

and that will download the movie straight from the servers

A note on tcpflow, is you are using line ethernet, you will need change the i- en1 to eth0 or something, or just leave it out and it will default, the en1 is for airport

If anyone could automate this it would be helpful, and this could be greatly simplified which i tried doing, but not that great with modfying pipes.. and of course I don't know enough about perl yet, although i did bake up a half ass perl script.... anyway have fun, get lots of videos before apple shuts us down again!





[ Reply to This | # ]
Save iTMS Music videos in iTunes 4.7.1
Authored by: webzone on Jul 06, '05 06:30:52PM

It is not mandatory to check what host was used to download the file. The same content is available on every server. I think that different hosts are used only to distribute the load and prevent delays.

To save time, you could just check the filename (grep "Features" dump.txt) and use the same host all the time.

Here are some hosts so that you do not have to check
a41.phobos.apple.com
a659.phobos.apple.com
a687.phobos.apple.com
a1150.phobos.apple.com



[ Reply to This | # ]
Save iTMS Music videos in iTunes 4.7.1
Authored by: hypert on Jul 07, '05 12:23:59AM
One last note, before I call it quits for the night. If I get more time to play with tcpflow (or maybe someone already knows how to do this), the only packet we need to look at has this format:
192.168.000.101.51849-064.086.089.009.00080: GET /Features/y2005/m06/d21/h14/dj.ogikntir.mov HTTP/1.1
User-Agent: QTS (qtver=7.0.1;cpu=PPC;os=Mac 10.4.1)
Accept: */*
Connection: close
Host: a1710.phobos.apple.com
tcpflow supports "expressions" such that we should be able to filter accesses to "*.phobos.apple.com" or to "064.086.089.*". Combine that with a limited byte-count option, and we might not even have to Ctrl-C tcpflow to stop it. This would make it EASY to call from inside a script (I'm no good dealing with pipes, either).

I'll follow-up when I have more time, or maybe someone else will pick this up before I do...

[ Reply to This | # ]

Save iTMS Music videos in iTunes 4.7.1
Authored by: hypert on Jul 07, '05 12:04:26AM
Thanks for figuring out a way to still do this. I'm not sure how automated I can make this, but I will work on it (later). I did see this in my dump after clicking on the video icon/artwork (before selecting Small or Large):
x-apple-twofish-key: 383D8A44A1E11745915B7FF49E9FA98D
Content-Encoding: gzip, x-aes-cbc
x-apple-crypto-iv: 5bebcd82a3a0bba784a06b39d721c95b
Aaarrgghh! Apple did encrypt the webpage. So, anyone know how to crack Twofish? :-)

[ Reply to This | # ]
Save iTMS Music videos in iTunes 4.7.1
Authored by: fragmentoflight on Jul 07, '05 02:07:00PM

As long as we can still the find the GET request, we shoudl always be able to get the videos. The only thing I can really think of to block my method is to encrypt the entire file, or set up a secure authorization between the itunes client and the servers. Personally I think it's a little too easy? The encrypted the headers, but left open the ability to simply to fake the final request. They could of simply added Fair Play to the videos and let people keep them on the computer... then again Fair Play's days, at least version 2 is over, as that thing has been cracked wider then humpty. Be ready to start over in iTunes version 5

Hello cat
I'm mouse...



[ Reply to This | # ]
Save iTMS Music videos in iTunes 4.7.1
Authored by: hypert on Jul 07, '05 02:58:21PM
Yeah, I thought it was very strange to encrypt the lead-in pages and not the MOV itself. Of course, that might be next, even before iTunes 5 (which had better add folders/hierarchy to the playlist management!).

Still, I'm bummed that my method of saving the video with the Artist/Title info in the filename won't work anymore. :-(

I've started a forum thread so that we might dive into this some more (without cluttering this Hint more than it is), and so that people can subscribe to the thread (instead of having to keeping checking this hint manually).

[ Reply to This | # ]

Save iTMS Music videos in iTunes 4.7.1
Authored by: awalls on Jul 07, '05 04:20:40PM

Looks like something is going to happen before iTunes 5 is released. For a lot of the daytime today iTunes store has not been available in the UK which i put down to the 500 millioneth song promotion. But tonight at home my 3 UK OS X macs can get into the american iTunes store but when requesting videos we are pushed back to the lacklustre UK video list of 103 duller than dull videos despite store home still being listed as as America.

I have suspected that the reason apple were tightening up on saving videos was not record company rights management concerns... they must be trying to close a free resource stream ready for the hard sell of video iPod will necessitate. The other main uk source of downloadable Quicktime music videos which partners with apple has also started only supplying streaming videos



[ Reply to This | # ]
Save iTMS Music videos in iTunes 4.7.1
Authored by: ssevennm on Aug 25, '05 11:58:43AM

Sure, try this.



[ Reply to This | # ]
Save iTMS Music videos in iTunes 4.7.1
Authored by: maksim on Jul 07, '05 08:46:17PM

Thanks to fragmentoflight, I made a little bash script.

You need tcpflow, that you could find here : http://www2.entropy.ch/download/tcpflow-0.21.pkg.tar.gz

For the newbies -> How to make a script :
1) put the code in a simple texte file
2) in the terminal, make it executable in typing "chmod u+x extractor" (if you have named your file 'extractor', of course)
3) launch it on typing "./extractor"


#! bin/bash
sudo echo
sudo -b /usr/local/bin/tcpflow -c -i en1 > dump.txt
echo "Hit Return when iTunes begin to play"
read something
set `ps -a | grep tcpflow`
sudo kill -9 $1
IFS=" "
set `grep "Host: [a-z][0-9]" dump.txt | grep "phobos"`
variable0=$2
IFS="."
set $variable0
variable0=$1
IFS=" "
set `grep "Features" dump.txt`
variable1=$3
IFS=""
variable2="$variable0.phobos.apple.com$variable1"
/bin/rm dump.txt
curl -O $variable2



How to use ?
1) Go to iTunes, select the video that you want, but DON'T play. Just be ready to play on clicking on the size.
2) Launch the script (on the terminal, typing "./extractor", and enter your password).
3) Go back to iTunes, click on video size you want and wait that iTunes begins to play.
4) Now, go back to the Terminal, and hit `Return`.

That's all, the video will be save in the same folder than the script.



[ Reply to This | # ]
Save iTMS Music videos in iTunes 4.7.1
Authored by: Ganymede on Jul 08, '05 05:43:43AM

Hi, I'm hanging on by a thread!! :rolleyes:

I downloaded and installed tcpflow. I copied the textfile, made it executable per your instructions. I keep getting this error:

ganymede@GanyG4 /Users/ganymede/Applications % chmod u+x itmsvidext
ganymede@GanyG4 /Users/ganymede/Applications % ./itmsvidext
tcsh: ./itmsvidext: Exec format error. Binary file not executable.
Exit 1

I put the file in my local Applications directory, and I'm in that dir when I try to run it in the terminal. Does it have to be in one of the special "path" folders? (Also, how do I add directories to my pathlist??)

Why does the error come from tcsh, my interactive shell - the script specifies bash. What do I need to change?

My ethernet is en0. Do I need to change the occurrence of en1 in the script? I've already tried it both ways, the error remains the same.
I tried making the file using Word. BBEdit, and textEdit.

I'm running OSX 10.3.9, iTunes 4.8, & QuickTime 6.5.2 on a 733mHz G4 (Digital Audio) with a gig of memory. I am still able to capture the videos "the old way" from the /private/tmp/501/TemporaryItems directory - I just snagged ColdPlay's Speed Of Sound.

I greatly appreciate any advice on the Unix/Terminal/Command File topics - thanks for all your hard work, and for sharing your knowledge in these forums...;)

Ganymede



[ Reply to This | # ]
Save iTMS Music videos in iTunes 4.7.1
Authored by: fragmentoflight on Jul 10, '05 01:06:44AM

Just type sudo sh <filename>



[ Reply to This | # ]
Save iTMS Music videos in iTunes 4.7.1
Authored by: jedik on Jul 10, '05 01:03:32PM
I had to change the first line to:
#!/bin/bash
for the shell script to work. Worked like a charm, BTW. :)
Cheers

---
:: Jedi Knight ::
-- Mac Rules! --

[ Reply to This | # ]

Save iTMS Music videos in iTunes 4.7.1
Authored by: BSS on Jul 12, '05 12:15:02PM

Obviously, I'm a newbie. I don't understand the front bit about making a script and run it in Terminal. Help. Thanks in advance.

I have tcpflow installed.



[ Reply to This | # ]
Save iTMS Music videos in iTunes 4.7.1
Authored by: BSS on Jul 16, '05 03:10:49PM

Help?



[ Reply to This | # ]
Save iTMS Music videos in iTunes 4.7.1
Authored by: Ganymede on Jul 17, '05 08:31:40AM

I made the change Jedik suggested, still no luck. Same error as before:

tcsh: ./itmsvidext: Exec format error. Binary file not executable.
Exit 1

When I switch to bash to run it, the error message is shorter still:

can't execute binary

?? Help??



[ Reply to This | # ]
Save iTMS Music videos in iTunes 4.7.1
Authored by: Eric24601 on Sep 19, '05 02:07:21PM

Is there a way to do this in iTunes 5 ? I tried running the script using iTunes 5 but it doesn't work. Does anyone have a modified version of this script that would run on iTunes 5?



[ Reply to This | # ]
Save iTMS Music videos in iTunes 4.7.1
Authored by: mithridain on Oct 10, '05 06:33:01PM

The method using tcpflow works with iTunes 5.0 and QuickTime 7.



[ Reply to This | # ]
Save iTMS Music videos in iTunes 4.7.1
Authored by: mithridain on Oct 13, '05 03:46:20PM

They've changed how ITMS handles music videos. Now, it's like previewing songs so you only get a snippet.

The tcpflow did work with iTunes 6, but not after they changed the way the store works.

Does anyone know of another way around?



[ Reply to This | # ]