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


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: 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 | # ]