|
1 | | -*NIX command line tool for retrieving IMDb movie information |
2 | | -============================================================ |
3 | | - |
4 | | -### Usage: |
5 | | - |
6 | | -First set up an alias for the command: |
7 | | - |
8 | | - alias imdbtool="python /path/to/imdbtool.py" |
9 | | - |
10 | | -### Some interesting usage examples: |
11 | | - |
12 | | -Show all info about movie 'Cars' |
13 | | - |
14 | | - imdbtool -t Cars |
15 | | - |
16 | | -Show all info about latest 'True Grit' movie |
17 | | - |
18 | | - imdbtool -t "True Grit" |
19 | | - |
20 | | -Show all info about 1969 version of 'True Grit' |
21 | | - |
22 | | - imdbtool -t "True Grit" -y 1969 |
23 | | - |
24 | | -Show best guess for a misspelled name |
25 | | - |
26 | | - imdbtool -t "Ture git" |
27 | | - |
28 | | -Print movie's rating |
29 | | - |
30 | | - imdbtool -t Cars | sed -n '/^imdbrating/{n;p;}' |
31 | | - |
32 | | -Download movie's poster |
33 | | - |
34 | | - imdbtool -t Cars | wget `sed -n '/^poster/{n;p;}'` |
35 | | - |
36 | | - |
37 | | -### Additional useful features: |
38 | | - |
39 | | -Include full plot summary (not available for some movies) |
40 | | - |
41 | | - imdbtool -t "True Grit" --plot full |
42 | | - |
43 | | -Include additional data from Rotten Tomatoes |
44 | | - |
45 | | - imdbtool -t "True Grit" --tomatoes |
46 | | - |
47 | | -Show info by IMDb id |
48 | | - |
49 | | - imdbtool -i tt0103064 |
50 | | - |
51 | | -Print raw JSON or XML data |
52 | | - |
53 | | - imdbtool -t Cars -r JSON |
54 | | - |
55 | | - |
56 | | -### Example to get ratings for all movies in current directory (it will use directory and file names as movie titles): |
57 | | - |
58 | | -Save following code to file `get_ratings.sh` (make sure to update the path in line 3): |
59 | | - |
60 | | - ls -1 | |
61 | | - while read title; do |
62 | | - res=`python /path/to/imdbtool.py -t "$title"` |
63 | | - rating=`echo "$res" | sed -n '/^imdbrating/{n;p;}'` |
64 | | - restitle=`echo "$res" | sed -n '/^title/{n;p;}' | sed s/*//g` |
65 | | - year=`echo "$res" | sed -n '/^year/{n;p;}'` |
66 | | - echo "$title * $restitle * $year * $rating" |
67 | | - done |
68 | | - |
69 | | -Then execute the saved command to fetch all the ratings: `./get_ratings.sh > ratings.txt` |
70 | | -(it'll take a while to retrieve all the data). Then you can open the `ratings.txt` file to see the movie ratings, or you can sort the movies by ratings to pick the best one to watch: `< ratings.txt sort -t* -k4 -r` |
71 | | - |
72 | | - |
73 | | -## Notes ## |
74 | | - |
75 | | - - requires Python 2.7+ (or earlier with installed argparse package) |
76 | | - - for using it on Windows with Cygwin (which currently comes with Python 2.6) check out [this guide][cyg27] |
77 | | - - **thanks to creator of this [great site called IM-D-BAPI][imdbapi]** |
78 | | - |
79 | | -I was aware of [this existing tool][fetcher] but unfortunately it was broken at the time I tried it. My implementation relies on the third-party API that handles up to 2 million queries a day, so it's safe to assume that it's author will be keeping it up to date. |
80 | | -On the other hand, IMDb has jumped onto the douchebag bandwagon and issued a cease and desist order to the creator of the [IMDBAPI][imdbapi], so it might stop working any time. |
81 | | - |
82 | | - |
83 | | -## License ## |
84 | | - |
85 | | -This tool is licensed under [GNU Lesser GPL][lgpl] license. |
86 | | - |
87 | | - |
88 | | -[imdbapi]: http://www.imdbapi.com |
89 | | -[cyg27]: http://www.tux.org/~mayer/cygwin/python/index.html |
90 | | -[fetcher]: http://www.mutexes.org/imdb-movie-fetcher/ |
91 | | -[lgpl]: http://www.gnu.org/licenses/lgpl.html |
| 1 | +*NIX command line and GUI tool for retrieving OMDb movie/TV information |
| 2 | +============================================================ |
| 3 | + |
| 4 | +### Usage: |
| 5 | + |
| 6 | +First set up an alias for the command: |
| 7 | + |
| 8 | + alias omdbtool="python /path/to/omdbtool.py" |
| 9 | + |
| 10 | +Or for the gui: |
| 11 | + |
| 12 | + alias omdbtool="python /path/to/omdbtool-gui.py" |
| 13 | + |
| 14 | +Note: in order to use the gui you will need to install [Gooey][gooey] |
| 15 | + |
| 16 | + pip install Gooey |
| 17 | + |
| 18 | +### Some interesting usage examples: |
| 19 | + |
| 20 | +Show all info about the movie 'Cars' |
| 21 | + |
| 22 | + omdbtool -t Cars |
| 23 | + |
| 24 | +Show all info about the series 'Firefly' |
| 25 | + |
| 26 | + omdbtool -t firefly --type series |
| 27 | + |
| 28 | +Show all info about season 1 episode 1 of 'Firefly' |
| 29 | + |
| 30 | + omdbtool -t firefly --season 1 --episode 1 |
| 31 | + |
| 32 | +Show all info about season 1 of 'Firefly' |
| 33 | + |
| 34 | + omdbtool -r JSON -t firefly --season 1 |
| 35 | + |
| 36 | +Show all info about latest 'True Grit' movie |
| 37 | + |
| 38 | + omdbtool -t "True Grit" |
| 39 | + |
| 40 | +Show all info about 1969 version of 'True Grit' |
| 41 | + |
| 42 | + omdbtool -t "True Grit" -y 1969 |
| 43 | + |
| 44 | +Show best guess for a misspelled name |
| 45 | + |
| 46 | + omdbtool -t "Ture git" |
| 47 | + |
| 48 | +Print movie's rating |
| 49 | + |
| 50 | + omdbtool -t Cars | sed -n '/^imdbrating/{n;p;}' |
| 51 | + |
| 52 | +Download movie's poster |
| 53 | + |
| 54 | + omdbtool -t Cars | wget `sed -n '/^poster/{n;p;}'` |
| 55 | + |
| 56 | + |
| 57 | +### Additional useful features: |
| 58 | + |
| 59 | +Include full plot summary (not available for some movies) |
| 60 | + |
| 61 | + omdbtool -t "True Grit" --plot full |
| 62 | + |
| 63 | +Include additional data from Rotten Tomatoes |
| 64 | + |
| 65 | + omdbtool -t "True Grit" --tomatoes |
| 66 | + |
| 67 | +Show info by IMDb id |
| 68 | + |
| 69 | + omdbtool -i tt0103064 |
| 70 | + |
| 71 | +Print raw JSON or XML data |
| 72 | + |
| 73 | + omdbtool -t Cars -r JSON |
| 74 | + |
| 75 | +Print data formated as html |
| 76 | + |
| 77 | + omdbtool --format html -t cars |
| 78 | + |
| 79 | +Print data formated as markdown |
| 80 | + |
| 81 | + omdbtool --format markdown -t cars |
| 82 | + |
| 83 | + |
| 84 | + |
| 85 | +### Example to get ratings for all movies in current directory |
| 86 | + |
| 87 | +(it will use directory and file names as movie titles) |
| 88 | + |
| 89 | +Save following code to file `get_ratings.sh` (make sure to update the path in line 3): |
| 90 | + |
| 91 | + ls -1 | |
| 92 | + while read title; do |
| 93 | + res=`python /path/to/omdbtool.py -t "$title"` |
| 94 | + rating=`echo "$res" | sed -n '/^imdbrating/{n;p;}'` |
| 95 | + restitle=`echo "$res" | sed -n '/^title/{n;p;}' | sed s/*//g` |
| 96 | + year=`echo "$res" | sed -n '/^year/{n;p;}'` |
| 97 | + echo "$title * $restitle * $year * $rating" |
| 98 | + done |
| 99 | + |
| 100 | +Then execute the saved command to fetch all the ratings: `./get_ratings.sh > ratings.txt` |
| 101 | +(it'll take a while to retrieve all the data). Then you can open the `ratings.txt` file to see the movie ratings, or you can sort the movies by ratings to pick the best one to watch: `< ratings.txt sort -t* -k4 -r` |
| 102 | + |
| 103 | + |
| 104 | +## Notes ## |
| 105 | + |
| 106 | + - works with Python 3 and Python 2.7 or earlier with argparse package installed |
| 107 | + - **thanks to the creator of this [great site called OMDBAPI][omdbapi]** |
| 108 | + |
| 109 | + |
| 110 | +## License ## |
| 111 | + |
| 112 | +This tool is licensed under [GNU Lesser GPL][lgpl] license. |
| 113 | + |
| 114 | + |
| 115 | +[omdbapi]: http://www.omdbapi.com |
| 116 | +[lgpl]: http://www.gnu.org/licenses/lgpl.html |
| 117 | +[gooey]: https://github.com/chriskiehl/Gooey |
0 commit comments