The Apple website contains a significant amount of movie trailers. This site includes all the trailers of films which are reasonably well-known. It also provides, for most of them, trailers in HD (High-Definition) format which have a small protection to prevent the download of its content. Hence, I’ve created a script which downloads the trailers in High-Definition.
This kind of protection is basic: there’s a link-file which the user can open through QuickTime, for example, and that file has the name of the real video file. In fact, that video file has a small difference, it has a character add-on.
Thus, after a thorough analysis, I found out the small differences in each file and I’ve created this script. I’m going to publish two versions in this article: in the first one you can choose the HD quality: 480p or 720p or 1020p; while in the second one you can download in 720p quality. Most PCs have a resolution of approximately 720p (opportunity to say that if you want it with another quality you may ask).
So, the functioning of the script is simple: you run it and then it will ask you for the link of the film (you can put the direct link of the film, or the link to the page in HD of the film). After that, it will ask you the quality (the 720p version doesn’t have this option for the script), and it will immediately begin the download. In the end, if the file already existed it will indicate error. If you have successfully managed to copy the trailer, a message indicating success will be displayed. Note that all trailers which are available for that particular film are copied, in the chosen quality.
Aspects to be developed
Since the version is still in development, some small basic options are missing. Note:
1. It only tells you that the trailer already exists at the end of the download;
2. It doesn’t have a native progress bar, therefore, to see the progress, the script has to be opened in the terminal;
3. It only downloads HD trailers, so it doesn’t have the option of downloading trailers with lower quality;
4. It doesn’t include the option of choosing a specific trailer, it downloads all the trailers which are available for that particular film and resolution;
5. It could also be more compact, but since there isn't much processing, I didn’t care about the programming quality, but the practical results.
How to install it?
Its installation is simple: download the script file, open the terminal and go to the folder where you saved the file. Then, in order to make the script executable, type the following:
For the full version:
Or to 720p version:
After that, the script is ready to be used, just do the following on the terminal to run it:
For the full version:
Or to 720p version:
File download
Now that I’ve explained its functionalities and problems, I’m going to indicate the links for the download of the two versions and then I will show you the content of each script.
Full version.
720p version.
Code
Full version.
#!/bin/bash
####################################################
#Visit my blog: http://ubuntued.info/ #
####################################################
name=$( zenity --entry --text="URL:" --title="Apple Trailers")
temp=$(echo $name grep "/hd/")
if [[ $temp = "" ]]
then name=$(echo $name"hd/")
fi
quality=$(zenity --text="Which quality do you wish?" --list --radiolist --column sel --column sel2 1 480 2 720 3 1080)
if [[ $name != "" ]]
then
wget $name -File.html
case $quality
in
480)
action=$(cat file.html grep 480 awk -F"','" '{ print $10 }' awk -F"480" '{ print "wget " $1 "h480" $2 }')
;;
720)
action=$(cat file.html grep 720 awk -F"','" '{ print $10 }' awk -F"720" '{ print "wget " $1 "h720" $2 }')
;;
1080)
action=$(cat file.html grep 1080 awk -F"','" '{ print $10 }' awk -F"1080" '{ print "wget " $1 "h1080" $2 }')
;;
esac
rm file.html
action=$(echo $action awk -F"/" '{ print $NF }')
existent=$(ls grep "$action")
if [[ $existent = $action ]]
then zenity --question --text="You already have this trailer: \n \t (File's name: $existent ).\n Do you wish to continue?" exit
fi
$action sh
existent=$(ls grep "$action")
if [[ $existent = $action ]]
then zenity --info --text="Well-succeeded, the file was saved as $existent"
else zenity --error --text="Fail ocurred. Possible problems: The file already existed or the download couldn't be done."
fi
fi
Versão 720p.
#!/bin/bash
####################################################
#Visit my blog: http://ubuntued.info/ #
####################################################
name=$( zenity --entry --text="URL:" --title="Apple Trailers")
temp=$(echo $name grep "/hd/")
if [[ $temp = "" ]]
then name=$(echo $name"hd/")
fi
if [[ $name != "" ]]
then
wget $name -File.html
action=$(cat file.html grep 720 awk -F"','" '{ print $10 }' awk -F"720" '{ print "wget " $1 "h720" $2 }')
rm file.html
action=$(echo $action awk -F"/" '{ print $NF }')
existent=$(ls grep "$action")
if [[ $existent = $action ]]
then zenity --question --text="You already have this trailer: \n \t (File's name: $existent ).\n Do you wish to continue?" exit
fi
$action sh
existent=$(ls grep "$action")
if [[ $existent = $action ]]
then zenity --info --text="Well-succeeded, the file was saved as $existe"
else zenity --error --text="Fail ocurred. Possible problems: The file already existed or the download couldn't be done."
fi
fi
Finally, I would like to inform that whenever I update this script, only this web page will be updated, so if you want to be constantly updated leave a comment and activate the option "Notify me of follow up comments via e-mail." So when I update, I will write an informative comment about the new update and you’ll be notified (:
UPDATES
[2008 Jul 08]
As I have mentioned, I will update this script so that it becomes more effective, more embracing and with fewer errors. Thus, this new update informs you if the trailer you want to copy exists before downloading it.
How to download HD trailers from Apple
Adjust the transparency of window decorations
The special effects (Compiz) of ubuntu windows use the GTK by default. To adjust the transparency of the windows just go to the configuration editor of GNOME and change the values in the way you want.
1. Press ALT+F2 to open "Run Application";
2. Write gconf-editor and run;
3. Go to apps->gwd and you’ll find the following lines:
metacity_theme_active_opacity -> Value of transparency of the windows on which we are working;
metacity_theme_opacity -> Value of transparency of the windows which are behind.
Value "1" indicates "without any transparency"; value "0" indicates "maximum transparency" (other than invisibility).
Find the quickest repository
Ubuntu offers a huge variety of repository servers. There are servers in many countries and many of these countries have more than one server. But, which one is the fastest?
There is an option which tests which server is the fastest to respond to our connection.
Procedure:
Mount ISO files with just 2 clicks
Sometimes we need to use ISO files, but we don’t want to record a CD/DVD for that purpose. But mounting an iso file, without scripts, would be a little complicated for beginners, so it is best to install two scripts, one to mount and the other one to unmount.
You simply have to download the files mount and unmount and install them in the nautilus. If you don’t know how to install scripts, visit this link.
This information was taken from this site:
http://ubuntuforums.org/showthread.php?t=87369
Increase Ubuntu speed with preload
Preload is a program which analyses the applications the user uses the most to subsequently predict what applications will be run. Therefore, it stores the dependencies of those programs in the computer’s memory, in order to be faster to boot up.
Install preload
For further information:
http://sourceforge.net/projects/preload
I strongly advise you to use this program!
Versão portuguesa
Version française
Spelling correction on kile
For those who don’t have KDE installed on Ubuntu, having the spelling correction on kile (one of the best programs to work in latex) is a big problem. The solution is to install the package aspell, and manually force the applications of KDE to use this package for the corrections.
Therefore, the process is the following:
Update:[KSpell]
KSpell_Client=1
KSpell_DictFromList=1
KSpell_Dictionary=en
KSpell_Encoding=11
KSpell_NoRootAffix=0
KSpell_RunTogether=0
In order not to waste much time, the solution is simple, just do what’s indicated in line 1, and write this in the terminal:
Versão portuguesa
Version française
How to install Nautilus scripts
Thus, to install a script we should do the following process:
- copy the script into the home folder;
- go to terminal and write:
- and then write (please note that the script's name is attached to the slash "/"):
As I said earlier, it’s best for you to install a script that installs scripts, so here’s a hint:
- Download this file;
- Copy the file into the home folder;
- Open the terminal application;
- Write:
- and write:
And that’s it, from now on when it’s necessary to install a script, just click on the right mouse button on the file you want to install and choose scripts->make-nautilus-script.
Note that I found the file on the site http://g-scripts.sourceforge.net/, which has many other scripts.
Versão portuguesa
Version française Read more...
Learn which version of Ubuntu you have
It’s very likely that everyone knows which version of Ubuntu they are using, nonetheless, here is the command of the terminal:
Versão portuguesa
Version française
PrintScreen of a window
To only capture the current window, just click on Alt+PrtScrn. Very easy.
Versão portuguesa
Version française
How to install the new Amarok 2
The new AmaroK is coming and you can already download the version in development. This version is still at an initial stage and therefore the amount of bugs can still be big. However, if you want to try and send reports of bugs to the developers in order to help their development, continue reading. Installation
This application has a new service named Neon, a service that allows the users to have the latest version of AmaroK which is being developed. This service is nothing else than a repository that is always updated and warns your Operating System when there are new updates.
This new AmaroK, which is still at an early stage of development, works at the same time with the normal Amarok in order to prevent serious problems on your reproduction lists, for example. Thus, this experimental version is called amarok-nightly on the one hand to be different and on the other hand to allow both programs to be installed at the same time.
To add this new repository run the following line at the terminal (note that this repository exclusively operates for the Ubuntu Hardy Heron):
After adding this line, you should update the available lists of programs. You can do it in two ways, by the terminal, doing:
After you have updated the lists you can install the new Amarok, or again by the terminal:
or in the window Synaptic Manager Packages, looking for the package amarok-nightly and installing it.
Quicker and easier installation
The line below makes everything the way I said earlier. So, I advise you to copy and paste in the terminal, and wait for it to do the whole process and then the program will be ready for use:
Article based on this site.
Versão portuguesa
Version française
Icons in Ubuntu desktop
Would you like to create a shortcut of "Computer" or of "Trash" or of "Network" on the desktop?
Now you have just to tick the different lines:
Versão portuguesa
Version française
AptURL protocol handler
The aptURL is a program that detects special links to install packages of Ubuntu. In Hardy Heron (Ubuntu 8.04 and forward Ubuntu's) this program is already installed, so any user can click on one of those links. This blog will normally show all programs in that way.
For those who do not have the latest version of Ubuntu, you can go to Terminal (Applications -> Accessories->Terminal) and write:
or, in a more complicated way, you can open the Synaptic Package Manager (System-> Administration->Synaptic Package Manager), search for the package apturl, click on the right mouse button and choose "Mark for installation" and then click on Apply .
This is the window that is displayed when we click on a special link to install a particular application / package:
If the package is already installed this message will show up:
This program is at least compatible with Firefox and Epiphany. Here’s a good example of a link which installs the program AmaroK:
Click here to install AmaroK.
Versão em Português.
Version Française.